perf-report.txt 15 KB

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