diff options
author | Austin Clements <austin@google.com> | 2016-10-08 18:38:35 -0400 |
---|---|---|
committer | Austin Clements <austin@google.com> | 2016-10-28 14:29:47 +0000 |
commit | 6da83c6fc006019f6fe0503099d165e19f465b1b (patch) | |
tree | 155fe589bc74911e73cd403ca40a9254af2feb81 /src/runtime/trace.go | |
parent | 640e9169155ea96a6f1156663269dba5babf0632 (diff) | |
download | go-6da83c6fc006019f6fe0503099d165e19f465b1b.tar.gz go-6da83c6fc006019f6fe0503099d165e19f465b1b.zip |
runtime, cmd/trace: track goroutines blocked on GC assists
Currently when a goroutine blocks on a GC assist, it emits a generic
EvGoBlock event. Since assist blocking events and, in particular, the
length of the blocked assist queue, are important for diagnosing GC
behavior, this commit adds a new EvGoBlockGC event for blocking on a
GC assist. The trace viewer uses this event to report a "waiting on
GC" count in the "Goroutines" row. This makes sense because, unlike
other blocked goroutines, these goroutines do have work to do, so
being blocked on a GC assist is quite similar to being in the
"runnable" state, which we also report in the trace viewer.
Change-Id: Ic21a326992606b121ea3d3d00110d8d1fdc7a5ef
Reviewed-on: https://go-review.googlesource.com/30704
Run-TryBot: Austin Clements <austin@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Dmitry Vyukov <dvyukov@google.com>
Diffstat (limited to 'src/runtime/trace.go')
-rw-r--r-- | src/runtime/trace.go | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/runtime/trace.go b/src/runtime/trace.go index 0bb529ea9d..a8f4ab60d3 100644 --- a/src/runtime/trace.go +++ b/src/runtime/trace.go @@ -61,7 +61,8 @@ const ( traceEvGoUnblockLocal = 39 // goroutine is unblocked on the same P as the last event [timestamp, goroutine id, stack] traceEvGoSysExitLocal = 40 // syscall exit on the same P as the last event [timestamp, goroutine id, real timestamp] traceEvGoStartLabel = 41 // goroutine starts running with label [timestamp, goroutine id, seq, label string id] - traceEvCount = 42 + traceEvGoBlockGC = 42 // goroutine blocks on GC assist [timestamp, stack] + traceEvCount = 43 ) const ( |