Re: [PATCH v2] Add 'Key to Flags' to eu-readelf output [bz 29571]

2025-04-04 Thread Mark Wielaard
Hi Samuel, On Thu, 2025-04-03 at 17:24 +1000, Samuel Zeter wrote: > When printing section headers, also include a key to what each flag > is at the end of the section header output. > > Signed-off-by: Samuel Zeter Thanks, looks good. Committed with a slightly tweaked commit message: commit ef1

Re: [PATCH] Avoid double-including config.h

2025-04-04 Thread Mark Wielaard
Hi Dmitry, On Thu, 2025-04-03 at 19:28 +0300, Dmitry V. Levin wrote: > I've accidentally noticed that this hunk was not correct back in 2017 > because "#if HAVE_CONFIG_H" is not the same as "#ifdef HAVE_CONFIG_H". > This was not problematic for elfutils itself because HAVE_CONFIG_H is > always def

[Bug general/29571] Add 'Key to Flags' to eu-readelf output

2025-04-04 Thread mark at klomp dot org
https://sourceware.org/bugzilla/show_bug.cgi?id=29571 Mark Wielaard changed: What|Removed |Added Status|NEW |RESOLVED Resolution|---

Re: [PATCH 1/3] Add some supporting framework for C11-style atomics.

2025-04-04 Thread Dmitry V. Levin
Hi Mark, On Fri, Apr 04, 2025 at 01:38:01PM +0200, Mark Wielaard wrote: > Hi Dmitry, > > On Thu, 2025-04-03 at 19:09 +0300, Dmitry V. Levin wrote: > > On Thu, Aug 29, 2019 at 03:16:12PM +0200, Mark Wielaard wrote: > > > From: Jonathon Anderson > > > > > > Uses the stdatomic.h provided by FreeBS

Re: [PATCH] Avoid double-including config.h

2025-04-04 Thread Dmitry V. Levin
Hi Mark, On Fri, Apr 04, 2025 at 01:55:48PM +0200, Mark Wielaard wrote: > Hi Dmitry, > > On Thu, 2025-04-03 at 19:28 +0300, Dmitry V. Levin wrote: > > I've accidentally noticed that this hunk was not correct back in 2017 > > because "#if HAVE_CONFIG_H" is not the same as "#ifdef HAVE_CONFIG_H". >

Re: ☠ Buildbot (Sourceware): elfutils - failed test (failure) (main)

2025-04-04 Thread Mark Wielaard
Hi, On Fri, 2025-04-04 at 12:39 +, buil...@sourceware.org wrote: > A new failure has been detected on builder elfutils-debian-armhf while > building elfutils. > > Full details are available at: > https://builder.sourceware.org/buildbot/#/builders/6/builds/403 > > Build state: failed tes

☠ Buildbot (Sourceware): elfutils - failed test (failure) (main)

2025-04-04 Thread builder
A new failure has been detected on builder elfutils-debian-armhf while building elfutils. Full details are available at: https://builder.sourceware.org/buildbot/#/builders/6/builds/403 Build state: failed test (failure) Revision: ef1ca49f5289ba8836a5f98b6ee8e387b96ebaf3 Worker: debian-armhf

Re: [PATCH 06/13] libdwfl [6/13]: Elf* caching via dwfl_process_tracker

2025-04-04 Thread Serhei Makarov
On Thu, Apr 3, 2025, at 1:19 PM, Serhei Makarov wrote: > On Sun, Mar 16, 2025, at 7:15 PM, Serhei Makarov wrote: >> +/* The same callback, except this first attempts to look up a cached >> + Elf* and fd from the Dwfl_Module's Dwfl_Process_Tracker (if any). >> + If a new Elf* has to be create

Re: [PATCH 1/3] Add some supporting framework for C11-style atomics.

2025-04-04 Thread Mark Wielaard
Hi Dmitry, On Thu, 2025-04-03 at 19:09 +0300, Dmitry V. Levin wrote: > On Thu, Aug 29, 2019 at 03:16:12PM +0200, Mark Wielaard wrote: > > From: Jonathon Anderson > > > > Uses the stdatomic.h provided by FreeBSD when GCC doesn't (ie. GCC < 4.9) > > > > Signed-off-by: Jonathon Anderson > > Signe

[PATCH v2 05/12] libdwfl [5/12]: introduce Dwfl_Process_Tracker

2025-04-04 Thread Serhei Makarov
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

[PATCH v2 02/12] libdwfl [2/12]: expose setfunc callback for libdwfl+libebl clients

2025-04-04 Thread Serhei Makarov
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

[PATCH v2 10/12] eu-stacktrace [10/12]: use dwfl_process_tracker_find_pid

2025-04-04 Thread Serhei Makarov
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

[PATCH v2 09/12] libdwfl [9/12]: add dwfl_process_tracker_find_pid

2025-04-04 Thread Serhei Makarov
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

[PATCH v2 03/12] libebl [3/12]: eu-stacktrace: use new register handling api

2025-04-04 Thread Serhei Makarov
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

[PATCH v2 06/12] libdwfl [6/12]: Elf* caching via dwfl_process_tracker

2025-04-04 Thread Serhei Makarov
Changes for v2: - Add locking for elftab. This is needed in addition to the intrinsic locking in dynamicsizehash_concurrent to avoid having cache_elf expose an incomplete dwfltracker_elf_info* entry to other threads while its data is being populated / replaced. - Tidy dwfl_process_tracker

[PATCH v2 08/12] libdwfl [8/12]: Dwfl* caching via dwfl_process_tracker

2025-04-04 Thread Serhei Makarov
The Dwfl_Process_Tracker also includes a dynamicsizehash cache which maps process ids to Dwfl * (or rather, dwfltracker_dwfl_info * allowing the table entry to be replaced). Dwfls created from the tracker are automatically added to it, and removed on dwfl_end(). * libdwfl/libdwflP.h (dwfltracker_

[PATCH v2 04/12] libdwfl [4/12]: add dwfl_perf_sample_preferred_regs_mask

2025-04-04 Thread Serhei Makarov
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

[PATCH v2 07/12] eu-stacktrace [7/12]: use Dwfl_Process_Tracker for Elf * caching

2025-04-04 Thread Serhei Makarov
* 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

[PATCH v2 01/12] libebl [1/12]: api for perf register handling, start with x86_64

2025-04-04 Thread Serhei Makarov
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

[PATCH v2 12/12] eu-stacktrace [12/12]: use dwfl_perf_sample_getframes

2025-04-04 Thread Serhei Makarov
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 verbose option as the relevant code is inside libdwfl now. (struct __sample_arg): Remove, handled by libdwfl/dwfl_perf_fram

[PATCH v2 11/12] libdwfl [11/12]: add dwfl_perf_sample_getframes

2025-04-04 Thread Serhei Makarov
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 unwinding that doesn't require the Dwfl to be attached to a live process (via ptrace) or via corefile.