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 warnings or messages. (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 and latency columns. 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 and latency columns. 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 and latency columns. 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--parallelism:: 72 Only consider these parallelism levels. Parallelism level is the number 73 of threads that actively run on CPUs at the time of sample. The flag 74 accepts single number, comma-separated list, and ranges (for example: 75 "1", "7,8", "1,64-128"). This is useful in understanding what a program 76 is doing during sequential/low-parallelism phases as compared to 77 high-parallelism phases. This option will affect the percentage of 78 the overhead and latency columns. See --percentage for more info. 79 Also see the `CPU and latency overheads' section for more details. 80 81--latency:: 82 Show latency-centric profile rather than the default 83 CPU-consumption-centric profile 84 (requires perf record --latency flag). 85 86-s:: 87--sort=:: 88 Sort histogram entries by given key(s) - multiple keys can be specified 89 in CSV format. Following sort keys are available: 90 pid, comm, dso, symbol, parent, cpu, socket, srcline, weight, 91 local_weight, cgroup_id, addr. 92 93 Each key has following meaning: 94 95 - comm: command (name) of the task which can be read via /proc/<pid>/comm 96 - pid: command and tid of the task 97 - dso: name of library or module executed at the time of sample 98 - dso_size: size of library or module executed at the time of sample 99 - symbol: name of function executed at the time of sample 100 - symbol_size: size of function executed at the time of sample 101 - parent: name of function matched to the parent regex filter. Unmatched 102 entries are displayed as "[other]". 103 - cpu: cpu number the task ran at the time of sample 104 - socket: processor socket number the task ran at the time of sample 105 - parallelism: number of running threads at the time of sample 106 - srcline: filename and line number executed at the time of sample. The 107 DWARF debugging info must be provided. 108 - srcfile: file name of the source file of the samples. Requires dwarf 109 information. 110 - weight: Event specific weight, e.g. memory latency or transaction 111 abort cost. This is the global weight. 112 - local_weight: Local weight version of the weight above. 113 - cgroup_id: ID derived from cgroup namespace device and inode numbers. 114 - cgroup: cgroup pathname in the cgroupfs. 115 - transaction: Transaction abort flags. 116 - overhead: CPU overhead percentage of sample. 117 - latency: latency (wall-clock) overhead percentage of sample. 118 See the `CPU and latency overheads' section for more details. 119 - overhead_sys: CPU overhead percentage of sample running in system mode 120 - overhead_us: CPU overhead percentage of sample running in user mode 121 - overhead_guest_sys: CPU overhead percentage of sample running in system mode 122 on guest machine 123 - overhead_guest_us: CPU overhead percentage of sample running in user mode on 124 guest machine 125 - sample: Number of sample 126 - period: Raw number of event count of sample 127 - time: Separate the samples by time stamp with the resolution specified by 128 --time-quantum (default 100ms). Specify with overhead and before it. 129 - code_page_size: the code page size of sampled code address (ip) 130 - ins_lat: Instruction latency in core cycles. This is the global instruction 131 latency 132 - local_ins_lat: Local instruction latency version 133 - p_stage_cyc: On powerpc, this presents the number of cycles spent in a 134 pipeline stage. And currently supported only on powerpc. 135 - addr: (Full) virtual address of the sampled instruction 136 - retire_lat: On X86, this reports pipeline stall of this instruction compared 137 to the previous instruction in cycles. And currently supported only on X86 138 - simd: Flags describing a SIMD operation. "e" for empty Arm SVE predicate. "p" for partial Arm SVE predicate 139 - type: Data type of sample memory access. 140 - typeoff: Offset in the data type of sample memory access. 141 - symoff: Offset in the symbol. 142 - weight1: Average value of event specific weight (1st field of weight_struct). 143 - weight2: Average value of event specific weight (2nd field of weight_struct). 144 - weight3: Average value of event specific weight (3rd field of weight_struct). 145 146 By default, overhead, comm, dso and symbol keys are used. 147 (i.e. --sort overhead,comm,dso,symbol). 148 149 If --branch-stack option is used, following sort keys are also 150 available: 151 152 - dso_from: name of library or module branched from 153 - dso_to: name of library or module branched to 154 - symbol_from: name of function branched from 155 - symbol_to: name of function branched to 156 - srcline_from: source file and line branched from 157 - srcline_to: source file and line branched to 158 - mispredict: "N" for predicted branch, "Y" for mispredicted branch 159 - in_tx: branch in TSX transaction 160 - abort: TSX transaction abort. 161 - cycles: Cycles in basic block 162 163 And default sort keys are changed to comm, dso_from, symbol_from, dso_to 164 and symbol_to, see '--branch-stack'. 165 166 When the sort key symbol is specified, columns "IPC" and "IPC Coverage" 167 are enabled automatically. Column "IPC" reports the average IPC per function 168 and column "IPC coverage" reports the percentage of instructions with 169 sampled IPC in this function. IPC means Instruction Per Cycle. If it's low, 170 it indicates there may be a performance bottleneck when the function is 171 executed, such as a memory access bottleneck. If a function has high overhead 172 and low IPC, it's worth further analyzing it to optimize its performance. 173 174 If the --mem-mode option is used, the following sort keys are also available 175 (incompatible with --branch-stack): 176 symbol_daddr, dso_daddr, locked, tlb, mem, snoop, dcacheline, blocked. 177 178 - symbol_daddr: name of data symbol being executed on at the time of sample 179 - dso_daddr: name of library or module containing the data being executed 180 on at the time of the sample 181 - locked: whether the bus was locked at the time of the sample 182 - tlb: type of tlb access for the data at the time of the sample 183 - mem: type of memory access for the data at the time of the sample 184 - snoop: type of snoop (if any) for the data at the time of the sample 185 - dcacheline: the cacheline the data address is on at the time of the sample 186 - phys_daddr: physical address of data being executed on at the time of sample 187 - data_page_size: the data page size of data being executed on at the time of sample 188 - blocked: reason of blocked load access for the data at the time of the sample 189 190 And the default sort keys are changed to local_weight, mem, sym, dso, 191 symbol_daddr, dso_daddr, snoop, tlb, locked, blocked, local_ins_lat, 192 see '--mem-mode'. 193 194 If the data file has tracepoint event(s), following (dynamic) sort keys 195 are also available: 196 trace, trace_fields, [<event>.]<field>[/raw] 197 198 - trace: pretty printed trace output in a single column 199 - trace_fields: fields in tracepoints in separate columns 200 - <field name>: optional event and field name for a specific field 201 202 The last form consists of event and field names. If event name is 203 omitted, it searches all events for matching field name. The matched 204 field will be shown only for the event has the field. The event name 205 supports substring match so user doesn't need to specify full subsystem 206 and event name everytime. For example, 'sched:sched_switch' event can 207 be shortened to 'switch' as long as it's not ambiguous. Also event can 208 be specified by its index (starting from 1) preceded by the '%'. 209 So '%1' is the first event, '%2' is the second, and so on. 210 211 The field name can have '/raw' suffix which disables pretty printing 212 and shows raw field value like hex numbers. The --raw-trace option 213 has the same effect for all dynamic sort keys. 214 215 The default sort keys are changed to 'trace' if all events in the data 216 file are tracepoint. 217 218-F:: 219--fields=:: 220 Specify output field - multiple keys can be specified in CSV format. 221 Following fields are available: 222 overhead, latency, overhead_sys, overhead_us, overhead_children, sample, 223 period, weight1, weight2, weight3, ins_lat, p_stage_cyc and retire_lat. 224 The last 3 names are alias for the corresponding weights. When the weight 225 fields are used, they will show the average value of the weight. 226 227 Also it can contain any sort key(s). 228 229 By default, every sort keys not specified in -F will be appended 230 automatically. 231 232 If the keys starts with a prefix '+', then it will append the specified 233 field(s) to the default field order. For example: perf report -F +period,sample. 234 235-p:: 236--parent=<regex>:: 237 A regex filter to identify parent. The parent is a caller of this 238 function and searched through the callchain, thus it requires callchain 239 information recorded. The pattern is in the extended regex format and 240 defaults to "\^sys_|^do_page_fault", see '--sort parent'. 241 242-x:: 243--exclude-other:: 244 Only display entries with parent-match. 245 246-w:: 247--column-widths=<width[,width...]>:: 248 Force each column width to the provided list, for large terminal 249 readability. 0 means no limit (default behavior). 250 251-t:: 252--field-separator=:: 253 Use a special separator character and don't pad with spaces, replacing 254 all occurrences of this separator in symbol names (and other output) 255 with a '.' character, that thus it's the only non valid separator. 256 257-D:: 258--dump-raw-trace:: 259 Dump raw trace in ASCII. 260 261--disable-order:: 262 Disable raw trace ordering. 263 264-g:: 265--call-graph=<print_type,threshold[,print_limit],order,sort_key[,branch],value>:: 266 Display call chains using type, min percent threshold, print limit, 267 call order, sort key, optional branch and value. Note that ordering 268 is not fixed so any parameter can be given in an arbitrary order. 269 One exception is the print_limit which should be preceded by threshold. 270 271 print_type can be either: 272 - flat: single column, linear exposure of call chains. 273 - graph: use a graph tree, displaying absolute overhead rates. (default) 274 - fractal: like graph, but displays relative rates. Each branch of 275 the tree is considered as a new profiled object. 276 - folded: call chains are displayed in a line, separated by semicolons 277 - none: disable call chain display. 278 279 threshold is a percentage value which specifies a minimum percent to be 280 included in the output call graph. Default is 0.5 (%). 281 282 print_limit is only applied when stdio interface is used. It's to limit 283 number of call graph entries in a single hist entry. Note that it needs 284 to be given after threshold (but not necessarily consecutive). 285 Default is 0 (unlimited). 286 287 order can be either: 288 - callee: callee based call graph. 289 - caller: inverted caller based call graph. 290 Default is 'caller' when --children is used, otherwise 'callee'. 291 292 sort_key can be: 293 - function: compare on functions (default) 294 - address: compare on individual code addresses 295 - srcline: compare on source filename and line number 296 297 branch can be: 298 - branch: include last branch information in callgraph when available. 299 Usually more convenient to use --branch-history for this. 300 301 value can be: 302 - percent: display overhead percent (default) 303 - period: display event period 304 - count: display event count 305 306--children:: 307 Accumulate callchain of children to parent entry so that then can 308 show up in the output. The output will have a new "Children" column 309 and will be sorted on the data. It requires callchains are recorded. 310 See the `Overhead calculation' section for more details. Enabled by 311 default, disable with --no-children. 312 313--max-stack:: 314 Set the stack depth limit when parsing the callchain, anything 315 beyond the specified depth will be ignored. This is a trade-off 316 between information loss and faster processing especially for 317 workloads that can have a very long callchain stack. 318 Note that when using the --itrace option the synthesized callchain size 319 will override this value if the synthesized callchain size is bigger. 320 321 Default: 127 322 323-G:: 324--inverted:: 325 alias for inverted caller based call graph. 326 327--ignore-callees=<regex>:: 328 Ignore callees of the function(s) matching the given regex. 329 This has the effect of collecting the callers of each such 330 function into one place in the call-graph tree. 331 332--pretty=<key>:: 333 Pretty printing style. key: normal, raw 334 335--stdio:: Use the stdio interface. 336 337--stdio-color:: 338 'always', 'never' or 'auto', allowing configuring color output 339 via the command line, in addition to via "color.ui" .perfconfig. 340 Use '--stdio-color always' to generate color even when redirecting 341 to a pipe or file. Using just '--stdio-color' is equivalent to 342 using 'always'. 343 344--tui:: Use the TUI interface, that is integrated with annotate and allows 345 zooming into DSOs or threads, among other features. Use of --tui 346 requires a tty, if one is not present, as when piping to other 347 commands, the stdio interface is used. 348 349--gtk:: Use the GTK2 interface. 350 351-k:: 352--vmlinux=<file>:: 353 vmlinux pathname 354 355--ignore-vmlinux:: 356 Ignore vmlinux files. 357 358--kallsyms=<file>:: 359 kallsyms pathname 360 361-m:: 362--modules:: 363 Load module symbols. WARNING: This should only be used with -k and 364 a LIVE kernel. 365 366-f:: 367--force:: 368 Don't do ownership validation. 369 370--symfs=<directory>:: 371 Look for files with symbols relative to this directory. 372 373-C:: 374--cpu:: Only report samples for the list of CPUs provided. Multiple CPUs can 375 be provided as a comma-separated list with no space: 0,1. Ranges of 376 CPUs are specified with -: 0-2. Default is to report samples on all 377 CPUs. 378 379-M:: 380--disassembler-style=:: Set disassembler style for objdump. 381 382--source:: 383 Interleave source code with assembly code. Enabled by default, 384 disable with --no-source. 385 386--asm-raw:: 387 Show raw instruction encoding of assembly instructions. 388 389--show-total-period:: Show a column with the sum of periods. 390 391-I:: 392--show-info:: 393 Display extended information about the perf.data file. This adds 394 information which may be very large and thus may clutter the display. 395 It currently includes: cpu and numa topology of the host system. 396 397-b:: 398--branch-stack:: 399 Use the addresses of sampled taken branches instead of the instruction 400 address to build the histograms. To generate meaningful output, the 401 perf.data file must have been obtained using perf record -b or 402 perf record --branch-filter xxx where xxx is a branch filter option. 403 perf report is able to auto-detect whether a perf.data file contains 404 branch stacks and it will automatically switch to the branch view mode, 405 unless --no-branch-stack is used. 406 407--branch-history:: 408 Add the addresses of sampled taken branches to the callstack. 409 This allows to examine the path the program took to each sample. 410 The data collection must have used -b (or -j) and -g. 411 412 Also show with some branch flags that can be: 413 - Predicted: display the average percentage of predicated branches. 414 (predicated number / total number) 415 - Abort: display the number of tsx aborted branches. 416 - Cycles: cycles in basic block. 417 418 - iterations: display the average number of iterations in callchain list. 419 420--addr2line=<path>:: 421 Path to addr2line binary. 422 423--objdump=<path>:: 424 Path to objdump binary. 425 426--prefix=PREFIX:: 427--prefix-strip=N:: 428 Remove first N entries from source file path names in executables 429 and add PREFIX. This allows to display source code compiled on systems 430 with different file system layout. 431 432--group:: 433 Show event group information together. It forces group output also 434 if there are no groups defined in data file. 435 436--group-sort-idx:: 437 Sort the output by the event at the index n in group. If n is invalid, 438 sort by the first event. It can support multiple groups with different 439 amount of events. WARNING: This should be used on grouped events. 440 441--demangle:: 442 Demangle symbol names to human readable form. It's enabled by default, 443 disable with --no-demangle. 444 445--demangle-kernel:: 446 Demangle kernel symbol names to human readable form (for C++ kernels). 447 448--mem-mode:: 449 Use the data addresses of samples in addition to instruction addresses 450 to build the histograms. To generate meaningful output, the perf.data 451 file must have been obtained using perf record -d -W and using a 452 special event -e cpu/mem-loads/p or -e cpu/mem-stores/p. See 453 'perf mem' for simpler access. 454 455--percent-limit:: 456 Do not show entries which have an overhead under that percent. 457 (Default: 0). Note that this option also sets the percent limit (threshold) 458 of callchains. However the default value of callchain threshold is 459 different than the default value of hist entries. Please see the 460 --call-graph option for details. 461 462--percentage:: 463 Determine how to display the CPU and latency overhead percentage 464 of filtered entries. Filters can be applied by --comms, --dsos, --symbols 465 and/or --parallelism options and Zoom operations on the TUI (thread, dso, etc). 466 467 "relative" means it's relative to filtered entries only so that the 468 sum of shown entries will be always 100%. "absolute" means it retains 469 the original value before and after the filter is applied. 470 471--header:: 472 Show header information in the perf.data file. This includes 473 various information like hostname, OS and perf version, cpu/mem 474 info, perf command line, event list and so on. Currently only 475 --stdio output supports this feature. 476 477--header-only:: 478 Show only perf.data header (forces --stdio). 479 480--time:: 481 Only analyze samples within given time window: <start>,<stop>. Times 482 have the format seconds.nanoseconds. If start is not given (i.e. time 483 string is ',x.y') then analysis starts at the beginning of the file. If 484 stop time is not given (i.e. time string is 'x.y,') then analysis goes 485 to end of file. Multiple ranges can be separated by spaces, which 486 requires the argument to be quoted e.g. --time "1234.567,1234.789 1235," 487 488 Also support time percent with multiple time ranges. Time string is 489 'a%/n,b%/m,...' or 'a%-b%,c%-%d,...'. 490 491 For example: 492 Select the second 10% time slice: 493 494 perf report --time 10%/2 495 496 Select from 0% to 10% time slice: 497 498 perf report --time 0%-10% 499 500 Select the first and second 10% time slices: 501 502 perf report --time 10%/1,10%/2 503 504 Select from 0% to 10% and 30% to 40% slices: 505 506 perf report --time 0%-10%,30%-40% 507 508--switch-on EVENT_NAME:: 509 Only consider events after this event is found. 510 511 This may be interesting to measure a workload only after some initialization 512 phase is over, i.e. insert a perf probe at that point and then using this 513 option with that probe. 514 515--switch-off EVENT_NAME:: 516 Stop considering events after this event is found. 517 518--show-on-off-events:: 519 Show the --switch-on/off events too. This has no effect in 'perf report' now 520 but probably we'll make the default not to show the switch-on/off events 521 on the --group mode and if there is only one event besides the off/on ones, 522 go straight to the histogram browser, just like 'perf report' with no events 523 explicitly specified does. 524 525--itrace:: 526 Options for decoding instruction tracing data. The options are: 527 528include::itrace.txt[] 529 530 To disable decoding entirely, use --no-itrace. 531 532--full-source-path:: 533 Show the full path for source files for srcline output. 534 535--show-ref-call-graph:: 536 When multiple events are sampled, it may not be needed to collect 537 callgraphs for all of them. The sample sites are usually nearby, 538 and it's enough to collect the callgraphs on a reference event. 539 So user can use "call-graph=no" event modifier to disable callgraph 540 for other events to reduce the overhead. 541 However, perf report cannot show callgraphs for the event which 542 disable the callgraph. 543 This option extends the perf report to show reference callgraphs, 544 which collected by reference event, in no callgraph event. 545 546--stitch-lbr:: 547 Show callgraph with stitched LBRs, which may have more complete 548 callgraph. The perf.data file must have been obtained using 549 perf record --call-graph lbr. 550 Disabled by default. In common cases with call stack overflows, 551 it can recreate better call stacks than the default lbr call stack 552 output. But this approach is not foolproof. There can be cases 553 where it creates incorrect call stacks from incorrect matches. 554 The known limitations include exception handing such as 555 setjmp/longjmp will have calls/returns not match. 556 557--socket-filter:: 558 Only report the samples on the processor socket that match with this filter 559 560--samples=N:: 561 Save N individual samples for each histogram entry to show context in perf 562 report tui browser. 563 564--raw-trace:: 565 When displaying traceevent output, do not use print fmt or plugins. 566 567-H:: 568--hierarchy:: 569 Enable hierarchical output. In the hierarchy mode, each sort key groups 570 samples based on the criteria and then sub-divide it using the lower 571 level sort key. 572 573 For example: 574 In normal output: 575 576 perf report -s dso,sym 577 # Overhead Shared Object Symbol 578 50.00% [kernel.kallsyms] [k] kfunc1 579 20.00% perf [.] foo 580 15.00% [kernel.kallsyms] [k] kfunc2 581 10.00% perf [.] bar 582 5.00% libc.so [.] libcall 583 584 In hierarchy output: 585 586 perf report -s dso,sym --hierarchy 587 # Overhead Shared Object / Symbol 588 65.00% [kernel.kallsyms] 589 50.00% [k] kfunc1 590 15.00% [k] kfunc2 591 30.00% perf 592 20.00% [.] foo 593 10.00% [.] bar 594 5.00% libc.so 595 5.00% [.] libcall 596 597--inline:: 598 If a callgraph address belongs to an inlined function, the inline stack 599 will be printed. Each entry is function name or file/line. Enabled by 600 default, disable with --no-inline. 601 602--mmaps:: 603 Show --tasks output plus mmap information in a format similar to 604 /proc/<PID>/maps. 605 606 Please note that not all mmaps are stored, options affecting which ones 607 are include 'perf record --data', for instance. 608 609--ns:: 610 Show time stamps in nanoseconds. 611 612--stats:: 613 Display overall events statistics without any further processing. 614 (like the one at the end of the perf report -D command) 615 616--tasks:: 617 Display monitored tasks stored in perf data. Displaying pid/tid/ppid 618 plus the command string aligned to distinguish parent and child tasks. 619 620--percent-type:: 621 Set annotation percent type from following choices: 622 global-period, local-period, global-hits, local-hits 623 624 The local/global keywords set if the percentage is computed 625 in the scope of the function (local) or the whole data (global). 626 The period/hits keywords set the base the percentage is computed 627 on - the samples period or the number of samples (hits). 628 629--time-quantum:: 630 Configure time quantum for time sort key. Default 100ms. 631 Accepts s, us, ms, ns units. 632 633--total-cycles:: 634 When --total-cycles is specified, it supports sorting for all blocks by 635 'Sampled Cycles%'. This is useful to concentrate on the globally hottest 636 blocks. In output, there are some new columns: 637 638 'Sampled Cycles%' - block sampled cycles aggregation / total sampled cycles 639 'Sampled Cycles' - block sampled cycles aggregation 640 'Avg Cycles%' - block average sampled cycles / sum of total block average 641 sampled cycles 642 'Avg Cycles' - block average sampled cycles 643 'Branch Counter' - block branch counter histogram (with -v showing the number) 644 645--skip-empty:: 646 Do not print 0 results in the --stat output. 647 648include::cpu-and-latency-overheads.txt[] 649 650include::callchain-overhead-calculation.txt[] 651 652SEE ALSO 653-------- 654linkperf:perf-stat[1], linkperf:perf-annotate[1], linkperf:perf-record[1], 655linkperf:perf-intel-pt[1] 656