perf_report
Generate a ranked overhead histogram from perf.data to identify which functions consume the most CPU time and pinpoint performance bottlenecks.
Instructions
Histogram profiling: shows which functions consumed the most CPU time (or other events) as a ranked overhead table.
This is the primary analysis tool. Use it to answer 'where is time spent?'
Key parameters:
sort: columns to group by. Default 'comm,dso,symbol'. Use 'srcline' for source lines, 'pid,tid' for threads, 'dso' for libraries.
call_graph: enable callchain. Use 'graph,0.5,caller,function,percent' for a standard caller-based call graph with 0.5% threshold.
percent_limit: hide entries below N% (e.g. 1.0 to show only >1%).
symbols: filter to specific function(s).
dsos: filter to specific DSO(s).
time: restrict to time range 'start,stop' in seconds.
header_only: show file metadata without the histogram.
mem_mode: switch to memory access profiling (needs perf record -d).
branch_stack: switch to branch profiling (needs perf record -b).
latency: show latency-centric view (needs perf record --latency).
children: set to false (--no-children) to show self overhead only.
Output: table with columns like '% overhead | command | DSO | symbol'. Works on any perf.data from perf record.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ns | No | Show times in nanoseconds | |
| cpu | No | List of CPUs to filter | |
| pid | No | Only consider symbols in these PIDs | |
| tid | No | Only consider symbols in these TIDs | |
| dsos | No | Only consider symbols in these DSOs (comma-separated) | |
| sort | No | Sort by key(s): comm,dso,symbol,parent,cpu,socket,srcline,weight,local_weight,addr,data_src,mem,snoop,tlb,locked,blocked,local_ins_lat,global_ins_lat,local_p_stage_cyc,global_p_stage_cyc,cgroup_id,type,typeoff,symoff,pid,tid,latency,parallelism | |
| time | No | Time span of interest (start,stop) in seconds | |
| comms | No | Only consider symbols in these comms (comma-separated) | |
| force | No | Don't complain, do it | |
| group | No | Show event group information together | |
| input | Yes | Path to perf.data file | |
| mmaps | No | Display recorded tasks memory maps | |
| quiet | No | Do not show any warnings or messages | |
| stats | No | Display event stats | |
| symfs | No | Symbol filesystem root for offline analysis | |
| tasks | No | Display recorded tasks | |
| fields | No | Output field(s): overhead,overhead_sys,overhead_us,overhead_children,overhead_guest,sample,period | |
| header | No | Show data header | |
| inline | No | Show inline function | |
| itrace | No | Instruction Tracing options | |
| parent | No | Regex filter to identify parent | |
| prefix | No | Add prefix to source file path names | |
| pretty | No | Pretty printing style key: normal raw | |
| source | No | Interleave source code with assembly (default on) | |
| asm_raw | No | Display raw encoding of assembly | |
| latency | No | Show latency-centric profile (requires perf record --latency) | |
| modules | No | Load module symbols | |
| samples | No | Number of samples to save per histogram entry | |
| symbols | No | Only consider these symbols | |
| threads | No | Show per-thread event counters | |
| verbose | No | Verbosity level (0-2) | |
| vmlinux | No | vmlinux pathname | |
| children | No | Accumulate callchains of children (default on) | |
| demangle | No | Symbol demangling (default on) | |
| inverted | No | Inverted call graph | |
| kallsyms | No | kallsyms pathname | |
| mem_mode | No | Memory access profile | |
| hierarchy | No | Show entries in a hierarchy | |
| max_stack | No | Maximum stack depth for callchain parsing | |
| raw_trace | No | Show raw trace event output | |
| show_info | No | Display extended information about perf.data | |
| call_graph | No | Call graph: print_type,threshold[,print_limit],order,sort_key[,branch],value (e.g. 'graph,0.5,caller,function,percent') | |
| percentage | No | How to display percentage | |
| skip_empty | No | Do not display empty events | |
| stitch_lbr | No | Enable LBR callgraph stitching | |
| header_only | No | Show only data header | |
| parallelism | No | Only consider these parallelism levels | |
| branch_stack | No | Use branch records for per-branch histogram | |
| percent_type | No | Percent type | |
| prefix_strip | No | Strip first N entries of source file path | |
| time_quantum | No | Time quantum for time sort key (e.g. '100ms') | |
| total_cycles | No | Sort all blocks by 'Sampled Cycles%' | |
| column_widths | No | Fixed column widths | |
| disable_order | No | Disable raw trace ordering | |
| exclude_other | No | Only display entries with parent-match | |
| percent_limit | No | Don't show entries under this percent | |
| socket_filter | No | Only show processor socket matching filter | |
| symbol_filter | No | Only show symbols matching filter | |
| branch_history | No | Add last branch records to call history | |
| dump_raw_trace | No | Dump raw trace in ASCII | |
| group_sort_idx | No | Sort output by Nth event in group | |
| ignore_callees | No | Regex of callees to ignore in call graphs | |
| ignore_vmlinux | No | Don't load vmlinux even if found | |
| demangle_kernel | No | Enable kernel symbol demangling | |
| field_separator | No | Separator for columns | |
| hide_unresolved | No | Only display entries resolved to a symbol | |
| show_nr_samples | No | Show column with sample count | |
| full_source_path | No | Show full source file name path for source lines | |
| show_total_period | No | Show column with sum of periods | |
| disassembler_style | No | Disassembler style (e.g. 'intel') | |
| show_ref_call_graph | No | Show callgraph from reference event | |
| show_cpu_utilization | No | Show sample % for different CPU modes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |