perf callchain: Save eh/debug frame offset for dwarf unwind
When libunwind tries to resolve callchains it needs to know the offset
of .eh_frame_hdr or .debug_frame to access the dso. Since it calls
dso__data_fd(), it'll try to grab dso->lock everytime for same
information. So save it to dso_data struct and reuse it.
Note that there's a window between dso__data_fd() and actual use of
the fd. The fd could be closed by other threads to deal with the open
file limit in dso cache code. But I think it's ok since in that case
elf_section_offset() will return 0 so it'll be tried in next acess.
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
2 files changed