aboutsummaryrefslogtreecommitdiff
path: root/src/runtime
diff options
context:
space:
mode:
authorMichael Pratt <mpratt@google.com>2021-11-09 10:59:32 -0500
committerMichael Pratt <mpratt@google.com>2021-11-09 17:02:38 +0000
commit90f47dbba635802bb009404e321fa4759ac76d20 (patch)
tree3ccd9185428373cb0287e6fdcb6f14234ce4ba98 /src/runtime
parent34abc12b2a24fd76cdfad531f0a229f3cbb55bc3 (diff)
downloadgo-90f47dbba635802bb009404e321fa4759ac76d20.tar.xz
runtime/pprof: include labels in profile dump
For tests of pprof label support having the sample labels in the output is needed for effective debugging. For #48577 Change-Id: Ic7c5bc90cb33e8fb477f7db62d9b56a7a9d6ffa8 Reviewed-on: https://go-review.googlesource.com/c/go/+/362614 Trust: Michael Pratt <mpratt@google.com> Run-TryBot: Michael Pratt <mpratt@google.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Cherry Mui <cherryyz@google.com>
Diffstat (limited to 'src/runtime')
-rw-r--r--src/runtime/pprof/pprof_test.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/runtime/pprof/pprof_test.go b/src/runtime/pprof/pprof_test.go
index 417d5034a6..704c0c516d 100644
--- a/src/runtime/pprof/pprof_test.go
+++ b/src/runtime/pprof/pprof_test.go
@@ -494,6 +494,7 @@ func profileOk(t *testing.T, matches matchFunc, need []string, avoid []string, p
p := parseProfile(t, prof.Bytes(), func(count uintptr, stk []*profile.Location, labels map[string][]string) {
fmt.Fprintf(&buf, "%d:", count)
fprintStack(&buf, stk)
+ fmt.Fprintf(&buf, " labels: %v\n", labels)
samples += count
for i, spec := range need {
if matches(spec, count, stk, labels) {
@@ -675,7 +676,6 @@ func fprintStack(w io.Writer, stk []*profile.Location) {
}
fmt.Fprintf(w, ")")
}
- fmt.Fprintf(w, "\n")
}
// Test that profiling of division operations is okay, especially on ARM. See issue 6681.