[qt/qt-creator/elfutils]: Summary of bulk changes made

KDE Git Services - Bulk Change <[email protected]>
Newsgroups gmane.comp.kde.cvs
Message-ID <[email protected]>
Git repository change summary for qt/qt-creator/elfutils
Pushed by mirror-service into branch 'upstream/users/serhei/try-stackprof-for-0.196'.
Changed from 150f07f27cd154c02efb5d74c92380aa0220dba8 to c6a9a92253208f5794c35a37e08b8d0e57740344
Acknowledgement was received that this change introduces only existing code that has been pushed to another public open source repository.

This change contains the following new commits:

Git commit 888d715d0e1668dfc299f2f4dc34f9443361128e by Serhei Makarov on 13/08/2026 at 20:01..
eblinitreg_sample.c: guard ebl_set_initial_registers_sample

The generic code in ebl_set_initial_registers_sample is meant to be
used on arches with simple/small register files and a contiguous
linear mapping of perf_regs<->dwarf_regs. Make sure to guard it with a
check of ebl->perf_frame_regs_mask (the canonical sign that
sample_regs is supported for this arch).

Otherwise, a hypothetical call to ebl_set_initial_registers_sample()
on an unsupported arch with many regs falls through to the generic
code and ends up writing out of bounds to the dwarf_regs array,
(at least in builds where the assert is also compiled out).

Based on Sayed Kaif's patch and problem report cf
https://sourceware.org/pipermail/elfutils-devel/2026q2/009378.html

* libebl/eblinitreg_sample.c (ebl_set_initial_registers_sample):
  Guard the generic code on ebl->perf_frame_regs_mask != 0.

Reported-by: Sayed Kaif <[email protected]>
Signed-off-by: Serhei Makarov <[email protected]>
https://invent.kde.org/qt/qt-creator/elfutils/-/commit/888d715d0e1668dfc299f2f4dc34f9443361128e

Git commit 92c01272be80882d234a94764c87b11aaa3578c8 by Serhei Makarov on 13/08/2026 at 20:01..
configure.ac, src/: add C++20, add new stackprof tool

eu-stackprof is a new tool which profiles processes on a Linux system
using perf_events and outputs gprof gmon.out format program counter
histograms and callgraph-arc profiles; intended as an updated demo of
libdwfl_stacktrace functionality and as a data-gathering tool for the
profiledb initiative.

changes for v3: Just this commit, configury fixes requested by amerey.

* configure.ac: Add configure checks for host CPU, C++20,
  eu-stackprof perf/libpfm dependencies incl. build_id in mmap2.
* config/elfutils.spec.in: Add stackprof, pass --enable-stackprof
  or --disable-stackprof as appropriate.
* po/POTFILES.in: Add stackprof.cxx.
* src/Makefile.am (bin_PROGRAMS): Add stackprof.
  (stackprof_*): Add stackprof SOURCES, LDADD, and so forth.
* src/stackprof.cxx: New file.

Co-authored-by: Frank Ch. Eigler <[email protected]>
Signed-off-by: Serhei Makarov <[email protected]>
https://invent.kde.org/qt/qt-creator/elfutils/-/commit/92c01272be80882d234a94764c87b11aaa3578c8

Git commit daf73264a099ca018a5c0e060d568546006eb709 by Serhei Makarov on 13/08/2026 at 20:01..
tests/: add test suite for stackprof

Together with the stackprof tool we add some test cases to exercise
it, and the underlying libdwfl_stacktrace functionality as well.

* tests/stackprof-subr.sh: Common subroutines for checking
  perf_events availability and verifying gmon.*.out files.
* tests/run-stackprof-system.sh: New file.
* tests/run-stackprof-system-gprof.sh: New file.
* tests/run-stackprof-user.sh: New file.
* tests/run-stackprof-user-gprof.sh: New file.
* tests/Makefile.am (TESTS): add the new testcases.

Co-authored-by: Frank Ch. Eigler <[email protected]>
Signed-off-by: Serhei Makarov <[email protected]>
https://invent.kde.org/qt/qt-creator/elfutils/-/commit/daf73264a099ca018a5c0e060d568546006eb709

Git commit d28c195f7e2b6b043d839d8f0f2cdf613cd2a91a by Serhei Makarov on 13/08/2026 at 20:01..
doc/stackprof.1: add man page and NEWS for stackprof

* doc/Makefile.am (dist_man1_MANS): Add stackprof.1.
* doc/stackprof.1: New file.
* NEWS: Add stackprof.

Co-authored-by: Frank Ch. Eigler <[email protected]>
Signed-off-by: Serhei Makarov <[email protected]>
https://invent.kde.org/qt/qt-creator/elfutils/-/commit/d28c195f7e2b6b043d839d8f0f2cdf613cd2a91a

Git commit 7b036fa3c52765f15133d0e2c63951dd6e646124 by Serhei Makarov on 13/08/2026 at 20:01..
src/stacktrace.c: remove in favour of stackprof

Now that stackprof is added, the existing src/stacktrace.c tool is
officially obsolete as a demo -- it relies on a custom patchset for
Sysprof (communicating via pipe, not contributed to mainline, in
favour of the sysprof-live-unwinder tool which links elfutils as a
library), whereas stackprof pulls data from perf_events directly.

Likewise, stackprof includes all of the eu-stacktrace functionality
for logging/statistics.

* configure.ac: Remove eu-stacktrace related bits.
  The configure checks for stackprof are simpler (just perf_events.h
  and libpfm).
* config/elfutils.spec.in: Remove eu-stacktrace.
* po/POTFILES.in: Remove stacktrace.c.
* src/Makefile.am: Remove eu-stacktrace related bits.
* src/stacktrace.c: Remove.
* .forgejo/workflows/check-fedora.yaml: Remove sysprof-capture-devel.

Co-authored-by: Frank Ch. Eigler <[email protected]>
Signed-off-by: Serhei Makarov <[email protected]>
https://invent.kde.org/qt/qt-creator/elfutils/-/commit/7b036fa3c52765f15133d0e2c63951dd6e646124

Git commit 27039f1e924d48659c34dd726366e04c56984a6f by Serhei Makarov on 13/08/2026 at 20:01..
PR34498 libdwfl_stacktace/dwflst_sample_frame.c: API for per-arch constants

One need identified from implementing patches for downstream profiling
tools to adopt libdwfl_stacktrace is that libebl per-architecture
constants are not exposed to external projects.

This makes handling stack pointer especially tricky, as shown
by the incorrect prior eu-stacktrace logic cf PR34498,
since the profiler has to account for how perf_regs mask
might alter the position.

v2: This now incorporates a necessary fix for PR34498.

* libdwfl_stacktrace/libdwfl_stacktrace.h
  (dwflst_arch_from_uname): New API, translates umachine str obtained
  from uname() -> struct utsname -> machine to ELF machine ID.
  (dwflst_arch_sp_dwarf_reg): New API, identifies index of stack ptr.
  (dwflst_arch_sp_perf_reg): New API, identifies index of stack ptr
  in perf_events regs[] array given a perf_regs_mask (cf PR34498).
  (dwflst_arch_expected_frame_nregs): New API, minimal number of regs
  for unwinding (useful for sanity-checking incoming stack samples).
* libdwfl_stacktrace/dwflst_sample_frame.c: Format in two sections.
  (dwflst_arch_from_uname): Implementation.
  (dwflst_arch_expected_frame_nregs): Implementation.
  (dwflst_arch_sp_dwarf_reg): Implementation.
  (dwflst_arch_sp_perf_reg): Implementation.
* libdw/libdw.map (ELFUTILS_0.196_EXPERIMENTAL): Add the new functions.

Signed-off-by: Serhei Makarov <[email protected]>
https://invent.kde.org/qt/qt-creator/elfutils/-/commit/27039f1e924d48659c34dd726366e04c56984a6f

Git commit c6a9a92253208f5794c35a37e08b8d0e57740344 by Serhei Makarov on 13/08/2026 at 20:01..
PR34498 stackprof: adopt new libdwflst API for per-arch constants

This tidies up the architecture-handling code and shows how a profiler
project outside of Elfutils codebase (no access to libebl) can use the
new libdwflst API to accomplish what stackprof does.

v2: Now incorporates a necessary fix for PR34498.

* src/stackprof.cxx (class PerfConsumerUnwinder): Remove get_sp_reg.
  (PerfReader::PerfReader): Use dwflst_arch_from_uname for ELF arch ID.
  (expected_frame_nregs): Remove.
  (PerfConsumerUnwinder::find_dwfl): Additional bounds check on sp,
  use dwflst_arch_expected_frame_nregs and dwflst_arch_sp_perf_reg
  for per-architecture values.
  (PerfConsumerUnwinder::get_sp_reg): Remove.
  (PerfConsumerUnwinder::unwind_frame_cb): Additional bounds check on
  sp, use dwflst_arch_sp_dwarf_reg for per-architecture value.

Signed-off-by: Serhei Makarov <[email protected]>
https://invent.kde.org/qt/qt-creator/elfutils/-/commit/c6a9a92253208f5794c35a37e08b8d0e57740344
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.