Handling pgoff in perf elf mmap/mmap2 elf info
Wed Sep 19 12:12:00 GMT 2018
I work on Hotspot an opensource linux perf aggregator and visualizer.
For this we use perfparser, which in turn uses libdw for unwinding.
Recently, we found more and more perf trace-files to use the 'pgoff'
This happens especially on newer distros, (arch, opensuse tumbleweed).
We suspect perf to offset its recording-addresses of mmapped
dsos/executables starting with a specific section, such that they denote
their pointers with this pg_offset parameter. (e.g. skipping a library's
header and setting pgoff to the headersize). Although we are not 100%
sure about this information.
The Function I am using here is:
extern Dwfl_Module *dwfl_report_elf (Dwfl *dwfl, const char *name,
const char *file_name, int fd,
GElf_Addr base, bool add_p_vaddr);
in the specific call I am doing is:
Dwfl_Module *ret = dwfl_report_elf(
and I am wondering how to include the pgoff here.
Simply subtracting it from info.addr results in a lots of "address range
overlaps an existing module" errors, where I guess I subtracted too
much. I know pgoff is in bytes.
Tried adding the offset, also overlap errors.
Ignoring the offset results in errors where perfparser fails to find ELF
for instruction pointer addresses.
I would be happy to hear if anyone has experience unwinding with these
Maybe there is a different function I should use reporting the elf.
Maybe even someone unwinded/parsed perf data before.
 sparse info at
Christoph Sterz | email@example.com | Software Engineer
KDAB (Deutschland) GmbH, a KDAB Group company
KDAB - The Qt, C++ and OpenGL Experts
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 4003 bytes
Desc: S/MIME Cryptographic Signature
More information about the Elfutils-devel