From: Raul Silvera Date: Wed, 21 Dec 2016 18:16:15 +0000 (-0800) Subject: cmd/pprof: Re-enable weblist and disasm X-Git-Tag: go1.8rc1~55 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=8887be4654a49d8644d35661f2d71c970ba6dc02;p=gostls13.git cmd/pprof: Re-enable weblist and disasm Previous changes started using the full filename for object files on graph nodes, instead of just the file basename. The basename was still being used when selecting mappings to disassemble for weblist and disasm commands, causing a mismatch. This fixes #18385. It was already fixed on the upstream pprof. Change-Id: I1664503634f2c8cd31743561301631f12c4949c9 Reviewed-on: https://go-review.googlesource.com/34665 Reviewed-by: Brad Fitzpatrick Run-TryBot: Brad Fitzpatrick TryBot-Result: Gobot Gobot --- diff --git a/src/cmd/pprof/internal/report/report.go b/src/cmd/pprof/internal/report/report.go index 14875c16db..f897c9086f 100644 --- a/src/cmd/pprof/internal/report/report.go +++ b/src/cmd/pprof/internal/report/report.go @@ -123,7 +123,7 @@ func symbolsFromBinaries(prof *profile.Profile, g graph, rx *regexp.Regexp, addr // Walk all mappings looking for matching functions with samples. var objSyms []*objSymbol for _, m := range prof.Mapping { - if !hasSamples[filepath.Base(m.File)] { + if !hasSamples[m.File] { if address == nil || !(m.Start <= *address && *address <= m.Limit) { continue } diff --git a/src/cmd/pprof/internal/report/source.go b/src/cmd/pprof/internal/report/source.go index 7ab7e3861f..458985d1fa 100644 --- a/src/cmd/pprof/internal/report/source.go +++ b/src/cmd/pprof/internal/report/source.go @@ -229,7 +229,7 @@ func assemblyPerSourceLine(objSyms []*objSymbol, rs nodes, src string, obj plugi func findMatchingSymbol(objSyms []*objSymbol, ns nodes) *objSymbol { for _, n := range ns { for _, o := range objSyms { - if filepath.Base(o.sym.File) == n.info.objfile && + if o.sym.File == n.info.objfile && o.sym.Start <= n.info.address-o.base && n.info.address-o.base <= o.sym.End { return o