Profiling output of JIT on Linux with perf_events/oprofile?
Question
I want to profile code, generated by JIT on Linux, with using hardware performace counters. As I know, most common profilers are oprofile
and perf
.
How can I integrate JIT and oprofile/perf?
My JIT is not JAVA which is already supported in oprofile. (perf?)
For example we can consider LLVM's JIT. I want to
- See the hottest functions (their names) from JIT-ted code
- See the disassembly of hottest function, with performance counter statistics assigned to every instruction
Solution
To profile JITed code using perf, download, compile and install the perf-map-agent library, then (for java code anyway) add the
-agentpath:<path>/libperfmap.so
to the command line.
For non-java code, as long as the /tmp/perf-$pid.map
symbol map files are generated, perf
will use those when it produces perf reports.
Brendan Gregg has a blog post that has related references.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow