]> git.ipfire.org Git - thirdparty/elfutils.git/commit
eu-stacktrace [3/5]: libdwfl: add unwind origin diagnostics
authorSerhei Makarov <serhei@serhei.io>
Sat, 12 Oct 2024 15:06:15 +0000 (11:06 -0400)
committerSerhei Makarov <serhei@serhei.io>
Thu, 17 Oct 2024 23:31:15 +0000 (19:31 -0400)
commit77b38e21221f6beed586286110a8cb4927d21ac1
tree49216b00ae066ae82caec17fc3ea33e042f56387
parentb8df4dae2c29559eed9cf2f84f482c76dd57ad15
eu-stacktrace [3/5]: libdwfl: add unwind origin diagnostics

Track the method used to unwind each Dwfl_Frame using an enum field
unwound_source; provide access to the field. Then use that in
eu-stacktrace to display the unwind methods used for each process.

This is an important diagnostic to verify how many processes are
adequately covered by the eh_frame unwinder.

* libdw/libdw.map (ELFUTILS_0.192): Add dwfl_frame_unwound_source,
  dwfl_unwound_source_str.
* libdwfl/libdwfl.h (Dwfl_Unwound_Source): New enum.
  (dwfl_frame_unwound_source)
  (dwfl_unwound_source_str): New functions.
* libdwfl/dwfl_frame.c (dwfl_frame_unwound_source)
  (dwfl_unwound_source_str): New functions.
* libdwfl/libdwflP.h: Add INTDECL for dwfl_frame_unwound_source,
  dwfl_unwound_source_str.
  (struct Dwfl_Frame): Add unwound_source field.
* libdwfl/frame_unwind.c (__libdwfl_frame_unwind): Set
  state->unwound_source depending on the unwind method used.
* src/stacktrace.c (struct sysprof_unwind_info): Add last_pid
  field to provide access to the current sample's dwfltab entry.
  (sysprof_unwind_frame_cb): Add unwound_source to the data displayed
  with the show_frames option.
  (sysprof_unwind_cb): Set last_pid when processing a sample.
  (main): Add unwind_source to the data displayed in the final summary
  table.

Signed-off-by: Serhei Makarov <serhei@serhei.io>
libdw/libdw.map
libdwfl/dwfl_frame.c
libdwfl/frame_unwind.c
libdwfl/libdwfl.h
libdwfl/libdwflP.h
src/stacktrace.c