diff options
| author | smasher164 <aindurti@gmail.com> | 2020-02-27 02:42:28 -0500 |
|---|---|---|
| committer | Ian Lance Taylor <iant@golang.org> | 2020-03-09 20:45:44 +0000 |
| commit | d49fecc474d04a04d1d22851c06099338abd4391 (patch) | |
| tree | f7e59e11f275b05b077e977fc393a1e10a6440b1 /src/cmd/vendor/github.com/google | |
| parent | 5fac45a320561b45b52cdcae933882a70699a21d (diff) | |
| download | go-d49fecc474d04a04d1d22851c06099338abd4391.tar.xz | |
std,cmd: update x/net and github.com/google/pprof
Re-vendor x/net/dns/dnsmessage, x/net/route, and github.com/google/pprof
(commit 1ebb73c). The updated dependencies fix the string(int)
conversions, in preparation for the vet warning.
Updates #32479.
Change-Id: I023a4e30415d060f8b403b9943fe911f6d19f2e9
Reviewed-on: https://go-review.googlesource.com/c/go/+/221337
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Diffstat (limited to 'src/cmd/vendor/github.com/google')
| -rw-r--r-- | src/cmd/vendor/github.com/google/pprof/internal/report/report.go | 28 | ||||
| -rw-r--r-- | src/cmd/vendor/github.com/google/pprof/profile/proto.go | 7 |
2 files changed, 26 insertions, 9 deletions
diff --git a/src/cmd/vendor/github.com/google/pprof/internal/report/report.go b/src/cmd/vendor/github.com/google/pprof/internal/report/report.go index 1b555a4e2e..56083d8abf 100644 --- a/src/cmd/vendor/github.com/google/pprof/internal/report/report.go +++ b/src/cmd/vendor/github.com/google/pprof/internal/report/report.go @@ -834,10 +834,19 @@ func printTraces(w io.Writer, rpt *Report) error { _, locations := graph.CreateNodes(prof, &graph.Options{}) for _, sample := range prof.Sample { - var stack graph.Nodes + type stk struct { + *graph.NodeInfo + inline bool + } + var stack []stk for _, loc := range sample.Location { - id := loc.ID - stack = append(stack, locations[id]...) + nodes := locations[loc.ID] + for i, n := range nodes { + // The inline flag may be inaccurate if 'show' or 'hide' filter is + // used. See https://github.com/google/pprof/issues/511. + inline := i != len(nodes)-1 + stack = append(stack, stk{&n.Info, inline}) + } } if len(stack) == 0 { @@ -875,10 +884,15 @@ func printTraces(w io.Writer, rpt *Report) error { if d != 0 { v = v / d } - fmt.Fprintf(w, "%10s %s\n", - rpt.formatValue(v), stack[0].Info.PrintableName()) - for _, s := range stack[1:] { - fmt.Fprintf(w, "%10s %s\n", "", s.Info.PrintableName()) + for i, s := range stack { + var vs, inline string + if i == 0 { + vs = rpt.formatValue(v) + } + if s.inline { + inline = " (inline)" + } + fmt.Fprintf(w, "%10s %s%s\n", vs, s.PrintableName(), inline) } } fmt.Fprintln(w, separator) diff --git a/src/cmd/vendor/github.com/google/pprof/profile/proto.go b/src/cmd/vendor/github.com/google/pprof/profile/proto.go index e7df33ac2b..539ad3ab33 100644 --- a/src/cmd/vendor/github.com/google/pprof/profile/proto.go +++ b/src/cmd/vendor/github.com/google/pprof/profile/proto.go @@ -33,7 +33,10 @@ package profile -import "errors" +import ( + "errors" + "fmt" +) type buffer struct { field int // field tag @@ -235,7 +238,7 @@ func decodeField(b *buffer, data []byte) ([]byte, error) { b.u64 = uint64(le32(data[:4])) data = data[4:] default: - return nil, errors.New("unknown wire type: " + string(b.typ)) + return nil, fmt.Errorf("unknown wire type: %d", b.typ) } return data, nil |
