Skip to content

Commit 5d647ed

Browse files
committed
[release-branch.go1.22] runtime: fix trace EvGoStop Gosched reason to match function
Currently the stop reason for runtime.Gosched is labeled "runtime.GoSched" which doesn't actually match the function name. Fix the label to match the function name. This change doesn't regenerate the internal/trace/v2 tests, because regenerating the tests breaks summarization tests in internal/trace that rely on very specific details in the example traces that aren't guaranteed. Also, go122-gc-trace.test isn't generated at all, as it turns out. I'll fix this all up in a follow-up CL. For now, just replace runtime.GoSched with runtime.Gosched in the traces so we don't have a problem later if a test wants to look for that string. This change does regenerate the cmd/trace/v2 test, but it turns out the cmd/trace/v2 tests are way too strict about network unblock events, and 3 usually pop up instead of 1 or 2, which is what the test expects. AFAICT this looks plausible to me, so just lift the restriction on "up to 2" events entirely. Change-Id: Id7350132be19119c743c259f2f5250903bf41a04 Reviewed-on: https://go-review.googlesource.com/c/go/+/552275 TryBot-Bypass: Michael Knyszek <[email protected]> Reviewed-by: Michael Pratt <[email protected]> (cherry picked from commit 287f791) Reviewed-on: https://go-review.googlesource.com/c/go/+/560555 LUCI-TryBot-Result: Go LUCI <[email protected]> Auto-Submit: Michael Knyszek <[email protected]>
1 parent e34f6a9 commit 5d647ed

File tree

7 files changed

+4355
-4082
lines changed

7 files changed

+4355
-4082
lines changed

src/cmd/trace/v2/jsontrace_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -167,8 +167,8 @@ func checkNetworkUnblock(t *testing.T, data format.Data) {
167167
if netBlockEv == nil {
168168
t.Error("failed to find a network unblock")
169169
}
170-
if count == 0 || count > 2 {
171-
t.Errorf("found too many network block events: want 1 or 2, found %d", count)
170+
if count == 0 {
171+
t.Errorf("found zero network block events, want at least one")
172172
}
173173
// TODO(mknyszek): Check for the flow of this event to some slice event of a goroutine running.
174174
}

0 commit comments

Comments
 (0)