perf-report.txt 17 KB

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