]> git.feebdaed.xyz Git - 0xmirror/go.git/commit
internal/trace: correctly handle GoUndetermined for GoroutineSummary
authorMichael Anthony Knyszek <mknyszek@google.com>
Wed, 10 Dec 2025 02:50:56 +0000 (02:50 +0000)
committerMichael Knyszek <mknyszek@google.com>
Thu, 11 Dec 2025 16:34:39 +0000 (08:34 -0800)
commite38c38f0e539f599216247b5293d5c78aa82468b
tree86a9d0ac8841b29095438821792e185bc4590a0a
parentc0ba519764536b8ce7ba2a7fe3748f07672f7b6e
internal/trace: correctly handle GoUndetermined for GoroutineSummary

Currently the trace summarization incorrectly handles GoUndetermined by
treating it too much like GoNotExist. In particular, it should be
accumulating all the time since the start of the trace in a particular
bucket, but it doesn't, so that instead gets counted as "unknown time"
because the "creation time" is at the start of the trace.

This change fixes the problem by simply doing the accumulation. It's
very straightforward. It also side-steps some other inaccuracies, like
associating a goroutine that is being named with the current task. I
don't think this can ever actually happen in practice, but splitting up
the two cases, GoUndetermined and GoNotExist, fixes it.

Fixes #76716.

Change-Id: I3ac1557044f99c92bada2cb0e124b2192b1d6ebb
Reviewed-on: https://go-review.googlesource.com/c/go/+/728822
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Carlos Amedee <carlos@golang.org>
Reviewed-by: Nick Ripley <nick.ripley@datadoghq.com>
src/internal/trace/summary.go
src/internal/trace/summary_test.go