Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

perf jit: Do not assume pgoff is zero

When calculating .eh_frame_hdr base and LUT offsets do not always assume
that pgoff is zero.

The assumption is false for DSOs built from the jitdump by perf inject,
because the ELF header did not exist in memory at sampling time.

Signed-off-by: Stefano Sanfilippo <ssanfilippo@chromium.org>
Signed-off-by: Ross McIlroy <rmcilroy@chromium.org>
Reviewed-by: Stephane Eranian <eranian@google.com>
Cc: Anton Blanchard <anton@ozlabs.org>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/1476356383-30100-6-git-send-email-eranian@google.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>

authored by

Stefano Sanfilippo and committed by
Arnaldo Carvalho de Melo
eac05af2 7354ec7a

+2 -2
+2 -2
tools/perf/util/unwind-libunwind-local.c
··· 357 357 di.format = UNW_INFO_FORMAT_REMOTE_TABLE; 358 358 di.start_ip = map->start; 359 359 di.end_ip = map->end; 360 - di.u.rti.segbase = map->start + segbase; 361 - di.u.rti.table_data = map->start + table_data; 360 + di.u.rti.segbase = map->start + segbase - map->pgoff; 361 + di.u.rti.table_data = map->start + table_data - map->pgoff; 362 362 di.u.rti.table_len = fde_count * sizeof(struct table_entry) 363 363 / sizeof(unw_word_t); 364 364 ret = dwarf_search_unwind_table(as, ip, &di, pi,