PERF-REPORT(1)
โจ NAME โจ
perf-report โ bestie, this is the one that reads your perf.data (the file perf record made for you) and shows you the whole profile. It's giving "receipts from your CPU." ๐
๐ธ SYNOPSIS ๐ธ
perf report [-i <file> | --input=file]
๐ฆ DESCRIPTION ๐ฆ
Okay so picture this: you already ran perf record and it wrote down all your performance counter tea โ. This command is what displays that profile info. Iconic. Periodt. ๐
๐ OPTIONS ๐
-i,--input=โ the input file name, duh. (default:perf.dataunless stdin is a fifo ๐ซถ)-v,--verboseโ be more verbose, like show symbol address and stuff. (show symbol address, etc) ๐-q,--quietโ do not show any warnings or messages. (Suppress-v) shhh ๐คซ-n,--show-nr-samplesโ show the number of samples for each symbol ๐ข--show-cpu-utilizationโ show sample percentage for different cpu modes.-T,--threadsโ show per-thread event counters. Heads up though, the input data file should be recorded with-soption.-c,--comms=โ only consider symbols in these comms. It's a CSV, and it understandsfile://filenameentries. This option will affect the percentage of the overhead and latency columns. See--percentagefor more info. โจ--pid=โ only show events for given process ID (comma separated list).--tid=โ only show events for given thread ID (comma separated list).-d,--dsos=โ only consider symbols in these dsos. CSV that understandsfile://filenameentries. This option will affect the percentage of the overhead and latency columns. See--percentagefor more info.-S,--symbols=โ only consider these symbols. CSV that understandsfile://filenameentries. This option will affect the percentage of the overhead and latency columns. See--percentagefor more info.--symbol-filter=โ only show symbols that match (partially) with this filter.-U,--hide-unresolvedโ only display entries resolved to a symbol. no ghosts allowed ๐ป--parallelismโ only consider these parallelism levels. So like, parallelism level = the number of threads that actively run on CPUs at the time of sample. The flag accepts single number, comma-separated list, and ranges (for example:"1","7,8","1,64-128"). This is useful in understanding what a program is doing during sequential/low-parallelism phases as compared to high-parallelism phases. This option will affect the percentage of the overhead and latency columns. See--percentagefor more info. Also see the โCPU and latency overheadsโ section for more details. ๐ง--latencyโ show latency-centric profile rather than the default CPU-consumption-centric profile (requiresperf record --latencyflag). โ ๏ธ don't forget that flag bestie-s,--sort=โ sort histogram entries by given key(s) โ multiple keys can be specified in CSV format. Following sort keys are available:pid,comm,dso,symbol,parent,cpu,socket,srcline,weight,local_weight,cgroup_id,addr,comm_nodigit.
Each key has following meaning: ๐
comm: command (name) of the task which can be read via/proc/<pid>/commpid: command and tid of the tasktgid: command and tgid of the taskdso: name of library or module executed at the time of sampledso_size: size of library or module executed at the time of samplesymbol: name of function executed at the time of samplesymbol_size: size of function executed at the time of sampleparent: name of function matched to the parent regex filter. Unmatched entries are displayed as"[other]".cpu: cpu number the task ran at the time of samplesocket: processor socket number the task ran at the time of sampleparallelism: number of running threads at the time of samplesrcline: filename and line number executed at the time of sample. The DWARF debugging info must be provided.srcfile: file name of the source file of the samples. Requires dwarf information.weight: Event specific weight, e.g. memory latency or transaction abort cost. This is the global weight.local_weight: Local weight version of the weight above.cgroup_id: ID derived from cgroup namespace device and inode numbers.cgroup: cgroup pathname in the cgroupfs.transaction: Transaction abort flags.overhead: CPU overhead percentage of sample.latency: latency (wall-clock) overhead percentage of sample. See the โCPU and latency overheadsโ section for more details.overhead_sys: CPU overhead percentage of sample running in system modeoverhead_us: CPU overhead percentage of sample running in user modeoverhead_guest_sys: CPU overhead percentage of sample running in system mode on guest machineoverhead_guest_us: CPU overhead percentage of sample running in user mode on guest machinesample: Number of sampleperiod: Raw number of event count of sampletime: Separate the samples by time stamp with the resolution specified by--time-quantum(default100ms). Specify with overhead and before it.code_page_size: the code page size of sampled code address (ip)ins_lat: Instruction latency in core cycles. This is the global instruction latencylocal_ins_lat: Local instruction latency versionp_stage_cyc: On powerpc, this presents the number of cycles spent in a pipeline stage. And currently supported only on powerpc.addr: (Full) virtual address of the sampled instructionretire_lat: On X86, this reports pipeline stall of this instruction compared to the previous instruction in cycles. And currently supported only on X86simd: Flags describing a SIMD operation. The architecture type can be Armโs ASE (Advanced SIMD extension), SVE, SME. It provides an extra tag for predicate:"e"for empty predicate,"p"for partial predicate,"d"for predicate disabled, and"f"for full predicate.type: Data type of sample memory access.typeoff: Offset in the data type of sample memory access.symoff: Offset in the symbol.weight1: Average value of event specific weight (1st field ofweight_struct).weight2: Average value of event specific weight (2nd field ofweight_struct).weight3: Average value of event specific weight (3rd field ofweight_struct).comm_nodigit: same ascomm, with numbers replaced by"<N>"
By default, overhead, comm, dso and symbol keys are used. (i.e. --sort overhead,comm,dso,symbol).
If --branch-stack option is used, following sort keys are also available: ๐ฟ
dso_from: name of library or module branched fromdso_to: name of library or module branched tosymbol_from: name of function branched fromsymbol_to: name of function branched tosrcline_from: source file and line branched fromsrcline_to: source file and line branched tomispredict:"N"for predicted branch,"Y"for mispredicted branchin_tx: branch in TSX transactionabort: TSX transaction abort.cycles: Cycles in basic block
And default sort keys are changed to comm, dso_from, symbol_from, dso_to and symbol_to, see '--branch-stack'.
When the sort key symbol is specified, columns "IPC" and "IPC Coverage" are enabled automatically. Column "IPC" reports the average IPC per function and column "IPC coverage" reports the percentage of instructions with sampled IPC in this function. IPC means Instruction Per Cycle. If it's low, it indicates there may be a performance bottleneck when the function is executed, such as a memory access bottleneck. If a function has high overhead and low IPC, it's worth further analyzing it to optimize its performance. ๐ฅ
If the --mem-mode option is used, the following sort keys are also available (incompatible with --branch-stack): symbol_daddr, dso_daddr, locked, tlb, mem, snoop, dcacheline, blocked.
symbol_daddr: name of data symbol being executed on at the time of sampledso_daddr: name of library or module containing the data being executed on at the time of the samplelocked: whether the bus was locked at the time of the sampletlb: type of tlb access for the data at the time of the samplemem: type of memory access for the data at the time of the samplesnoop: type of snoop (if any) for the data at the time of the sampledcacheline: the cacheline the data address is on at the time of the samplephys_daddr: physical address of data being executed on at the time of sampledata_page_size: the data page size of data being executed on at the time of sampleblocked: reason of blocked load access for the data at the time of the sample
And the default sort keys are changed to local_weight, mem, sym, dso, symbol_daddr, dso_daddr, snoop, tlb, locked, blocked, local_ins_lat, see '--mem-mode'.
If the data file has tracepoint event(s), following (dynamic) sort keys are also available: trace, trace_fields, [<event>.]<field>[/raw] ๐ฆ
trace: pretty printed trace output in a single columntrace_fields: fields in tracepoints in separate columns<field name>: optional event and field name for a specific field
The last form consists of event and field names. If event name is omitted, it searches all events for matching field name. The matched field will be shown only for the event has the field. The event name supports substring match so user doesn't need to specify full subsystem and event name everytime. For example, 'sched:sched_switch' event can be shortened to 'switch' as long as it's not ambiguous. Also event can be specified by its index (starting from 1) preceded by the '%'. So '%1' is the first event, '%2' is the second, and so on. ๐ค
The field name can have '/raw' suffix which disables pretty printing and shows raw field value like hex numbers. The --raw-trace option has the same effect for all dynamic sort keys. โจ
Quick side note before we keep going: the default sort keys get swapped over to trace if literally every event in the data file is a tracepoint. ๐
-F,--fields=โ pick your output fields, bestie โ and yeah, you can specify multiple keys in CSV format. Here's the whole menu of them:overhead,latency,overhead_sys,overhead_us,overhead_children,sample,period,weight1,weight2,weight3,ins_lat,p_stage_cycandretire_lat. The last 3 names are aliases for the corresponding weights. When you use the weight fields, they show you the average value of the weight. โจ It can also contain any sort key(s), which is lowkey iconic of it. By default, every sort key you didn't specify in-Fgets appended automatically. (automatic queen behavior ๐ ) Oh, and if your keys start with a+prefix, it appends the specified field(s) to the default field order. Like:perf report -F +period,sample. ๐ซถ-p,--parent=<regex>โ a regex filter to identify the parent. The parent is a caller of this function, and it gets searched through the callchain, so this one requires callchain information to be recorded. The pattern is in extended regex format and defaults to"^sys_|^do_page_fault"โ see--sort parent. ๐-x,--exclude-otherโ only display entries with parent-match. nothing else makes the cut, sorry not sorry ๐-w,--column-widths=<width[,width...]>โ force each column width to the provided list, for large-terminal readability.0means no limit (that's the default behavior). ๐-t,--field-separator=โ use a special separator character and don't pad with spaces, replacing all occurrences of this separator in symbol names (and other output) with a.character โ that way it's the only non-valid separator. periodt. ๐-D,--dump-raw-traceโ dump raw trace in ASCII. raw and unfiltered, main character energy ๐--disable-orderโ disable raw trace ordering.-g,--call-graph=โ display call chains. The full shape is:
<print_type,threshold[,print_limit],order,sort_key[,branch],value>
Note that the ordering is not fixed, so any parameter can be given in an arbitrary order. One exception: the print_limit, which should be preceded by threshold. โ ๏ธ
print_type can be either:
flat: single column, linear exposure of call chains.graph: use a graph tree, displaying absolute overhead rates. (default)fractal: likegraph, but displays relative rates. Each branch of the tree is considered as a new profiled object.folded: call chains are displayed in a line, separated by semicolons.none: disable call chain display.
threshold is a percentage value which specifies a minimum percent to be included in the output call graph. Default is 0.5 (%). ๐
print_limit is only applied when the stdio interface is used. It's there to limit the number of call graph entries in a single hist entry. Note that it needs to be given after threshold (but not necessarily consecutive). Default is 0 (unlimited).
order can be either:
callee: callee based call graph.caller: inverted caller based call graph.
Default is 'caller' when --children is used, otherwise 'callee'.
sort_key can be:
function: compare on functions (default)address: compare on individual code addressessrcline: compare on source filename and line number
branch can be:
branch: include last branch information in callgraph when available. Usually more convenient to use--branch-historyfor this.
value can be:
percent: display overhead percent (default)period: display event periodcount: display event count
--childrenโ accumulate the callchain of children to the parent entry so that they can then show up in the output. The output will have a new "Children" column and will be sorted on the data. It requires that callchains are recorded. See the 'Overhead calculation' section for more details. Enabled by default โ disable it with--no-children. ๐ถ--max-stackโ set the stack depth limit when parsing the callchain; anything beyond the specified depth will be ignored. It's a trade-off between information loss and faster processing, especially for workloads that can have a very long callchain stack. Note that when you're using the--itraceoption, the synthesized callchain size will override this value if the synthesized callchain size is bigger. ๐ฅ
Default: 127
-G,--invertedโ alias for inverted caller based call graph. same vibe, shorter name ๐ซ--ignore-callees=<regex>โ ignore callees of the function(s) matching the given regex. This has the effect of collecting the callers of each such function into one place in the call-graph tree. ๐ซ--pretty=<key>โ pretty printing style. key:normal,raw.--stdioโ use the stdio interface.--stdio-colorโalways,neverorauto, letting you configure color output via the command line, in addition to via"color.ui".perfconfig. Use--stdio-color alwaysto generate color even when you're redirecting to a pipe or a file. Using just--stdio-coloris equivalent to usingalways. ๐--tuiโ use the TUI interface, which is integrated with annotate and lets you zoom into DSOs or threads, among other features. Using--tuirequires a tty โ if one isn't present, like when piping to other commands, the stdio interface is used. ๐ฅ๏ธ--gtkโ use the GTK2 interface.-k,--vmlinux=<file>โ vmlinux pathname.--ignore-vmlinuxโ ignore vmlinux files.--kallsyms=<file>โ kallsyms pathname.-m,--modulesโ load module symbols. WARNING: this should only be used with-kand a LIVE kernel. ๐ฅ (respect the caps, bestie โ this one bites)-f,--forceโ don't do ownership validation.--symfs=<directory[,layout]>โ look for files with symbols relative to this directory. The optionallayoutcan behierarchy(default, matches full path) orflat(only matches base name). Super useful when debug files are stored in a flat directory structure. ๐๏ธ-C,--cpuโ only report samples for the list of CPUs provided. Multiple CPUs can be provided as a comma-separated list with no space:0,1. Ranges of CPUs are specified with-:0-2. Default is to report samples on all CPUs.-M,--disassembler-style=โ set disassembler style for objdump.--sourceโ interleave source code with assembly code. Enabled by default โ disable it with--no-source. ๐ป--asm-rawโ show raw instruction encoding of assembly instructions.--show-total-periodโ show a column with the sum of periods.-I,--show-infoโ display extended information about theperf.datafile. This adds information which may be very large and thus may clutter the display. It currently includes: cpu and numa topology of the host system. ๐ (it's a lot, she warns you)-b,--branch-stackโ use the addresses of sampled taken branches instead of the instruction address to build the histograms. To generate meaningful output, theperf.datafile must have been obtained usingperf record -borperf record --branch-filter xxx, wherexxxis a branch filter option.perf reportis able to auto-detect whether aperf.datafile contains branch stacks and it will automatically switch to the branch view mode โ unless--no-branch-stackis used. ๐ฟ--branch-historyโ add the addresses of sampled taken branches to the callstack. This lets you examine the path the program took to each sample. The data collection must have used-b(or-j) and-g. ๐
Also show with some branch flags, which can be:
Predicted: display the average percentage of predicated branches. (predicated number / total number)Abort: display the number of tsx aborted branches.Cycles: cycles in basic block.iterations: display the average number of iterations in callchain list.
--addr2line=<path>โ path to theaddr2linebinary.--objdump=<path>โ path to theobjdumpbinary.--prefix=PREFIX,--prefix-strip=Nโ remove the firstNentries from source file path names in executables and addPREFIX. This lets you display source code compiled on systems with a different file system layout. ๐ง--groupโ show event group information together. It forces group output even if there are no groups defined in the data file. ๐ฏ--group-sort-idxโ sort the output by the event at the indexnin the group. Ifnis invalid, sort by the first event. It can support multiple groups with different amounts of events. WARNING: this should be used on grouped events. โ ๏ธ--demangleโ demangle symbol names to human readable form. It's enabled by default โ disable it with--no-demangle. โจ--demangle-kernelโ demangle kernel symbol names to human readable form (for C++ kernels).--mem-modeโ use the data addresses of samples in addition to instruction addresses to build the histograms. To generate meaningful output, theperf.datafile must have been obtained usingperf record -d -Wand using a special event-e cpu/mem-loads/por-e cpu/mem-stores/p. Seeperf memfor simpler access. ๐ง--percent-limitโ do not show entries which have an overhead under that percent. (Default:0). Note that this option also sets the percent limit (threshold) of callchains. However, the default value of the callchain threshold is different than the default value of hist entries. Please see the--call-graphoption for details. ๐--percentageโ determine how to display the CPU and latency overhead percentage of filtered entries. Filters can be applied by--comms,--dsos,--symbolsand/or--parallelismoptions, and by Zoom operations on the TUI (thread, dso, etc). ๐๏ธ
"relative" means it's relative to filtered entries only, so that the sum of shown entries will always be 100%. "absolute" means it retains the original value before and after the filter is applied.
--headerโ show header information in theperf.datafile. This includes various info like hostname, OS and perf version, cpu/mem info, perf command line, event list and so on. Currently only--stdiooutput supports this feature. ๐--header-onlyโ show only theperf.dataheader (forces--stdio). ๐--timeโ bestie, this one says only analyze samples inside the time window you give it: <start>,<stop>. Times are inseconds.nanosecondsformat. If the start isnโt given (i.e. the time string looks like,x.y), analysis starts at the beginning of the file. If the stop time isnโt given (i.e. the time string looks likex.y,), analysis goes to the end of the file. You can separate multiple ranges with spaces, which means you gotta quote the argument, e.g.--time "1234.567,1234.789 1235,"
It also supports time percent with multiple time ranges. Time string is 'a%/n,b%/m,...' or 'a%-b%,c%-%d,...'.
For example, select the second 10% time slice:
perf report --time 10%/2
Select from 0% to 10% time slice:
perf report --time 0%-10%
Select the first and second 10% time slices:
perf report --time 10%/1,10%/2
Select from 0% to 10% and 30% to 40% slices:
perf report --time 0%-10%,30%-40%
--switch-onEVENT_NAME โ only consider events after this event is found. This is lowkey interesting when you wanna measure a workload only after some initialization phase is over โ i.e. insert aperf probeat that point and then use this option with that probe. โจ--switch-offEVENT_NAME โ stop considering events after this event is found.--show-on-off-eventsโ show the--switch-on/--switch-offevents too. This has no effect inperf reportright now, but probably weโll make the default not show the switch-on/off events on the--groupmode and, if there is only one event besides the off/on ones, go straight to the histogram browser, just likeperf reportwith no events explicitly specified does.--itraceโ options for decoding instruction tracing data. The options are:iโ synthesize instructions eventsyโ synthesize cycles eventsbโ synthesize branches eventscโ synthesize branches events (calls only)rโ synthesize branches events (returns only)xโ synthesize transactions eventswโ synthesize ptwrite eventspโ synthesize power events (incl. PSB events for Intel PT)oโ synthesize other events recorded due to the use of aux-output (refer toperf record)Iโ synthesize interrupt or similar (asynchronous) events (e.g. Intel PT Event Trace)eโ synthesize error eventsdโ create a debug logfโ synthesize first level cache eventsmโ synthesize last level cache eventsMโ synthesize memory eventstโ synthesize TLB eventsaโ synthesize remote access eventsgโ synthesize a call chain (use withiorx)Gโ synthesize a call chain on existing event recordslโ synthesize last branch entries (use withiorx)Lโ synthesize last branch entries on existing event recordssโ skip initial number of eventsqโ quicker (less detailed) decodingAโ approximate IPCZโ prefer to ignore timestamps (so-called "timeless" decoding)Tโ use the timestamp trace as kernel time
The default is all events i.e. the same as --itrace=iybxwpe, except for perf script where it is --itrace=ce.
In addition, the period (default 100000, except for perf script where it is 1) for instructions events can be specified in units of:
iโ instructionstโ ticksmsโ millisecondsusโ microsecondsnsโ nanoseconds (default)
Also the call chain size (default 16, max. 1024) for instructions or transactions events can be specified.
Also the number of last branch entries (default 64, max. 1024) for instructions or transactions events can be specified.
Similar to options g and l, size may also be specified for options G and L. On x86, note that G and L work poorly when data has been recorded with large PEBS. Refer linkperf:perf-intel-pt[1] man page for details.
It is also possible to skip events generated (instructions, branches, transactions, ptwrite, power) at the beginning. This is useful to ignore initialization code.
--itrace=i0nss1000000
skips the first million instructions.
The 'e' option may be followed by flags which affect what errors will or will not be reported. Each flag must be preceded by either '+' or '-'. The flags are:
oโ overflowlโ trace data lost
If supported, the 'd' option may be followed by flags which affect what debug messages will or will not be logged. Each flag must be preceded by either '+' or '-'. The flags are:
aโ all perf eventseโ output only on errors (size configurable - seelinkperf:perf-config[1])oโ output to stdout
If supported, the 'q' option may be repeated to increase the effect.
To disable decoding entirely, use --no-itrace.
--full-source-pathโ show the full path for source files forsrclineoutput. ๐--show-ref-call-graphโ when multiple events are sampled, it may not be needed to collect callgraphs for all of them. The sample sites are usually nearby, and itโs enough to collect the callgraphs on a reference event. So the user can use"call-graph=no"event modifier to disable callgraph for other events and reduce the overhead. However,perf reportcannot show callgraphs for the event which disabled the callgraph. This option extendsperf reportto show reference callgraphs, which were collected by the reference event, in no-callgraph events.--stitch-lbrโ show callgraph with stitched LBRs, which may have more complete callgraph. Theperf.datafile must have been obtained usingperf record --call-graph lbr. Disabled by default. In common cases with call stack overflows, it can recreate better call stacks than the default LBR call stack output. But this approach is not foolproof. There can be cases where it creates incorrect call stacks from incorrect matches. The known limitations include exception handing such assetjmp/longjmpwill have calls/returns not match.--socket-filterโ only report the samples on the processor socket that match with this filter.--samples=Nโ saveNindividual samples for each histogram entry to show context in theperf reportTUI browser.--raw-traceโ when displaying traceevent output, do not useprint fmtor plugins.-H,--hierarchyโ enable hierarchical output. In the hierarchy mode, each sort key groups samples based on the criteria and then sub-divides it using the lower level sort key. ๐
For example, in normal output:
perf report -s dso,sym
# Overhead Shared Object Symbol
50.00% [kernel.kallsyms] [k] kfunc1
20.00% perf [.] foo
15.00% [kernel.kallsyms] [k] kfunc2
10.00% perf [.] bar
5.00% libc.so [.] libcall
In hierarchy output:
perf report -s dso,sym --hierarchy
# Overhead Shared Object / Symbol
65.00% [kernel.kallsyms]
50.00% [k] kfunc1
15.00% [k] kfunc2
30.00% perf
20.00% [.] foo
10.00% [.] bar
5.00% libc.so
5.00% [.] libcall
--inlineโ if a callgraph address belongs to an inlined function, the inline stack will be printed. Each entry is function name orfile/line. Enabled by default, disable with--no-inline. ๐--mmapsโ show--tasksoutput plus mmap information in a format similar to/proc/<PID>/maps.
Please note that not all mmaps are stored; options affecting which ones are stored include 'perf record --data', for instance.
--nsโ show time stamps in nanoseconds.--statsโ display overall events statistics without any further processing. (Like the one at the end of theperf report -Dcommand.)--tasksโ display monitored tasks stored in perf data. Displayingpid/tid/ppidplus the command string aligned to distinguish parent and child tasks.--percent-typeโ set annotation percent type from the following choices:global-period,local-period,global-hits,local-hits.
The local/global keywords set if the percentage is computed in the scope of the function (local) or the whole data (global). The period/hits keywords set the base the percentage is computed on โ the samples period or the number of samples (hits).
--time-quantumโ configure time quantum for time sort key. Default100ms. Acceptss,us,ms,nsunits. ๐ฐ๏ธ--total-cyclesโ when--total-cyclesis specified, it supports sorting for all blocks bySampled Cycles%. This is useful to concentrate on the globally hottest blocks. In output, there are some new columns:'Sampled Cycles%'โ block sampled cycles aggregation / total sampled cycles'Sampled Cycles'โ block sampled cycles aggregation'Avg Cycles%'โ block average sampled cycles / sum of total block average sampled cycles'Avg Cycles'โ block average sampled cycles'Branch Counter'โ block branch counter histogram (with-vshowing the number)
--skip-emptyโ do not print0results in the--statoutput. ๐ซถ
๐ CPU AND LATENCY OVERHEADS ๐
Okay bestie, buckle up, because there are literally two notions of time and they are not the same vibe: wall-clock time and CPU time. For a single-threaded program, or a program running on a single-core machine, these notions are the same. But for a multi-threaded/multi-process program running on a multi-core machine, these notions are significantly different. Each second of wall-clock time we have number-of-cores seconds of CPU time. Perf can measure overhead for both of these times (shown in overhead and latency columns for CPU and wall-clock time correspondingly).
Optimizing CPU overhead is useful to improve throughput, while optimizing latency overhead is useful to improve latency. Itโs important to understand which one is useful in a concrete situation at hand. For example, the former may be useful to improve max throughput of a CI build server that runs on 100% CPU utilization, while the latter may be useful to improve user-perceived latency of a single interactive program build. These overheads may be significantly different in some cases. For example, consider a program that executes function foo for 9 seconds with 1 thread, and then executes function bar for 1 second with 128 threads (consumes 128 seconds of CPU time). The CPU overhead is: foo - 6.6%, bar - 93.4%. While the latency overhead is: foo - 90%, bar - 10%. If we try to optimize running time of the program looking at the (wrong in this case) CPU overhead, we would concentrate on the function bar, but it can yield only 10% running time improvement at best.
By default, perf shows only CPU overhead. To show latency overhead, use perf record --latency and perf report:
Overhead Latency Command
93.88% 25.79% cc1
1.90% 39.87% gzip
0.99% 10.16% dpkg-deb
0.57% 1.00% as
0.40% 0.46% sh
To sort by latency overhead, use perf report --latency:
Latency Overhead Command
39.87% 1.90% gzip
25.79% 93.88% cc1
10.16% 0.99% dpkg-deb
4.17% 0.29% git
2.81% 0.11% objtool
To get insight into the difference between the overheads, you may check parallelization histogram with --sort=latency,parallelism,comm,symbol --hierarchy flags. It shows fraction of (wall-clock) time the workload utilizes different numbers of cores (Parallelism column). For example, in the following case the workload utilizes only 1 core most of the time, but also has some highly-parallel phases, which explains significant difference between CPU and wall-clock overheads:
Latency Overhead Parallelism / Command / Symbol
+ 56.98% 2.29% 1
+ 16.94% 1.36% 2
+ 4.00% 20.13% 125
+ 3.66% 18.25% 124
+ 3.48% 17.66% 126
+ 3.26% 0.39% 3
+ 2.61% 12.93% 123
By expanding corresponding lines, you may see what commands/functions run at the given parallelism level:
Latency Overhead Parallelism / Command / Symbol
- 56.98% 2.29% 1
32.80% 1.32% gzip
4.46% 0.18% cc1
2.81% 0.11% objtool
2.43% 0.10% dpkg-source
2.22% 0.09% ld
2.10% 0.08% dpkg-genchanges
To see the normal function-level profile for particular parallelism levels (number of threads actively running on CPUs), you may use --parallelism filter. For example, to see the profile only for low parallelism phases of a workload use --latency --parallelism=1-2 flags.
๐งฎ OVERHEAD CALCULATION ๐งฎ
The CPU overhead can be shown in two columns as Children and Self when perf collects callchains (and corresponding Wall columns for wall-clock overhead). The Self overhead is simply calculated by adding all period values of the entry - usually a function (symbol). This is the value that perf shows traditionally and sum of all the Self overhead values should be 100%.
The Children overhead is calculated by adding all period values of the child functions so that it can show the total overhead of the higher level functions even if they donโt directly execute much. Children here means functions that are called from another (parent) function.
It might be confusing that the sum of all the Children overhead values exceeds 100% since each of them is already an accumulation of Self overhead of its child functions. But with this enabled, users can find which function has the most overhead even if samples are spread over the children.
Consider the following example; there are three functions like below.
void foo(void) {
/* do something */
}
void bar(void) {
/* do something */
foo();
}
int main(void) {
bar()
return 0;
}
In this case foo is a child of bar, and bar is an immediate child of main so foo also is a child of main. In other words, main is a parent of foo and bar, and bar is a parent of foo.
Suppose all samples are recorded in foo and bar only. When itโs recorded with callchains the output will show something like below in the usual (Self-overhead-only) output of perf report:
Overhead Symbol
........ .....................
60.00% foo
|
--- foo
bar
main
__libc_start_main
40.00% bar
|
--- bar
main
__libc_start_main
When the --children option is enabled, the Self overhead values of child functions (i.e. foo and bar) are added to the parents to calculate the Children overhead. In this case the report could be displayed as:
Children Self Symbol
........ ........ ....................
100.00% 0.00% __libc_start_main
|
--- __libc_start_main
100.00% 0.00% main
|
--- main
__libc_start_main
100.00% 40.00% bar
|
--- bar
main
__libc_start_main
60.00% 60.00% foo
|
--- foo
bar
main
__libc_start_main
In the above output, the Self overhead of foo (60%) was added to the Children overhead of bar, main and __libc_start_main. Likewise, the Self overhead of bar (40%) was added to the Children overhead of main and __libc_start_main.
So __libc_start_main and main are shown first since they have same (100%) Children overhead (even though they have zero Self overhead) and they are the parents of foo and bar.
Since v3.16 the Children overhead is shown by default and the output is sorted by its values. The Children overhead is disabled by specifying --no-children option on the command line or by adding report.children = false or top.children = false in the perf config file.
๐ SEE ALSO ๐
Go give these icons a read next, bestie:
Thatโs the whole vibe check, bestie. This was perf, dated 10/31/2026, page PERF-REPORT(1) โ signing off with a sparkle ๐
โจ๐ซถ
๐ฆ where this page comes from
- arch rolling: perf 7.3.1-1 ยท GPL-2.0-only
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms