Commit 8887be46 authored by Raul Silvera's avatar Raul Silvera Committed by Brad Fitzpatrick

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/34665Reviewed-by: 's avatarBrad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
parent 6e36811c
......@@ -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
}
......
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment