1perf-report(1) 2============== 3 4NAME 5---- 6perf-report - Read perf.data (created by perf record) and display the profile 7 8SYNOPSIS 9-------- 10[verse] 11'perf report' [-i <file> | --input=file] 12 13DESCRIPTION 14----------- 15This command displays the performance counter profile information recorded 16via perf record. 17 18OPTIONS 19------- 20-i:: 21--input=:: 22 Input file name. (default: perf.data unless stdin is a fifo) 23 24-v:: 25--verbose:: 26 Be more verbose. (show symbol address, etc) 27 28-q:: 29--quiet:: 30 Do not show any message. (Suppress -v) 31 32-n:: 33--show-nr-samples:: 34 Show the number of samples for each symbol 35 36--show-cpu-utilization:: 37 Show sample percentage for different cpu modes. 38 39-T:: 40--threads:: 41 Show per-thread event counters. The input data file should be recorded 42 with -s option. 43-c:: 44--comms=:: 45 Only consider symbols in these comms. CSV that understands 46 file://filename entries. This option will affect the percentage of 47 the overhead column. See --percentage for more info. 48--pid=:: 49 Only show events for given process ID (comma separated list). 50 51--tid=:: 52 Only show events for given thread ID (comma separated list). 53-d:: 54--dsos=:: 55 Only consider symbols in these dsos. CSV that understands 56 file://filename entries. This option will affect the percentage of 57 the overhead column. See --percentage for more info. 58-S:: 59--symbols=:: 60 Only consider these symbols. CSV that understands 61 file://filename entries. This option will affect the percentage of 62 the overhead column. See --percentage for more info. 63 64--symbol-filter=:: 65 Only show symbols that match (partially) with this filter. 66 67-U:: 68--hide-unresolved:: 69 Only display entries resolved to a symbol. 70 71-s:: 72--sort=:: 73 Sort histogram entries by given key(s) - multiple keys can be specified 74 in CSV format. Following sort keys are available: 75 pid, comm, dso, symbol, parent, cpu, socket, srcline, weight, local_weight. 76 77 Each key has following meaning: 78 79 - comm: command (name) of the task which can be read via /proc/<pid>/comm 80 - pid: command and tid of the task 81 - dso: name of library or module executed at the time of sample 82 - symbol: name of function executed at the time of sample 83 - parent: name of function matched to the parent regex filter. Unmatched 84 entries are displayed as "[other]". 85 - cpu: cpu number the task ran at the time of sample 86 - socket: processor socket number the task ran at the time of sample 87 - srcline: filename and line number executed at the time of sample. The 88 DWARF debugging info must be provided. 89 - srcfile: file name of the source file of the same. Requires dwarf 90 information. 91 - weight: Event specific weight, e.g. memory latency or transaction 92 abort cost. This is the global weight. 93 - local_weight: Local weight version of the weight above. 94 - transaction: Transaction abort flags. 95 - overhead: Overhead percentage of sample 96 - overhead_sys: Overhead percentage of sample running in system mode 97 - overhead_us: Overhead percentage of sample running in user mode 98 - overhead_guest_sys: Overhead percentage of sample running in system mode 99 on guest machine 100 - overhead_guest_us: Overhead percentage of sample running in user mode on 101 guest machine 102 - sample: Number of sample 103 - period: Raw number of event count of sample 104 105 By default, comm, dso and symbol keys are used. 106 (i.e. --sort comm,dso,symbol) 107 108 If --branch-stack option is used, following sort keys are also 109 available: 110 111 - dso_from: name of library or module branched from 112 - dso_to: name of library or module branched to 113 - symbol_from: name of function branched from 114 - symbol_to: name of function branched to 115 - srcline_from: source file and line branched from 116 - srcline_to: source file and line branched to 117 - mispredict: "N" for predicted branch, "Y" for mispredicted branch 118 - in_tx: branch in TSX transaction 119 - abort: TSX transaction abort. 120 - cycles: Cycles in basic block 121 122 And default sort keys are changed to comm, dso_from, symbol_from, dso_to 123 and symbol_to, see '--branch-stack'. 124 125 If the --mem-mode option is used, the following sort keys are also available 126 (incompatible with --branch-stack): 127 symbol_daddr, dso_daddr, locked, tlb, mem, snoop, dcacheline. 128 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 the sample 132 - locked: whether the bus was locked at the time of the sample 133 - tlb: type of tlb access for the data at the time of the sample 134 - mem: type of memory access for the data at the time of the sample 135 - snoop: type of snoop (if any) for the data at the time of the sample 136 - dcacheline: the cacheline the data address is on at the time of the sample 137 138 And the default sort keys are changed to local_weight, mem, sym, dso, 139 symbol_daddr, dso_daddr, snoop, tlb, locked, see '--mem-mode'. 140 141 If the data file has tracepoint event(s), following (dynamic) sort keys 142 are also available: 143 trace, trace_fields, [<event>.]<field>[/raw] 144 145 - trace: pretty printed trace output in a single column 146 - trace_fields: fields in tracepoints in separate columns 147 - <field name>: optional event and field name for a specific field 148 149 The last form consists of event and field names. If event name is 150 omitted, it searches all events for matching field name. The matched 151 field will be shown only for the event has the field. The event name 152 supports substring match so user doesn't need to specify full subsystem 153 and event name everytime. For example, 'sched:sched_switch' event can 154 be shortened to 'switch' as long as it's not ambiguous. Also event can 155 be specified by its index (starting from 1) preceded by the '%'. 156 So '%1' is the first event, '%2' is the second, and so on. 157 158 The field name can have '/raw' suffix which disables pretty printing 159 and shows raw field value like hex numbers. The --raw-trace option 160 has the same effect for all dynamic sort keys. 161 162 The default sort keys are changed to 'trace' if all events in the data 163 file are tracepoint. 164 165-F:: 166--fields=:: 167 Specify output field - multiple keys can be specified in CSV format. 168 Following fields are available: 169 overhead, overhead_sys, overhead_us, overhead_children, sample and period. 170 Also it can contain any sort key(s). 171 172 By default, every sort keys not specified in -F will be appended 173 automatically. 174 175-p:: 176--parent=<regex>:: 177 A regex filter to identify parent. The parent is a caller of this 178 function and searched through the callchain, thus it requires callchain 179 information recorded. The pattern is in the exteneded regex format and 180 defaults to "\^sys_|^do_page_fault", see '--sort parent'. 181 182-x:: 183--exclude-other:: 184 Only display entries with parent-match. 185 186-w:: 187--column-widths=<width[,width...]>:: 188 Force each column width to the provided list, for large terminal 189 readability. 0 means no limit (default behavior). 190 191-t:: 192--field-separator=:: 193 Use a special separator character and don't pad with spaces, replacing 194 all occurrences of this separator in symbol names (and other output) 195 with a '.' character, that thus it's the only non valid separator. 196 197-D:: 198--dump-raw-trace:: 199 Dump raw trace in ASCII. 200 201-g:: 202--call-graph=<print_type,threshold[,print_limit],order,sort_key[,branch],value>:: 203 Display call chains using type, min percent threshold, print limit, 204 call order, sort key, optional branch and value. Note that ordering of 205 parameters is not fixed so any parement can be given in an arbitraty order. 206 One exception is the print_limit which should be preceded by threshold. 207 208 print_type can be either: 209 - flat: single column, linear exposure of call chains. 210 - graph: use a graph tree, displaying absolute overhead rates. (default) 211 - fractal: like graph, but displays relative rates. Each branch of 212 the tree is considered as a new profiled object. 213 - folded: call chains are displayed in a line, separated by semicolons 214 - none: disable call chain display. 215 216 threshold is a percentage value which specifies a minimum percent to be 217 included in the output call graph. Default is 0.5 (%). 218 219 print_limit is only applied when stdio interface is used. It's to limit 220 number of call graph entries in a single hist entry. Note that it needs 221 to be given after threshold (but not necessarily consecutive). 222 Default is 0 (unlimited). 223 224 order can be either: 225 - callee: callee based call graph. 226 - caller: inverted caller based call graph. 227 Default is 'caller' when --children is used, otherwise 'callee'. 228 229 sort_key can be: 230 - function: compare on functions (default) 231 - address: compare on individual code addresses 232 233 branch can be: 234 - branch: include last branch information in callgraph when available. 235 Usually more convenient to use --branch-history for this. 236 237 value can be: 238 - percent: diplay overhead percent (default) 239 - period: display event period 240 - count: display event count 241 242--children:: 243 Accumulate callchain of children to parent entry so that then can 244 show up in the output. The output will have a new "Children" column 245 and will be sorted on the data. It requires callchains are recorded. 246 See the `overhead calculation' section for more details. Enabled by 247 default, disable with --no-children. 248 249--max-stack:: 250 Set the stack depth limit when parsing the callchain, anything 251 beyond the specified depth will be ignored. This is a trade-off 252 between information loss and faster processing especially for 253 workloads that can have a very long callchain stack. 254 Note that when using the --itrace option the synthesized callchain size 255 will override this value if the synthesized callchain size is bigger. 256 257 Default: 127 258 259-G:: 260--inverted:: 261 alias for inverted caller based call graph. 262 263--ignore-callees=<regex>:: 264 Ignore callees of the function(s) matching the given regex. 265 This has the effect of collecting the callers of each such 266 function into one place in the call-graph tree. 267 268--pretty=<key>:: 269 Pretty printing style. key: normal, raw 270 271--stdio:: Use the stdio interface. 272 273--stdio-color:: 274 'always', 'never' or 'auto', allowing configuring color output 275 via the command line, in addition to via "color.ui" .perfconfig. 276 Use '--stdio-color always' to generate color even when redirecting 277 to a pipe or file. Using just '--stdio-color' is equivalent to 278 using 'always'. 279 280--tui:: Use the TUI interface, that is integrated with annotate and allows 281 zooming into DSOs or threads, among other features. Use of --tui 282 requires a tty, if one is not present, as when piping to other 283 commands, the stdio interface is used. 284 285--gtk:: Use the GTK2 interface. 286 287-k:: 288--vmlinux=<file>:: 289 vmlinux pathname 290 291--kallsyms=<file>:: 292 kallsyms pathname 293 294-m:: 295--modules:: 296 Load module symbols. WARNING: This should only be used with -k and 297 a LIVE kernel. 298 299-f:: 300--force:: 301 Don't do ownership validation. 302 303--symfs=<directory>:: 304 Look for files with symbols relative to this directory. 305 306-C:: 307--cpu:: Only report samples for the list of CPUs provided. Multiple CPUs can 308 be provided as a comma-separated list with no space: 0,1. Ranges of 309 CPUs are specified with -: 0-2. Default is to report samples on all 310 CPUs. 311 312-M:: 313--disassembler-style=:: Set disassembler style for objdump. 314 315--source:: 316 Interleave source code with assembly code. Enabled by default, 317 disable with --no-source. 318 319--asm-raw:: 320 Show raw instruction encoding of assembly instructions. 321 322--show-total-period:: Show a column with the sum of periods. 323 324-I:: 325--show-info:: 326 Display extended information about the perf.data file. This adds 327 information which may be very large and thus may clutter the display. 328 It currently includes: cpu and numa topology of the host system. 329 330-b:: 331--branch-stack:: 332 Use the addresses of sampled taken branches instead of the instruction 333 address to build the histograms. To generate meaningful output, the 334 perf.data file must have been obtained using perf record -b or 335 perf record --branch-filter xxx where xxx is a branch filter option. 336 perf report is able to auto-detect whether a perf.data file contains 337 branch stacks and it will automatically switch to the branch view mode, 338 unless --no-branch-stack is used. 339 340--branch-history:: 341 Add the addresses of sampled taken branches to the callstack. 342 This allows to examine the path the program took to each sample. 343 The data collection must have used -b (or -j) and -g. 344 345--objdump=<path>:: 346 Path to objdump binary. 347 348--group:: 349 Show event group information together. 350 351--demangle:: 352 Demangle symbol names to human readable form. It's enabled by default, 353 disable with --no-demangle. 354 355--demangle-kernel:: 356 Demangle kernel symbol names to human readable form (for C++ kernels). 357 358--mem-mode:: 359 Use the data addresses of samples in addition to instruction addresses 360 to build the histograms. To generate meaningful output, the perf.data 361 file must have been obtained using perf record -d -W and using a 362 special event -e cpu/mem-loads/ or -e cpu/mem-stores/. See 363 'perf mem' for simpler access. 364 365--percent-limit:: 366 Do not show entries which have an overhead under that percent. 367 (Default: 0). Note that this option also sets the percent limit (threshold) 368 of callchains. However the default value of callchain threshold is 369 different than the default value of hist entries. Please see the 370 --call-graph option for details. 371 372--percentage:: 373 Determine how to display the overhead percentage of filtered entries. 374 Filters can be applied by --comms, --dsos and/or --symbols options and 375 Zoom operations on the TUI (thread, dso, etc). 376 377 "relative" means it's relative to filtered entries only so that the 378 sum of shown entries will be always 100%. "absolute" means it retains 379 the original value before and after the filter is applied. 380 381--header:: 382 Show header information in the perf.data file. This includes 383 various information like hostname, OS and perf version, cpu/mem 384 info, perf command line, event list and so on. Currently only 385 --stdio output supports this feature. 386 387--header-only:: 388 Show only perf.data header (forces --stdio). 389 390--time:: 391 Only analyze samples within given time window: <start>,<stop>. Times 392 have the format seconds.microseconds. If start is not given (i.e., time 393 string is ',x.y') then analysis starts at the beginning of the file. If 394 stop time is not given (i.e, time string is 'x.y,') then analysis goes 395 to end of file. 396 397--itrace:: 398 Options for decoding instruction tracing data. The options are: 399 400include::itrace.txt[] 401 402 To disable decoding entirely, use --no-itrace. 403 404--full-source-path:: 405 Show the full path for source files for srcline output. 406 407--show-ref-call-graph:: 408 When multiple events are sampled, it may not be needed to collect 409 callgraphs for all of them. The sample sites are usually nearby, 410 and it's enough to collect the callgraphs on a reference event. 411 So user can use "call-graph=no" event modifier to disable callgraph 412 for other events to reduce the overhead. 413 However, perf report cannot show callgraphs for the event which 414 disable the callgraph. 415 This option extends the perf report to show reference callgraphs, 416 which collected by reference event, in no callgraph event. 417 418--socket-filter:: 419 Only report the samples on the processor socket that match with this filter 420 421--raw-trace:: 422 When displaying traceevent output, do not use print fmt or plugins. 423 424--hierarchy:: 425 Enable hierarchical output. 426 427include::callchain-overhead-calculation.txt[] 428 429SEE ALSO 430-------- 431linkperf:perf-stat[1], linkperf:perf-annotate[1] 432