]> Cypherpunks.ru repositories - gostls13.git/commit
runtime: emit STW events for all pauses, not just those for the GC
authorMichael Anthony Knyszek <mknyszek@google.com>
Thu, 11 May 2023 21:09:10 +0000 (21:09 +0000)
committerMichael Knyszek <mknyszek@google.com>
Fri, 19 May 2023 17:06:45 +0000 (17:06 +0000)
commitb1aadd034c1feb6ac8409aca5f0efd10ef442950
tree4872646599671579df0c82627204881bebd087e2
parent944911af5630bec413237b9aba010661a353953e
runtime: emit STW events for all pauses, not just those for the GC

Currently STW events are only emitted for GC STWs. There's little reason
why the trace can't contain events for every STW: they're rare so don't
take up much space in the trace, yet being able to see when the world
was stopped is often critical to debugging certain latency issues,
especially when they stem from user-level APIs.

This change adds new "kinds" to the EvGCSTWStart event, renames the
GCSTW events to just "STW," and lets the parser deal with unknown STW
kinds for future backwards compatibility.

But, this change must break trace compatibility, so it bumps the trace
version to Go 1.21.

This change also includes a small cleanup in the trace command, which
previously checked for STW events when deciding whether user tasks
overlapped with a GC. Looking at the source, I don't see a way for STW
events to ever enter the stream that that code looks at, so that
condition has been deleted.

Change-Id: I9a5dc144092c53e92eb6950e9a5504a790ac00cf
Reviewed-on: https://go-review.googlesource.com/c/go/+/494495
Reviewed-by: Michael Pratt <mpratt@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Michael Knyszek <mknyszek@google.com>
19 files changed:
src/cmd/trace/annotations.go
src/cmd/trace/trace.go
src/internal/trace/gc.go
src/internal/trace/parser.go
src/internal/trace/parser_test.go
src/internal/trace/testdata/http_1_21_good [new file with mode: 0644]
src/internal/trace/testdata/stress_1_21_good [new file with mode: 0644]
src/internal/trace/testdata/stress_start_stop_1_21_good [new file with mode: 0644]
src/internal/trace/testdata/user_task_region_1_21_good [new file with mode: 0644]
src/runtime/debug.go
src/runtime/export_debuglog_test.go
src/runtime/export_test.go
src/runtime/heapdump.go
src/runtime/mgc.go
src/runtime/mprof.go
src/runtime/mstats.go
src/runtime/os_linux.go
src/runtime/proc.go
src/runtime/trace.go