Skip to content

Commit

Permalink
symbolz: skip un-symbolizable mappings
Browse files Browse the repository at this point in the history
This fixes #339 by skipping
attempts to symbolize anything from system mappings like [vdso],
[vsyscall], etc.
  • Loading branch information
toddlipcon committed Mar 22, 2018
1 parent a74ae6f commit 66277ad
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion internal/symbolz/symbolz.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,18 @@ var (
// 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.
// not already marked as HasFunctions. Never attempts symbolization of
// any symbols found in unsymbolizable system mappings.
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 66277ad

Please sign in to comment.