perf-report.txt 16 KB

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