Skip to content
Snippets Groups Projects
Commit fff28fad authored by Tomasz Grabiec's avatar Tomasz Grabiec Committed by Pekka Enberg
Browse files

trace: include inlined-by functions in the backtrace


Fixes #255.

The default OSv build has plenty of inlined functions. The tracing
tool is using 'addr2line -Cfp' to resolve symbols. That mode of
operation of addr2line yields one line per symbol and that line will
only show the inlined function, even though the information about
"logical" callers is also available.

Example:

  $ addr2line -Cfp -e build/release/loader.elf
  0x32963d
  lock_guard at (...)

There is the '-i' switch we could use to also see code locations into
which this function was inlined:

  $ addr2line -Cfpi -e build/release/loader.elf
  0x32963d
  lock_guard at (...)
   (inlined by) lock_guard_for_with_lock at (...)
   (inlined by) mmu::vm_fault(unsigned long, exception_frame*) at (...)

In this case, 'mmu::vm_fault' is much more interesting than
lock_guard and thus we would like to show it in the backtrace. This change
allows symbol resolvers to return multiple source addresses per raw
address and changes the default implementation to return inlined-by
functions by default.

The new behavior can be suppressed with --no-inlined-by.

Signed-off-by: default avatarTomasz Grabiec <tgrabiec@cloudius-systems.com>
Signed-off-by: default avatarPekka Enberg <penberg@cloudius-systems.com>
parent 3361a737
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment