path: root/tools/perf/Documentation
diff options
authorStephane Eranian <>2015-11-30 10:02:21 +0100
committerArnaldo Carvalho de Melo <>2016-02-05 09:46:45 -0300
commit9b07e27f88b9cd785cdb23f9a2231c12521dda94 (patch)
tree5634fa81d6d34df7ef2378f0c37f76bff3ec6a5e /tools/perf/Documentation
parent921f3fadbc48c7c3799b415b895297cd476cf7f1 (diff)
perf inject: Add jitdump mmap injection support
This patch adds a --jit/-j option to perf inject. This options injects MMAP records into the file to cover the jitted code mmaps. It also emits ELF images for each function in the jidump file. Those images are created where the jitdump file is. The MMAP records point to that location as well. Typical flow: $ perf record -k mono -- java java_class $ perf inject --jit -i -o $ perf report -i Note that jitdump.h support is not limited to Java, it works with any jitted environment modified to emit the jitdump file format, include those where code can be jitted multiple times and moved around. The jitdump.h format is adapted from the Oprofile project. The genelf.c (ELF binary generation) depends on MD5 hash encoding for the buildid. To enable this, libssl-dev must be installed. If not, then genelf.c defaults to using urandom to generate the buildid, which is not ideal. The Makefile auto-detects the presence on libssl-dev. This version mmaps the jitdump file to create a marker MMAP record in the file. The marker is used to detect jitdump and cause perf inject to inject the jitted mmaps and generate ELF images for jitted functions. In V8, the following fixes and changes were made among other things: - the jidump header format include a new flags field to be used to carry information about the configuration of the runtime agent. Contributed by: Adrian Hunter <> - Fix mmap pgoff: MMAP event pgoff must be the offset within the ELF file at which the code resides. Contributed by: Adrian Hunter <> - Fix ELF virtual addresses: perf tools expect the ELF virtual addresses of dynamic objects to match the file offset. Contributed by: Adrian Hunter <> - JIT MMAP injection does not obey finished_round semantics. JIT MMAP injection injects all MMAP events in one go, so it does not obey finished_round semantics, so drop the finished_round events from the output file. Contributed by: Adrian Hunter <> Signed-off-by: Stephane Eranian <> Cc: Adrian Hunter <> Cc: Andi Kleen <> Cc: Carl Love <> Cc: David Ahern <> Cc: Jiri Olsa <> Cc: John McCutchan <> Cc: Namhyung Kim <> Cc: Pawel Moll <> Cc: Peter Zijlstra <> Cc: Sonny Rao <> Cc: Sukadev Bhattiprolu <> Link: [ Moved inject.build_ids ordering bits to a separate patch, fixed the NO_LIBELF=1 build ] Signed-off-by: Arnaldo Carvalho de Melo <>
Diffstat (limited to 'tools/perf/Documentation')
1 files changed, 7 insertions, 0 deletions
diff --git a/tools/perf/Documentation/perf-inject.txt b/tools/perf/Documentation/perf-inject.txt
index 0b1cedeef895..87b2588d1cbd 100644
--- a/tools/perf/Documentation/perf-inject.txt
+++ b/tools/perf/Documentation/perf-inject.txt
@@ -53,6 +53,13 @@ include::itrace.txt[]
Use with --itrace to strip out non-synthesized events.
+ Process jitdump files by injecting the mmap records corresponding to jitted
+ functions. This option also generates the ELF images for each jitted function
+ found in the jitdumps files captured in the input file. Use this option
+ if you are monitoring environment using JIT runtimes, such as Java, DART or V8.
linkperf:perf-record[1], linkperf:perf-report[1], linkperf:perf-archive[1]