[RFC] sketch of an unwinder cache interface for elfutils libdwfl
Serhei Makarov
serhei@serhei.io
Wed Dec 11 14:58:32 GMT 2024
On Wed, Dec 11, 2024, at 9:46 AM, William Cohen wrote:
> Hi Serhei,
>
> The dwfl_report_proc_map() will handle when things are added to the
> memory map. Is there anything to handle the inverse event when memory
> is removed from the process memory map, such as a dlcose()?
>
Interestingly, linux/perf/tools/design.txt mentions an 'munmap' field in struct perf_event_attr, but it doesn't seem to have made it into the actual kernel implementation of perf_events. I'll have to do some more digging to find out what happened with that idea between design and implementation.
If we have reason to believe that the process mappings are changing too drastically to get sensible results with incremental updates, sysprof-live-unwinder's current quick solution (i.e. re-scan the proc mappings from scratch) is a feasible fallback. We just need a threshold for doing that which is 'sensible, but not too frequent'. Even a time threshold might be worth experimenting with for this. The main high-overhead case we're trying to avoid is when a process loads then does mmap, mmap, mmap, and the profiler is following this process from the start and reloading the Dwfl each time.
-- Serhei
More information about the Elfutils-devel
mailing list