Re: [PATCH v2 5/6] Remove usage of "unlocked" variant of stdio print functions

2024-10-17 Thread Mark Wielaard
Hi Michael, On Wed, 2024-10-16 at 19:53 +, Michael Pratt wrote: > These "unlocked" Linux Standard Base variants of standard functions > are not available on some systems that are still capable > of building Linux and ELFs. > > The difference is negligible for simple printing to stdout. > > P

[PATCH v2 3/5] libdwfl: add unwind origin diagnostics

2024-10-17 Thread Serhei Makarov
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 u

[PATCH v2 4/5] src: add unwind origin diagnostics to eu-stack

2024-10-17 Thread Serhei Makarov
Since we obtain diagnostics about unwind method, another logical place to show them is in eu-stack. * src/stack.c (show_unwound_source): New global variable. (struct frame): Add unwound_source field. (frame_callback): Copy over unwound_source from Dwfl_Frame. (print_frame): Take unwound_sour

[PATCH v2 5/5] NEWS: add entry for eu-stacktrace

2024-10-17 Thread Serhei Makarov
Signed-off-by: Serhei Makarov --- NEWS | 7 +++ 1 file changed, 7 insertions(+) diff --git a/NEWS b/NEWS index 410bccc1..01909c0c 100644 --- a/NEWS +++ b/NEWS @@ -8,6 +8,13 @@ debuginfod: Add per-file signature verification for integrity debuginfod: New API for metadata queries: file name

[PATCH v2 1/5] src: add eu-stacktrace tool

2024-10-17 Thread Serhei Makarov
eu-stacktrace is a utility to process a stream of raw stack samples (such as those obtained from the Linux kernel's PERF_SAMPLE_STACK facility) into a stream of stack traces (such as those obtained from PERF_SAMPLE_CALLCHAIN), freeing other profiling utilities from having to implement their own bac

[PATCH v2 2/5] configure.ac: eu-stacktrace initial version (x86/sysprof only)

2024-10-17 Thread Serhei Makarov
Due to the x86-specific code in the initial version the configury has significant restrictions. If --enable-stacktrace is not explicitly provided, then eu-stacktrace will be disabled by default. The way we test for x86 is a bit unusual. What we actually care about is that the register file provide

Re: [PATCH v2 4/5] src: add unwind origin diagnostics to eu-stack

2024-10-17 Thread Mark Wielaard
Hi Serhei, On Thu, Oct 17, 2024 at 02:54:34PM -0400, Serhei Makarov wrote: > Since we obtain diagnostics about unwind method, another logical place > to show them is in eu-stack. > > * src/stack.c (show_unwound_source): New global variable. > (struct frame): Add unwound_source field. > (frame

Re: [PATCH v2 2/5] configure.ac: eu-stacktrace initial version (x86/sysprof only)

2024-10-17 Thread Aaron Merey
On Thu, Oct 17, 2024 at 2:51 PM Serhei Makarov wrote: > > Due to the x86-specific code in the initial version the configury has > significant restrictions. If --enable-stacktrace is not explicitly > provided, then eu-stacktrace will be disabled by default. > > The way we test for x86 is a bit unus

Re: [PATCH v2 3/5] libdwfl: add unwind origin diagnostics

2024-10-17 Thread Aaron Merey
On Thu, Oct 17, 2024 at 2:53 PM Serhei Makarov wrote: > > 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

Re: [PATCH v2 5/5] NEWS: add entry for eu-stacktrace

2024-10-17 Thread Aaron Merey
On Thu, Oct 17, 2024 at 2:56 PM Serhei Makarov wrote: > > Signed-off-by: Serhei Makarov > --- > NEWS | 7 +++ > 1 file changed, 7 insertions(+) > > diff --git a/NEWS b/NEWS > index 410bccc1..01909c0c 100644 > --- a/NEWS > +++ b/NEWS > @@ -8,6 +8,13 @@ debuginfod: Add per-file signature verif

Re: [PATCH v2 4/5] src: add unwind origin diagnostics to eu-stack

2024-10-17 Thread Aaron Merey
On Thu, Oct 17, 2024 at 3:41 PM Mark Wielaard wrote: > > Hi Serhei, > > On Thu, Oct 17, 2024 at 02:54:34PM -0400, Serhei Makarov wrote: > > Since we obtain diagnostics about unwind method, another logical place > > to show them is in eu-stack. > > > > * src/stack.c (show_unwound_source): New globa

Re: [PATCH v2 1/5] src: add eu-stacktrace tool

2024-10-17 Thread Aaron Merey
On Thu, Oct 17, 2024 at 2:49 PM Serhei Makarov wrote: > > eu-stacktrace is a utility to process a stream of raw stack > samples (such as those obtained from the Linux kernel's > PERF_SAMPLE_STACK facility) into a stream of stack traces (such as > those obtained from PERF_SAMPLE_CALLCHAIN), freeing

[PATCH v2] libdwelf: add dwelf_elf_remove_debug_relocs

2024-10-17 Thread Aaron Merey
From: Di Chen Provide a public function for removing debug section relocations. eu-strip previously contained the code to remove debug section relocations. This patch moves that code into dwelf_elf_remove_debug_relocs. https://sourceware.org/bugzilla/show_bug.cgi?id=31447 Signed-off-by: Di Ch

Re: [PATCH] libelf: elf_compress doesn't handle multiple elf_newdata chunks correctly

2024-10-17 Thread Aaron Merey
On Thu, Oct 17, 2024 at 11:59 AM Mark Wielaard wrote: > > elf_compress would compress all (new) data chunks, but didn't reset > the section data_list. This would cause extra data to be returned > after decompression or create bad compressed data. Add a new testcase > for this and explicitly zap th

[PATCH] doc: Add libelf man page

2024-10-17 Thread Aaron Merey
Signed-off-by: Aaron Merey --- config/elfutils.spec.in | 1 + doc/Makefile.am | 3 +- doc/libelf.3| 363 3 files changed, 366 insertions(+), 1 deletion(-) create mode 100644 doc/libelf.3 diff --git a/config/elfutils.spec.in b/conf

Re: [PATCH 2/4] eu-stacktrace: configury for initial version (x86/sysprof only)

2024-10-17 Thread Aaron Merey
On Thu, Oct 17, 2024 at 11:28 AM Serhei Makarov wrote: > > On Wed, Oct 16, 2024, at 11:38 PM, Aaron Merey wrote: > > Using less wide indentation throughout would help make the configure.ac > > changes more readable. Otherwise this patch LGTM. > Ok, my code imitated the offset for the debuginfod c

Re: [PATCH 1/4] eu-stacktrace: add eu-stacktrace tool

2024-10-17 Thread Serhei Makarov
On Wed, Oct 16, 2024, at 11:37 PM, Aaron Merey wrote: > Please add an eu-stacktrace entry to NEWS. Ok, will do. > I tried to run this but I kept getting: > Failed to complete recording: GDBus.Error[...]: Action > org.gnome.sysprof3.profile is not registered Right. To have sysprof work requ

[Bug libelf/32102] elf_compress doesn't handle multiple Elf_Data chunks created with elf_newdata correctly

2024-10-17 Thread mark at klomp dot org
https://sourceware.org/bugzilla/show_bug.cgi?id=32102 Mark Wielaard changed: What|Removed |Added Assignee|unassigned at sourceware dot org |mark at klomp dot org

Re: [PATCH 1/4] eu-stacktrace: add eu-stacktrace tool

2024-10-17 Thread Aaron Merey
On Thu, Oct 17, 2024 at 11:50 AM Serhei Makarov wrote: > > > I'm comfortable with this being merged for the release as long as any > > build errors are sorted out and we emphasize in the usage text and > > NEWS that eu-stacktrace is an experimental feature with a possibly > > unstable ABI. > I thi

Re: [PATCH 4/4] eu-stacktrace: add unwind origin diagnostics to eu-stack

2024-10-17 Thread Mark Wielaard
Hi Serhei, On Tue, 2024-10-15 at 11:26 -0400, Serhei Makarov wrote: > Since we obtain diagnostics about unwind method, another logical place > to show them is in eu-stack. > > This requires an additional pseudo-unwind type DWFL_UNWOUND_INLINE to > clarify what happens with entries for inlined fun

Re: [PATCH 3/4] eu-stacktrace: add unwind origin diagnostics

2024-10-17 Thread Serhei Makarov
On Wed, Oct 16, 2024, at 11:39 PM, Aaron Merey wrote: > Hi Serhei, > > On Tue, Oct 15, 2024 at 11:28 AM Serhei Makarov wrote: >> >> 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 t

Re: [PATCH 2/4] eu-stacktrace: configury for initial version (x86/sysprof only)

2024-10-17 Thread Serhei Makarov
On Wed, Oct 16, 2024, at 11:38 PM, Aaron Merey wrote: > Using less wide indentation throughout would help make the configure.ac > changes more readable. Otherwise this patch LGTM. Ok, my code imitated the offset for the debuginfod configury immediately above, but I'll update the patch to use 3

[PATCH] libelf: elf_compress doesn't handle multiple elf_newdata chunks correctly

2024-10-17 Thread Mark Wielaard
elf_compress would compress all (new) data chunks, but didn't reset the section data_list. This would cause extra data to be returned after decompression or create bad compressed data. Add a new testcase for this and explicitly zap the scn->data_list before resetting the elf section raw data after

Re: [PATCH 1/4] eu-stacktrace: add eu-stacktrace tool

2024-10-17 Thread Serhei Makarov
On Thu, Oct 17, 2024, at 12:18 PM, Aaron Merey wrote: > I'm seeing eu-stacktrace built by default on x86 with no > --enable-stacktrace given to configure. Now I'm waffling back and forth on what to do. Mark wants to enable eu-stacktrace build on one of the buildbots. The current behaviour (whic

Re: [PATCH 4/4] eu-stacktrace: add unwind origin diagnostics to eu-stack

2024-10-17 Thread Serhei Makarov
On Thu, Oct 17, 2024, at 1:00 PM, Mark Wielaard wrote: > This part looks a little iffy IMHO. > It feels like a layering violation. > The meaning of DWFL_UNWOUND_INLINE is also different from the others. > There is no worst/best ordering here. > They are not connected to frames. > > Is there a wa

Re: [PATCH 4/4] eu-stacktrace: add unwind origin diagnostics to eu-stack

2024-10-17 Thread Mark Wielaard
Hi Serhei, On Thu, 2024-10-17 at 13:13 -0400, Serhei Makarov wrote: > On Thu, Oct 17, 2024, at 1:00 PM, Mark Wielaard wrote: > > This part looks a little iffy IMHO. > > It feels like a layering violation. > > The meaning of DWFL_UNWOUND_INLINE is also different from the others. > > There is no wor

Re: [PATCH 1/4] eu-stacktrace: add eu-stacktrace tool

2024-10-17 Thread Aaron Merey
On Thu, Oct 17, 2024 at 1:09 PM Serhei Makarov wrote: > On Thu, Oct 17, 2024, at 12:18 PM, Aaron Merey wrote: > > I'm seeing eu-stacktrace built by default on x86 with no > > --enable-stacktrace given to configure. > Now I'm waffling back and forth on what to do. > > Mark wants to enable eu-stackt

Re: [PATCH 4/4] eu-stacktrace: add unwind origin diagnostics to eu-stack

2024-10-17 Thread Serhei Makarov
On Thu, Oct 17, 2024, at 1:22 PM, Mark Wielaard wrote: > I think (but haven't tried) only print_frame has to have a char * > argument, print_inline_frames and print_frames can still pass around an > Dwfl_Unwound_Source. Both print_frames and print_inline_frames can then > call print_frame with t