]> Cypherpunks repositories - gostls13.git/commit
internal/trace: don't report regions on system goroutines
authorMichael Pratt <mpratt@google.com>
Mon, 11 Jul 2022 19:34:26 +0000 (15:34 -0400)
committerMichael Pratt <mpratt@google.com>
Mon, 11 Jul 2022 21:24:38 +0000 (21:24 +0000)
commit123a6328b7bd31ed6725d9412913fed6a4436aad
treea3e28e9c9c8f7c54877cef7a168eacb349f12f5e
parent846490110ab1117b5f7366e3a531d24d88800074
internal/trace: don't report regions on system goroutines

If a goroutine is started within a user region, internal/trace assigns
the child goroutine a nameless region for its entire lifetime which is
assosciated the same task as the parent's region.

This is not strictly necessary: a child goroutine is not necessarily
related to the task unless it performs some task operation (in which
case it will be associated with the task through the standard means).

However, it can be quite handy to see child goroutines within a region,
which may be child worker goroutines that you simply didn't perform task
operations on.

If the first GC occurs during a region, the GC worker goroutines will
also inherit a child region. We know for sure that these aren't related
to the task, so filter them out from the region list.

Note that we can't exclude system goroutines from setting activeRegions
in EvGoCreate handling, because we don't know the goroutine start
function name until the first EvGoStart.

Fixes #53784.

Change-Id: Ic83d84e23858a8400a76d1ae2f1418ef49951178
Reviewed-on: https://go-review.googlesource.com/c/go/+/416858
Run-TryBot: Michael Pratt <mpratt@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
src/cmd/trace/trace.go
src/internal/trace/goroutines.go
src/runtime/traceback.go