[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20260127174253.396766-1-serhei@serhei.io>
Date: Tue, 27 Jan 2026 12:42:53 -0500
From: Serhei Makarov <serhei@...hei.io>
To: irogers@...gle.com
Cc: acme@...nel.org,
aditya.b1@...ux.ibm.com,
adrian.hunter@...el.com,
ak@...ux.intel.com,
alex@...ti.fr,
aou@...s.berkeley.edu,
atrajeev@...ux.ibm.com,
ctshao@...gle.com,
dvyukov@...gle.com,
guoren@...nel.org,
haibo1.xu@...el.com,
howardchu95@...il.com,
james.clark@...aro.org,
john.g.garry@...cle.com,
jolsa@...nel.org,
krzysztof.m.lopatowski@...il.com,
leo.yan@...ux.dev,
linux-arm-kernel@...ts.infradead.org,
linux-csky@...r.kernel.org,
linux-kernel@...r.kernel.org,
linux-perf-users@...r.kernel.org,
linux-riscv@...ts.infradead.org,
linux@...blig.org,
mark@...mp.org,
mingo@...hat.com,
namhyung@...nel.org,
palmer@...belt.com,
peterz@...radead.org,
pjw@...nel.org,
shimin.guo@...dio.com,
slyich@...il.com,
stephen.s.brennan@...cle.com,
thomas.falcon@...el.com,
will@...nel.org
Subject: Re: [PATCH v1 22/23] perf unwind-libdw: Don't discard loaded ELF/Dwarf after every unwind
> As removing the dwfl didn't prove possible, an alternative is to just not discard the dwfl when the unwind ends. The dwfl is valid for a process unless a dso is loaded at the same address as a previous one. So keep the dwfl with the maps, invalidate it if a map is removed (in case a new map replaces it) and recycle the dwfl in the unwinding code.
Relevant note:
I'm looking at whether elfutils libdwfl_stacktrace might further help with these issues. The libdwfl_stacktrace library is currently shipped as an experimental addon to libdwfl in elfutils 0.194, but I'm intending to stabilize the API this year. There's code for some analogous functions: translating perf->dwarf register files, and caching Dwfl and Elf data to speed up unwinding across multiple processes. (Thus, if unwinding a collection of perf_events from 16 processes that use libc, we don't need to load the CFI for libc.so 16 times.)
I think once I've stabilized the libdwfl_stacktrace API and expanded the register support to a larger set of perf-supported architectures, it makes sense for me to author a corresponding set of patches for perf. I'll see if it's worth adding more libdwflst functionality to elfutils 0.195 in anticipation of this.
-- Serhei Makarov
Powered by blists - more mailing lists