]> Cypherpunks repositories - gostls13.git/commit
internal/trace: fix analysis of EvGoWaiting/EvGoInSyscall events
authorDmitry Vyukov <dvyukov@google.com>
Mon, 8 Aug 2016 13:41:18 +0000 (15:41 +0200)
committerDmitry Vyukov <dvyukov@google.com>
Fri, 19 Aug 2016 19:22:17 +0000 (19:22 +0000)
commita50f9859bd15784d047875624c9fa91ce69bd85b
tree4d3669440dab1713f41aef01f404bfa7372304eb
parent93372673ce51b9462d7ae0f87ac28ffe0c2ad37d
internal/trace: fix analysis of EvGoWaiting/EvGoInSyscall events

When tracing is started in the middle of program execution,
we already have a number of runnable goroutines and a number
of blocked/in syscall goroutines. In order to reflect these
goroutines in the trace, we emit EvGoCreate for all existing
goroutines. Then for blocked/in syscall goroutines we additionally
emit EvGoWaiting/EvGoInSyscall events. These events don't reset g.ev
during trace analysis. So next EvGoStart finds g.ev set to the
previous EvGoCreate. As the result time between EvGoCreate and
EvGoStart is accounted as scheduler latency. While in reality
it is blocking/syscall time.

Properly reset g.ev for EvGoWaiting/EvGoInSyscall events.

Change-Id: I0615ba31ed7567600a0667ebb27458481da73adb
Reviewed-on: https://go-review.googlesource.com/25572
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
src/internal/trace/parser.go