HPerf reads a Linux perf trace (perf.data) and annotates the
corresponding disassembly. This is similar to perf-report /
perf-annotate, but with a GUI, a different layout, and
additional features.
Download hperf 6.14.5. Live demo.
Requires perf record -b on Intel,
perf record -b -e cycles,branches on AMD.
objdump).The hperf command reads a perf.data trace
file and outputs a single self-contained html file (with
both data and a javascript UI). The UI can be customized with
user-provided css.
HPerf is well suited for long perf traces, but generation may be slow
with large binaries. This is because it will get from
objdump the full disassembly of all the DSOs encountered in
the trace, and all of it needs to fit in memory. Trace samples are then
counted against their corresponding instruction, allowing for
arbitrarily long traces. Note that the output will contain the
disassembly of all hotspots (plus some context) and the content of all
corresponding source files.
Build dependencies: gcc or clang, make
Runtime dependencies: perf,
objdump,
highlight
(optional), a browser with javascript enabled.
make
Usage: hperf [options]
Options:
-i file input file, produced by perf-record (default: perf.data)
-o file output file (default: report.html)
-s count[%] minimum number of samples per insn (default: 1)
-t count[%] minimum total number of samples per hotspot (default: 2)
-c n merge hotspots separated by up to n insn (default: 5)
-d n output n insn before and after hotspots (default: 100)
-S file replacement css file path (default: none)
-A file additional css file path (default: none)
-T theme initial theme: 'dark' or 'light' (default: light)
-v level verbosity level (default: 1)
hperf 6.14.5 Fixed
handling of code blocks with no source information in objdump
output.hperf 6.8.8 Added support
for C++ symbol information, which may contain spaces.hperf 6.6.3 Graciously skip
syntax highlight when highlight is unavailable. Fixed
handling of unavailable source files.hperf 6.5.4 Adjusted for
changes in perf-script output. Made hperf version number
follow supported perf version in lockstep.hperf 1.4
Added disassembly caching.hperf 1.2
Adjusted for changes in perf-script output.hperf 1.1
Support branch samples in perf-script output.hperf 1.0
First release.