Skip to content

Commit

Permalink
Skip unsymbolizable mapping during symbolz pass. (#368)
Browse files Browse the repository at this point in the history
  • Loading branch information
aalexand authored and nolanmar511 committed May 1, 2018
1 parent 3b0df83 commit 12989e0
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions internal/symbolz/symbolz.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,17 +34,22 @@ var (
symbolzRE = regexp.MustCompile(`(0x[[:xdigit:]]+)\s+(.*)`)
)

// Symbolize symbolizes profile p by parsing data returned by a
// symbolz handler. syms receives the symbolz query (hex addresses
// separated by '+') and returns the symbolz output in a string. If
// force is false, it will only symbolize locations from mappings
// not already marked as HasFunctions.
// Symbolize symbolizes profile p by parsing data returned by a symbolz
// handler. syms receives the symbolz query (hex addresses separated by '+')
// and returns the symbolz output in a string. If force is false, it will only
// symbolize locations from mappings not already marked as HasFunctions. Never
// attempts symbolization of addresses from unsymbolizable system
// mappings as those may look negative - e.g. "[vsyscall]".
func Symbolize(p *profile.Profile, force bool, sources plugin.MappingSources, syms func(string, string) ([]byte, error), ui plugin.UI) error {
for _, m := range p.Mapping {
if !force && m.HasFunctions {
// Only check for HasFunctions as symbolz only populates function names.
continue
}
// Skip well-known system mappings.
if m.Unsymbolizable() {
continue
}
mappingSources := sources[m.File]
if m.BuildID != "" {
mappingSources = append(mappingSources, sources[m.BuildID]...)
Expand Down

0 comments on commit 12989e0

Please sign in to comment.