go/src/internal/trace
Hana Kim ad638fbfb5 internal/trace: fix double counting in span analysis
When snapshotting the execution time stats of a goroutine
we take into account the intermediate values kepts in the GDesc's
gdesc field. At the end of goroutine analysis, we go through all
goroutines and replace the GExecutionStat with the new snapshot.
Here the mistake was that we replaced the GExecutionStat with
the value that reflects the intermediate values, but did clear
the intermediate values. So, when the following finalizeActiveSpans
runs, it trieds to add the intermediate values again (double-counting)
when taking a snapshot.

Fix the issue by using the finalized GExecutionStat instead of
recomputing the snapshot. While we are here, refactor the finalization
logic so it can be used when processing GoEnd, GoStop events.

Change-Id: Ibdb342214c29b65d4ea37e52b1f8b83f1fb20143
Reviewed-on: https://go-review.googlesource.com/103157
Reviewed-by: Peter Weinberger <pjw@google.com>
2018-03-28 20:18:41 +00:00
..
testdata internal/trace: link user span start and end events 2018-02-15 19:33:20 +00:00
goroutines.go internal/trace: fix double counting in span analysis 2018-03-28 20:18:41 +00:00
mkcanned.bash internal/trace: link user span start and end events 2018-02-15 19:33:20 +00:00
order.go runtime, cmd/trace: track goroutines blocked on GC assists 2016-10-28 14:29:47 +00:00
parser.go all: remove some unused return parameters 2018-03-24 19:44:47 +00:00
parser_test.go cmd/trace: init goroutine info entries with GoCreate event 2017-12-20 23:04:21 +00:00
writer.go cmd/trace: Record mark assists in execution traces 2017-02-10 18:03:42 +00:00