This is the mail archive of the systemtap@sourceware.org mailing list for the systemtap project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Reenabling the dwarf based unwinder


Hi,

I pushed a couple of commits to reenable the dwarf based unwinder. It
now gets its data from the debug_frame during the translate phase. You
have to explicitly mention the modules/kernel with -d to get the
unwinder data and run stap with -DSTP_USE_DWARF_UNWINDER to use it
during runtime. e.g.:

stap -v -d ext3 -d kernel -DSTP_USE_DWARF_UNWINDER -e \
  'probe module("ext3").function("ext3_file_write")
  { print_stack(backtrace()); print("\n"); }'

If you are testing this and find issues please let me know. There are a
couple of known issues which is why it is disabled by default:

- The unwind data can be fairly big, it should not just be guarded by
  STP_USE_DWARF_UNWINDER, but it should also only be included when we
  detect a probe wants to do a full backtrace.
- The unwinder used wasn't very liked by the kernel upstream people
  See in particular this thread:
  http://lkml.org/lkml/2006/9/30/155
  So we have to see what we can do to clean this up. Maybe we can
  collaborate with the crash people, who are using the same unwinder:
  http://people.redhat.com/anderson/crash_sources/unwind_x86_32_64.c
- It doesn't generate a search table yet. This makes it do linear
  searches. There is some code already to create the search table
  which should probably be moved into the translate.cxx to be output
  next to the original unwind data.
- It uses .debug_frame for now since that is always available if
  debuginfo is installed. kernels and modules are not compiled with
  -fasynchronous-unwind-tables in general, but user space usually is.
- It does only pure dwarf based unwinding, and will fall back completely
  to stack sniffing if it cannot do that. In particular it cannot unwind
  past kretprobes. It should have a bit more smarts to detect locations
  where we are without CFI info.

The next step is to use the same unwinder and unwind data collection to
enable unwinding user space by extending the task finder
__stp_tf_vma_entry so it can be used to find the correct unwind data.
And to extend stp_symbol_snprintf for user space.

Cheers,

Mark

commit 67a66a8b72d19dc1a1fd10db1c55e31a6e93b270
Correct this_section_offset calculation in _stp_kallsyms_lookup.

commit 09fa543f68b023479fb3705fe2544ec257368201
Add new function _stp_mod_sec_lookup extracted from
_stp_kallsyms_lookup.

commit 61a805842f0ac863affa37245fc012e3cdcb4312
Get and output unwind data during translate.

commit f6f5a33817ac1d406c8c2687e32493cbc38ef4e7
Feed dwarf unwinder data through _stp_mod_sec_lookup (), but disabled
for now.

commit 6b2fda5424fb9aaeabe5056fc1e7286f6c8a034a
Record module base and use it for adjusting start locations in dwarf
unwinder.

commit e0c72583f8fb7a61d052c58b8e9c6df0925bc234
Enable usage of STP_USE_DWARF_UNWINDER for i386 and arm for debugging
purposes.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]