From 8887be4654a49d8644d35661f2d71c970ba6dc02 Mon Sep 17 00:00:00 2001 From: Raul Silvera Date: Wed, 21 Dec 2016 10:16:15 -0800 Subject: [PATCH] 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 --- src/cmd/pprof/internal/report/report.go | 2 +- src/cmd/pprof/internal/report/source.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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 -- 2.51.0