]> Cypherpunks repositories - gostls13.git/commit
runtime,cmd/trace: trace GC STW events
authorAustin Clements <austin@google.com>
Fri, 21 Jul 2017 18:25:28 +0000 (14:25 -0400)
committerAustin Clements <austin@google.com>
Tue, 29 Aug 2017 21:54:55 +0000 (21:54 +0000)
commitb0392159f611427ad351548e172048395bc4ac5a
tree319c63991e1943638632b82ad1a30cf2d626666f
parent4a5c37793cf72987b3884b246c9b590d1ed1e565
runtime,cmd/trace: trace GC STW events

Right now we only kind of sort of trace GC STW events. We emit events
around mark termination, but those start well after stopping the world
and end before starting it again, and we don't emit any events for
sweep termination.

Fix this by generalizing EvGCScanStart/EvGCScanDone. These were
already re-purposed to indicate mark termination (despite the names).
This commit renames them to EvGCSTWStart/EvGCSTWDone, adds an argument
to indicate the STW reason, and shuffles the runtime to generate them
right before stopping the world and right after starting the world,
respectively.

These events will make it possible to generate precise minimum mutator
utilization (MMU) graphs and could be useful in detecting
non-preemptible goroutines (e.g., #20792).

Change-Id: If95783f370781d8ef66addd94886028103a7c26f
Reviewed-on: https://go-review.googlesource.com/55411
Reviewed-by: Rick Hudson <rlh@golang.org>
src/cmd/trace/trace.go
src/internal/trace/parser.go
src/internal/trace/testdata/http_1_10_good [new file with mode: 0644]
src/internal/trace/testdata/stress_1_10_good [new file with mode: 0644]
src/internal/trace/testdata/stress_start_stop_1_10_good [new file with mode: 0644]
src/runtime/mgc.go
src/runtime/proc.go
src/runtime/trace.go