1
0
mirror of https://github.com/golang/go synced 2024-11-23 11:30:06 -07:00

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 <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
This commit is contained in:
Raul Silvera 2016-12-21 10:16:15 -08:00 committed by Brad Fitzpatrick
parent 6e36811c37
commit 8887be4654
2 changed files with 2 additions and 2 deletions

View File

@ -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
}

View File

@ -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