aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/pprof
diff options
context:
space:
mode:
authorNick Ripley <nick.ripley@datadoghq.com>2024-10-03 13:11:43 +0000
committerGopher Robot <gobot@golang.org>2024-10-03 16:44:53 +0000
commit1edb49a6eb37af8593e25fed63029343fc9177f5 (patch)
tree9cfeed36e83b5c4275b7c6076d0c0a79e08400d2 /src/runtime/pprof
parent58e046b66c393ea2e17fff6958f8030e8948fb6f (diff)
downloadgo-1edb49a6eb37af8593e25fed63029343fc9177f5.tar.xz
Revert "runtime/pprof: make TestBlockMutexProfileInlineExpansion stricter"
This reverts commit 5b0f8596b766afae9dd1f117a4a5dcfbbf1b80f1. Reason for revert: This CL breaks gotip-linux-amd64-noopt builder. Change-Id: I3950211f05c90e4955c0785409b796987741a9f4 Reviewed-on: https://go-review.googlesource.com/c/go/+/617715 Reviewed-by: Michael Pratt <mpratt@google.com> Reviewed-by: Michael Knyszek <mknyszek@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Auto-Submit: Michael Pratt <mpratt@google.com>
Diffstat (limited to 'src/runtime/pprof')
-rw-r--r--src/runtime/pprof/pprof_test.go24
1 files changed, 12 insertions, 12 deletions
diff --git a/src/runtime/pprof/pprof_test.go b/src/runtime/pprof/pprof_test.go
index 6c41495f03..e9f287df60 100644
--- a/src/runtime/pprof/pprof_test.go
+++ b/src/runtime/pprof/pprof_test.go
@@ -2727,38 +2727,38 @@ func TestBlockMutexProfileInlineExpansion(t *testing.T) {
wg.Wait()
tcs := []struct {
- Name string
- Collect func([]runtime.BlockProfileRecord) (int, bool)
- Stack string
+ Name string
+ Collect func([]runtime.BlockProfileRecord) (int, bool)
+ SubStack string
}{
{
Name: "mutex",
Collect: runtime.MutexProfile,
- Stack: `sync.(*Mutex).Unlock
+ SubStack: `sync.(*Mutex).Unlock
runtime/pprof.inlineF
runtime/pprof.inlineE
-runtime/pprof.inlineD
-runtime.goexit`,
+runtime/pprof.inlineD`,
},
{
Name: "block",
Collect: runtime.BlockProfile,
- Stack: `sync.(*Mutex).Lock
+ SubStack: `sync.(*Mutex).Lock
runtime/pprof.inlineC
runtime/pprof.inlineB
-runtime/pprof.inlineA
-runtime.goexit`,
+runtime/pprof.inlineA`,
},
}
for _, tc := range tcs {
t.Run(tc.Name, func(t *testing.T) {
stacks := getProfileStacks(tc.Collect, false)
- if slices.Contains(stacks, tc.Stack) {
- return
+ for _, s := range stacks {
+ if strings.Contains(s, tc.SubStack) {
+ return
+ }
}
t.Error("did not see expected stack")
- t.Logf("wanted:\n%s", tc.Stack)
+ t.Logf("wanted:\n%s", tc.SubStack)
t.Logf("got: %s", stacks)
})
}