diff options
author | Stefano Sanfilippo <ssanfilippo@chromium.org> | 2016-10-13 13:59:41 +0300 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2016-10-24 17:07:40 +0300 |
commit | 086f9f3d7897d8081b18b949caa631b937c5891e (patch) | |
tree | 36eb29f095d9b5e3e73e4f7a94378d90e5672b80 /tools/perf/util/genelf.h | |
parent | 0284fecd13b6db3ecd4c2b1bf3e72b105edce24b (diff) | |
download | linux-086f9f3d7897d8081b18b949caa631b937c5891e.tar.xz |
perf jit: Generate .eh_frame/.eh_frame_hdr in DSO
When the jit_buf_desc contains unwinding information, it is emitted as
eh_frame unwinding sections in the DSOs generated by perf inject.
The unwinding information is required to unwind of JITed code which do
not maintain the frame pointer register during function calls. It can
be emitted by V8 / Chromium when the --perf_prof_unwinding_info is
passed to V8.
The eh_frame and eh_frame_hdr sections are emitted immediately after the
.text.
The .eh_frame is aligned at a 8-byte boundary, and .eh_frame_hdr at a
4-byte one. Since size of the .eh_frame is required to be a multiple of
the word size, which means there will never be additional padding
between it and the .eh_frame_hdr on machines where the word size is 4 or
8 bytes.
However, additional padding might be inserted between .text and
.eh_frame to reach the correct alignment, which will always be 8 bytes,
also on 32bit machines. The reasoning behind this choice is that 4 extra
bytes of padding worst case are not a large cost for the advantage of
removing word-size dependent offset calculations when emitting the
jitdump.
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-8-git-send-email-eranian@google.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util/genelf.h')
-rw-r--r-- | tools/perf/util/genelf.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/tools/perf/util/genelf.h b/tools/perf/util/genelf.h index 5c933ac71451..2424bd9862a3 100644 --- a/tools/perf/util/genelf.h +++ b/tools/perf/util/genelf.h @@ -3,7 +3,8 @@ /* genelf.c */ int jit_write_elf(int fd, uint64_t code_addr, const char *sym, - const void *code, int csize, void *debug, int nr_debug_entries); + const void *code, int csize, void *debug, int nr_debug_entries, + void *unwinding, uint64_t unwinding_header_size, uint64_t unwinding_size); #ifdef HAVE_DWARF_SUPPORT /* genelf_debug.c */ int jit_add_debug_info(Elf *e, uint64_t code_addr, void *debug, int nr_debug_entries); |