]> git.ipfire.org Git - thirdparty/elfutils.git/commit
eu-stacktrace [12/12]: use dwflst_perf_sample_getframes
authorSerhei Makarov <serhei@serhei.io>
Fri, 25 Apr 2025 14:15:58 +0000 (10:15 -0400)
committerSerhei Makarov <serhei@serhei.io>
Fri, 25 Apr 2025 14:15:58 +0000 (10:15 -0400)
commit5a2a45c7d08d4edca9df9ebe4bc2ea7b08795c76
treee14b4afa2b72dd2c5bb5c2f2693bad19463b1388
parentd6223eb9ad12a3e6f48426a1e5c377aff011306f
eu-stacktrace [12/12]: use dwflst_perf_sample_getframes

Changes for v4:

- Separate out libdwfl_stacktrace, as requested.

Changes for v3:

- Fix initialization of elf in sysprof_init_dwfl
  (previously triggered -Wmaybe-uninitialized).

* * *

Remove the code from src/stacktrace.c that is now covered by
libdwfl_stacktrace/dwflst_perf_frame.c and
dwflst_perf_sample_getframes.

* src/stacktrace.c (show_memory_reads): Remove this verbose option as
  the relevant code is inside libdwfl_stacktrace now.
  (struct __sample_arg): Remove, handled by
  libdwfl_stacktrace/dwflst_perf_frame.c.
  (sample_next_thread): Ditto.
  (sample_getthread): Ditto.
  (copy_word_64): Ditto.
  (copy_word_32): Ditto.
  (elf_memory_read): Ditto.
  (sample_memory_read): Ditto.
  (sample_set_initial_registers): Ditto.
  (sample_detach): Ditto.
  (sample_thread_callbacks): Ditto.
  (sysprof_find_dwfl): Now also return the Elf* so that it can be
  passed to dwflst_perf_sample_getframes. Don't create sample_arg.  Do
  record sp in sui->last_sp. Don't dwfl_attach_state,
  dwflst_perf_sample_getframes handles that now.
  (sysprof_unwind_cb): Adapt to sysprof_find_dwfl changes,
  now invoke dwflst_perf_sample_getframes instead of
  dwfl_getthread_frames.
  (parse_opt): Remove show_memory_reads.
  (main): Remove show_memory_reads.
src/stacktrace.c