Skip to content

Commit

Permalink
runtime/pprof: include labels in profile dump
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
prattmic committed Nov 9, 2021
1 parent 34abc12 commit 90f47db
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/runtime/pprof/pprof_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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.
Expand Down

0 comments on commit 90f47db

Please # to comment.