From 9f04a62a39133439e20ea32a658cc35c21d33729 Mon Sep 17 00:00:00 2001 From: Russ Cox Date: Wed, 3 Dec 2014 14:14:00 -0500 Subject: [PATCH] cmd/pprof: fix symbol resolution for remote profiles Fixes #9199. LGTM=iant R=golang-codereviews, iant CC=austin, golang-codereviews, minux https://golang.org/cl/183080043 --- src/cmd/pprof/internal/symbolizer/symbolizer.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/cmd/pprof/internal/symbolizer/symbolizer.go b/src/cmd/pprof/internal/symbolizer/symbolizer.go index cabddaa76e5..86de5640d29 100644 --- a/src/cmd/pprof/internal/symbolizer/symbolizer.go +++ b/src/cmd/pprof/internal/symbolizer/symbolizer.go @@ -32,6 +32,10 @@ func Symbolize(mode string, prof *profile.Profile, obj plugin.ObjTool, ui plugin } } + if len(prof.Mapping) == 0 { + return fmt.Errorf("no known mappings") + } + mt, err := newMapping(prof, obj, ui, force) if err != nil { return err