X Tutup
Skip to content

Commit 90f47db

Browse files
committed
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 golang#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>
1 parent 34abc12 commit 90f47db

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/runtime/pprof/pprof_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -494,6 +494,7 @@ func profileOk(t *testing.T, matches matchFunc, need []string, avoid []string, p
494494
p := parseProfile(t, prof.Bytes(), func(count uintptr, stk []*profile.Location, labels map[string][]string) {
495495
fmt.Fprintf(&buf, "%d:", count)
496496
fprintStack(&buf, stk)
497+
fmt.Fprintf(&buf, " labels: %v\n", labels)
497498
samples += count
498499
for i, spec := range need {
499500
if matches(spec, count, stk, labels) {
@@ -675,7 +676,6 @@ func fprintStack(w io.Writer, stk []*profile.Location) {
675676
}
676677
fmt.Fprintf(w, ")")
677678
}
678-
fmt.Fprintf(w, "\n")
679679
}
680680

681681
// Test that profiling of division operations is okay, especially on ARM. See issue 6681.

0 commit comments

Comments
 (0)
X Tutup