perf report: Read a perf.data Profile
perf report reads a perf.data file and ranks functions by how much sampled time they consumed.
After perf record captures samples, perf report turns them into a hotspot list. In CI you want the non-interactive --stdio output you can log or diff.
What it does
perf report parses perf.data and aggregates samples by symbol, showing the percentage of time in each function and, with call-graph data, the paths that led there. Interactively it is a TUI; with --stdio it prints plain text.
Common usage
perf report # interactive TUI
perf report --stdio # non-interactive text (for CI logs)
# collapse call graph by caller
perf report --stdio -g graph,0.5,callerOptions
| Flag | What it does |
|---|---|
| --stdio | Print text instead of opening the TUI (use in CI) |
| -i <file> | Read a named input file instead of perf.data |
| -g <opts> | Control call-graph display (graph/flat, threshold, order) |
| --sort <keys> | Sort by comm, dso, symbol, etc. |
| -n | Show sample counts alongside percentages |
Common errors in CI
"The perf.data file has no samples" means recording captured nothing; the program exited before sampling started or paranoid settings blocked it. Symbols shown as raw addresses or "[unknown]" mean the binary was stripped or debug info is missing; keep unstripped builds or install the matching debuginfo. "incompatible file format" means the perf.data was produced by a different perf version than the one reading it.