From d49fecc474d04a04d1d22851c06099338abd4391 Mon Sep 17 00:00:00 2001 From: smasher164 Date: Thu, 27 Feb 2020 02:42:28 -0500 Subject: 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 TryBot-Result: Gobot Gobot Reviewed-by: Ian Lance Taylor --- .../google/pprof/internal/report/report.go | 28 ++++++++++++++++------ .../github.com/google/pprof/profile/proto.go | 7 ++++-- 2 files changed, 26 insertions(+), 9 deletions(-) (limited to 'src/cmd/vendor/github.com') 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 -- cgit v1.3-5-g9baa