Skip to content

Commit

Permalink
Allow symbolz to try symbolize unsymbolizable mappings.
Browse files Browse the repository at this point in the history
We added skipping unsymbolizable mappings in symbolz long time ago in
PR google#368 to address google#339 where we saw error like "unexpected negative
adjusted address".

But that error was fixed in a more proper way in subsequent google#397 to fix
another reported issue google#280 (and internal b/32020573). So skipping
unsymbolized mappings shouldn't be needed anymore.

I tested this by verifying that the test case from google#339 still works fine
with the proposed change. And that it does fail if I roll back google#397
locally.

This change is useful as we experiment with using symbolz to symbolize
JIT locations from //anon (which is unsymbolizable per current terminology).
  • Loading branch information
aalexand committed Oct 18, 2024
1 parent 017d972 commit 1f8f337
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions internal/symbolz/symbolz.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,19 +37,15 @@ var (
// 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]".
// symbolize locations from mappings not already marked as HasFunctions. Does
// not skip unsymbolizable files since the symbolz handler can be flexible
// enough to handle some of those cases such as JIT locations in //anon.
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 1f8f337

Please sign in to comment.