]> git.ipfire.org Git - thirdparty/elfutils.git/commit
libdwfl_stacktrace [9/12]: add dwflst_tracker_find_pid
authorSerhei Makarov <serhei@serhei.io>
Wed, 23 Apr 2025 14:44:44 +0000 (10:44 -0400)
committerSerhei Makarov <serhei@serhei.io>
Fri, 25 Apr 2025 14:10:07 +0000 (10:10 -0400)
commitbce66f1c8e3360df1e3b8787d9e38eaf2fa32499
treecacb771ca4edceca46778199da823a2a8201c7be
parent592620d4dca43b0208f8c97a2e0567351b4666a0
libdwfl_stacktrace [9/12]: add dwflst_tracker_find_pid

Changes for v6:

- Minor fixes as requested.

Changes for v4:

- Separate out libdwfl_stacktrace, as requested.

Changes for v2:

- Add locking for dwfltab.

* * *

New function that retrieves the Dwfl for a particular PID, or,
if the Dwfl is absent, creates it via a provided callback
and adds it to the table later, when the PID is confirmed
via dwfl_attach_state.

* libdwfl_stacktrace/libdwfl_stacktrace.h (dwflst_tracker_find_pid):
  New function.
* libdwfl_stacktrace/dwfl_process_tracker.c (dwflst_tracker_find_pid):
  New function; find a Dwfl in the dwfltab or create one using the
  provided callback.  The newly created Dwfl will be added to the
  dwfltab automatically when its pid is confirmed by a call to
  dwfl_attach_state.
* libdw/libdw.map: Add dwflst_tracker_find_pid.
libdw/libdw.map
libdwfl_stacktrace/dwflst_process_tracker.c
libdwfl_stacktrace/libdwfl_stacktrace.h