On Tue, Apr 15, 2025, at 3:32 PM, Serhei Makarov wrote:
> it should not necessary to duplicate the FD on the Sysprof side,
> unless Sysprof wants to use the FD for its own purposes independently
> of what Elfutils is doing with it.
Updated the Sysprof side of the code again to match v3 of the el
New data structure to coordinate caching Elf data among multiple Dwfl
structs attached to different processes. Meant to reduce the overhead
for profilers that use elfutils for unwinding.
The caching is well-justified, as the prior approach (e.g. in
eu-stacktrace, sysprof-live-unwinder) of creating
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/dwfl_perf_frame.c and dwfl_perf_sample_getframes.
* src/stacktrace.c (show_memory_reads): Remove this verbo
Changes for v3:
- Reworked elftab to incorporate dev/ino into the caching key
(to allow caching modules from different filesystems
e.g. a main filesystem and a container filesystem)
and guard more carefully against collisions.
- Add external API for implementing a custom
find_elf callback
* src/stacktrace.c (tracker): New global variable.
(sample_callbacks): Use dwfl_process_tracker_find_elf for caching.
(sysprof_init_dwfl): Use dwfl_begin_with_tracker.
(main): Initialize and clean up tracker.
---
src/stacktrace.c | 11 ---
1 file changed, 8 insertions(+), 3 deletions
Changes for v3:
- use const void *stack, not void *, to allow users
to pass a const stack sample
Changes for v2:
- use renamed __libdwfl_set_initial_registers_thread
- oops, should use provided sample_arg->perf_regs_mask
in sample_set_initial registers
* * *
This is a new interface for un
Changes for v2:
- guard the linux/perf_events.h include properly with an #if defined __linux__
* * *
Since libebl is a private interface, subsequent patches in the series
introduce another api wrapping the libebl perf register handling. In
this patch, add an interface to access the preferred se
Initial minimal change to ensure dwfl_process_tracker_find_pid is
tested. For now, we keep the additional dwfltab code in stacktrace.c,
since it's used to track statistics.
In future follow-ups, it will be good to switch to storing
eu-stacktrace statistics in dwfl->process->callbacks_arg. This
req
Change the sample_set_initial_registers callback in eu-stacktrace to
use the proper libebl ebl_set_initial_registers_sample function.
* src/Makefile.am (stacktrace_LDADD): Add libebl.
* src/stacktrace.c (sample_registers_cb): New function,
though identical to pid_thread_state_registers_cb.
(sa
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/libdwfl.h (dwfl_process_tracker_fi
Changes for v2:
- No longer exposing this in public libdwfl.h api.
* * *
Renaming pid_set_initial_registers to
__libdwfl_set_initial_registers_thread and adding to libdwflP.h.
This callback was private to one file, but now we need to access it
from the perf_events sampling code as well.
* libd
Changes for v2:
- Merged commit 11 into commit 1 (both sample_base_addr/sample_pc and
set_initial_registers_sample make sense to introduce in the same
commit).
- Added i386 backend and factored out common code.
* * *
First patch of a series that reworks eu-stacktrace functionality
into a li
12 matches
Mail list logo