6 perf-report - Read perf.data (created by perf record) and display the profile
11 'perf report' [-i <file> | --input=file]
15 This command displays the performance counter profile information recorded
22 Input file name. (default: perf.data unless stdin is a fifo)
26 Be more verbose. (show symbol address, etc)
30 Show the number of samples for each symbol
32 --showcpuutilization::
33 Show sample percentage for different cpu modes.
37 Show per-thread event counters
40 Only consider symbols in these comms. CSV that understands
41 file://filename entries. This option will affect the percentage of
42 the overhead column. See --percentage for more info.
44 Only show events for given process ID (comma separated list).
47 Only show events for given thread ID (comma separated list).
50 Only consider symbols in these dsos. CSV that understands
51 file://filename entries. This option will affect the percentage of
52 the overhead column. See --percentage for more info.
55 Only consider these symbols. CSV that understands
56 file://filename entries. This option will affect the percentage of
57 the overhead column. See --percentage for more info.
60 Only show symbols that match (partially) with this filter.
64 Only display entries resolved to a symbol.
68 Sort histogram entries by given key(s) - multiple keys can be specified
69 in CSV format. Following sort keys are available:
70 pid, comm, dso, symbol, parent, cpu, srcline, weight, local_weight.
72 Each key has following meaning:
74 - comm: command (name) of the task which can be read via /proc/<pid>/comm
75 - pid: command and tid of the task
76 - dso: name of library or module executed at the time of sample
77 - symbol: name of function executed at the time of sample
78 - parent: name of function matched to the parent regex filter. Unmatched
79 entries are displayed as "[other]".
80 - cpu: cpu number the task ran at the time of sample
81 - srcline: filename and line number executed at the time of sample. The
82 DWARF debugging info must be provided.
83 - weight: Event specific weight, e.g. memory latency or transaction
84 abort cost. This is the global weight.
85 - local_weight: Local weight version of the weight above.
86 - transaction: Transaction abort flags.
87 - overhead: Overhead percentage of sample
88 - overhead_sys: Overhead percentage of sample running in system mode
89 - overhead_us: Overhead percentage of sample running in user mode
90 - overhead_guest_sys: Overhead percentage of sample running in system mode
92 - overhead_guest_us: Overhead percentage of sample running in user mode on
94 - sample: Number of sample
95 - period: Raw number of event count of sample
97 By default, comm, dso and symbol keys are used.
98 (i.e. --sort comm,dso,symbol)
100 If --branch-stack option is used, following sort keys are also
102 dso_from, dso_to, symbol_from, symbol_to, mispredict.
104 - dso_from: name of library or module branched from
105 - dso_to: name of library or module branched to
106 - symbol_from: name of function branched from
107 - symbol_to: name of function branched to
108 - mispredict: "N" for predicted branch, "Y" for mispredicted branch
109 - in_tx: branch in TSX transaction
110 - abort: TSX transaction abort.
112 And default sort keys are changed to comm, dso_from, symbol_from, dso_to
113 and symbol_to, see '--branch-stack'.
117 Specify output field - multiple keys can be specified in CSV format.
118 Following fields are available:
119 overhead, overhead_sys, overhead_us, overhead_children, sample and period.
120 Also it can contain any sort key(s).
122 By default, every sort keys not specified in -F will be appended
125 If --mem-mode option is used, following sort keys are also available
126 (incompatible with --branch-stack):
127 symbol_daddr, dso_daddr, locked, tlb, mem, snoop, dcacheline.
129 - symbol_daddr: name of data symbol being executed on at the time of sample
130 - dso_daddr: name of library or module containing the data being executed
131 on at the time of sample
132 - locked: whether the bus was locked at the time of sample
133 - tlb: type of tlb access for the data at the time of sample
134 - mem: type of memory access for the data at the time of sample
135 - snoop: type of snoop (if any) for the data at the time of sample
136 - dcacheline: the cacheline the data address is on at the time of sample
138 And default sort keys are changed to local_weight, mem, sym, dso,
139 symbol_daddr, dso_daddr, snoop, tlb, locked, see '--mem-mode'.
143 A regex filter to identify parent. The parent is a caller of this
144 function and searched through the callchain, thus it requires callchain
145 information recorded. The pattern is in the exteneded regex format and
146 defaults to "\^sys_|^do_page_fault", see '--sort parent'.
150 Only display entries with parent-match.
153 --column-widths=<width[,width...]>::
154 Force each column width to the provided list, for large terminal
155 readability. 0 means no limit (default behavior).
159 Use a special separator character and don't pad with spaces, replacing
160 all occurrences of this separator in symbol names (and other output)
161 with a '.' character, that thus it's the only non valid separator.
165 Dump raw trace in ASCII.
167 -g [type,min[,limit],order[,key][,branch]]::
169 Display call chains using type, min percent threshold, optional print
172 - flat: single column, linear exposure of call chains.
173 - graph: use a graph tree, displaying absolute overhead rates.
174 - fractal: like graph, but displays relative rates. Each branch of
175 the tree is considered as a new profiled object. +
178 - callee: callee based call graph.
179 - caller: inverted caller based call graph.
182 - function: compare on functions
183 - address: compare on individual code addresses
186 - branch: include last branch information in callgraph
187 when available. Usually more convenient to use --branch-history
190 Default: fractal,0.5,callee,function.
193 Accumulate callchain of children to parent entry so that then can
194 show up in the output. The output will have a new "Children" column
195 and will be sorted on the data. It requires callchains are recorded.
196 See the `overhead calculation' section for more details.
199 Set the stack depth limit when parsing the callchain, anything
200 beyond the specified depth will be ignored. This is a trade-off
201 between information loss and faster processing especially for
202 workloads that can have a very long callchain stack.
208 alias for inverted caller based call graph.
210 --ignore-callees=<regex>::
211 Ignore callees of the function(s) matching the given regex.
212 This has the effect of collecting the callers of each such
213 function into one place in the call-graph tree.
216 Pretty printing style. key: normal, raw
218 --stdio:: Use the stdio interface.
220 --tui:: Use the TUI interface, that is integrated with annotate and allows
221 zooming into DSOs or threads, among other features. Use of --tui
222 requires a tty, if one is not present, as when piping to other
223 commands, the stdio interface is used.
225 --gtk:: Use the GTK2 interface.
236 Load module symbols. WARNING: This should only be used with -k and
241 Don't complain, do it.
243 --symfs=<directory>::
244 Look for files with symbols relative to this directory.
247 --cpu:: Only report samples for the list of CPUs provided. Multiple CPUs can
248 be provided as a comma-separated list with no space: 0,1. Ranges of
249 CPUs are specified with -: 0-2. Default is to report samples on all
253 --disassembler-style=:: Set disassembler style for objdump.
256 Interleave source code with assembly code. Enabled by default,
257 disable with --no-source.
260 Show raw instruction encoding of assembly instructions.
262 --show-total-period:: Show a column with the sum of periods.
266 Display extended information about the perf.data file. This adds
267 information which may be very large and thus may clutter the display.
268 It currently includes: cpu and numa topology of the host system.
272 Use the addresses of sampled taken branches instead of the instruction
273 address to build the histograms. To generate meaningful output, the
274 perf.data file must have been obtained using perf record -b or
275 perf record --branch-filter xxx where xxx is a branch filter option.
276 perf report is able to auto-detect whether a perf.data file contains
277 branch stacks and it will automatically switch to the branch view mode,
278 unless --no-branch-stack is used.
281 Add the addresses of sampled taken branches to the callstack.
282 This allows to examine the path the program took to each sample.
283 The data collection must have used -b (or -j) and -g.
286 Path to objdump binary.
289 Show event group information together.
292 Demangle symbol names to human readable form. It's enabled by default,
293 disable with --no-demangle.
296 Demangle kernel symbol names to human readable form (for C++ kernels).
299 Use the data addresses of samples in addition to instruction addresses
300 to build the histograms. To generate meaningful output, the perf.data
301 file must have been obtained using perf record -d -W and using a
302 special event -e cpu/mem-loads/ or -e cpu/mem-stores/. See
303 'perf mem' for simpler access.
306 Do not show entries which have an overhead under that percent.
310 Determine how to display the overhead percentage of filtered entries.
311 Filters can be applied by --comms, --dsos and/or --symbols options and
312 Zoom operations on the TUI (thread, dso, etc).
314 "relative" means it's relative to filtered entries only so that the
315 sum of shown entries will be always 100%. "absolute" means it retains
316 the original value before and after the filter is applied.
319 Show header information in the perf.data file. This includes
320 various information like hostname, OS and perf version, cpu/mem
321 info, perf command line, event list and so on. Currently only
322 --stdio output supports this feature.
325 Show only perf.data header (forces --stdio).
328 Options for decoding instruction tracing data. The options are:
330 i synthesize instructions events
331 b synthesize branches events
332 c synthesize branches events (calls only)
333 r synthesize branches events (returns only)
334 x synthesize transactions events
335 e synthesize error events
337 g synthesize a call chain (use with i or x)
339 The default is all events i.e. the same as --itrace=ibxe
341 In addition, the period (default 100000) for instructions events
342 can be specified in units of:
348 ns nanoseconds (default)
350 Also the call chain size (default 16, max. 1024) for instructions or
351 transactions events can be specified.
353 To disable decoding entirely, use --no-itrace.
356 include::callchain-overhead-calculation.txt[]
360 linkperf:perf-stat[1], linkperf:perf-annotate[1]