perf-report.txt 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356
  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. --showcpuutilization::
  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, 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. - srcline: filename and line number executed at the time of sample. The
  69. DWARF debugging info must be provided.
  70. - srcfile: file name of the source file of the same. Requires dwarf
  71. information.
  72. - weight: Event specific weight, e.g. memory latency or transaction
  73. abort cost. This is the global weight.
  74. - local_weight: Local weight version of the weight above.
  75. - transaction: Transaction abort flags.
  76. - overhead: Overhead percentage of sample
  77. - overhead_sys: Overhead percentage of sample running in system mode
  78. - overhead_us: Overhead percentage of sample running in user mode
  79. - overhead_guest_sys: Overhead percentage of sample running in system mode
  80. on guest machine
  81. - overhead_guest_us: Overhead percentage of sample running in user mode on
  82. guest machine
  83. - sample: Number of sample
  84. - period: Raw number of event count of sample
  85. By default, comm, dso and symbol keys are used.
  86. (i.e. --sort comm,dso,symbol)
  87. If --branch-stack option is used, following sort keys are also
  88. available:
  89. dso_from, dso_to, symbol_from, symbol_to, mispredict.
  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. - mispredict: "N" for predicted branch, "Y" for mispredicted branch
  95. - in_tx: branch in TSX transaction
  96. - abort: TSX transaction abort.
  97. - cycles: Cycles in basic block
  98. And default sort keys are changed to comm, dso_from, symbol_from, dso_to
  99. and symbol_to, see '--branch-stack'.
  100. -F::
  101. --fields=::
  102. Specify output field - multiple keys can be specified in CSV format.
  103. Following fields are available:
  104. overhead, overhead_sys, overhead_us, overhead_children, sample and period.
  105. Also it can contain any sort key(s).
  106. By default, every sort keys not specified in -F will be appended
  107. automatically.
  108. If --mem-mode option is used, 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 sample
  114. - locked: whether the bus was locked at the time of sample
  115. - tlb: type of tlb access for the data at the time of sample
  116. - mem: type of memory access for the data at the time of sample
  117. - snoop: type of snoop (if any) for the data at the time of sample
  118. - dcacheline: the cacheline the data address is on at the time of sample
  119. And default sort keys are changed to local_weight, mem, sym, dso,
  120. symbol_daddr, dso_daddr, snoop, tlb, locked, see '--mem-mode'.
  121. -p::
  122. --parent=<regex>::
  123. A regex filter to identify parent. The parent is a caller of this
  124. function and searched through the callchain, thus it requires callchain
  125. information recorded. The pattern is in the exteneded regex format and
  126. defaults to "\^sys_|^do_page_fault", see '--sort parent'.
  127. -x::
  128. --exclude-other::
  129. Only display entries with parent-match.
  130. -w::
  131. --column-widths=<width[,width...]>::
  132. Force each column width to the provided list, for large terminal
  133. readability. 0 means no limit (default behavior).
  134. -t::
  135. --field-separator=::
  136. Use a special separator character and don't pad with spaces, replacing
  137. all occurrences of this separator in symbol names (and other output)
  138. with a '.' character, that thus it's the only non valid separator.
  139. -D::
  140. --dump-raw-trace::
  141. Dump raw trace in ASCII.
  142. -g [type,min[,limit],order[,key][,branch]]::
  143. --call-graph::
  144. Display call chains using type, min percent threshold, optional print
  145. limit and order.
  146. type can be either:
  147. - flat: single column, linear exposure of call chains.
  148. - graph: use a graph tree, displaying absolute overhead rates.
  149. - fractal: like graph, but displays relative rates. Each branch of
  150. the tree is considered as a new profiled object. +
  151. order can be either:
  152. - callee: callee based call graph.
  153. - caller: inverted caller based call graph.
  154. key can be:
  155. - function: compare on functions
  156. - address: compare on individual code addresses
  157. branch can be:
  158. - branch: include last branch information in callgraph
  159. when available. Usually more convenient to use --branch-history
  160. for this.
  161. Default: fractal,0.5,callee,function.
  162. --children::
  163. Accumulate callchain of children to parent entry so that then can
  164. show up in the output. The output will have a new "Children" column
  165. and will be sorted on the data. It requires callchains are recorded.
  166. See the `overhead calculation' section for more details.
  167. --max-stack::
  168. Set the stack depth limit when parsing the callchain, anything
  169. beyond the specified depth will be ignored. This is a trade-off
  170. between information loss and faster processing especially for
  171. workloads that can have a very long callchain stack.
  172. Default: 127
  173. -G::
  174. --inverted::
  175. alias for inverted caller based call graph.
  176. --ignore-callees=<regex>::
  177. Ignore callees of the function(s) matching the given regex.
  178. This has the effect of collecting the callers of each such
  179. function into one place in the call-graph tree.
  180. --pretty=<key>::
  181. Pretty printing style. key: normal, raw
  182. --stdio:: Use the stdio interface.
  183. --tui:: Use the TUI interface, that is integrated with annotate and allows
  184. zooming into DSOs or threads, among other features. Use of --tui
  185. requires a tty, if one is not present, as when piping to other
  186. commands, the stdio interface is used.
  187. --gtk:: Use the GTK2 interface.
  188. -k::
  189. --vmlinux=<file>::
  190. vmlinux pathname
  191. --kallsyms=<file>::
  192. kallsyms pathname
  193. -m::
  194. --modules::
  195. Load module symbols. WARNING: This should only be used with -k and
  196. a LIVE kernel.
  197. -f::
  198. --force::
  199. Don't complain, do it.
  200. --symfs=<directory>::
  201. Look for files with symbols relative to this directory.
  202. -C::
  203. --cpu:: Only report samples for the list of CPUs provided. Multiple CPUs can
  204. be provided as a comma-separated list with no space: 0,1. Ranges of
  205. CPUs are specified with -: 0-2. Default is to report samples on all
  206. CPUs.
  207. -M::
  208. --disassembler-style=:: Set disassembler style for objdump.
  209. --source::
  210. Interleave source code with assembly code. Enabled by default,
  211. disable with --no-source.
  212. --asm-raw::
  213. Show raw instruction encoding of assembly instructions.
  214. --show-total-period:: Show a column with the sum of periods.
  215. -I::
  216. --show-info::
  217. Display extended information about the perf.data file. This adds
  218. information which may be very large and thus may clutter the display.
  219. It currently includes: cpu and numa topology of the host system.
  220. -b::
  221. --branch-stack::
  222. Use the addresses of sampled taken branches instead of the instruction
  223. address to build the histograms. To generate meaningful output, the
  224. perf.data file must have been obtained using perf record -b or
  225. perf record --branch-filter xxx where xxx is a branch filter option.
  226. perf report is able to auto-detect whether a perf.data file contains
  227. branch stacks and it will automatically switch to the branch view mode,
  228. unless --no-branch-stack is used.
  229. --branch-history::
  230. Add the addresses of sampled taken branches to the callstack.
  231. This allows to examine the path the program took to each sample.
  232. The data collection must have used -b (or -j) and -g.
  233. --objdump=<path>::
  234. Path to objdump binary.
  235. --group::
  236. Show event group information together.
  237. --demangle::
  238. Demangle symbol names to human readable form. It's enabled by default,
  239. disable with --no-demangle.
  240. --demangle-kernel::
  241. Demangle kernel symbol names to human readable form (for C++ kernels).
  242. --mem-mode::
  243. Use the data addresses of samples in addition to instruction addresses
  244. to build the histograms. To generate meaningful output, the perf.data
  245. file must have been obtained using perf record -d -W and using a
  246. special event -e cpu/mem-loads/ or -e cpu/mem-stores/. See
  247. 'perf mem' for simpler access.
  248. --percent-limit::
  249. Do not show entries which have an overhead under that percent.
  250. (Default: 0).
  251. --percentage::
  252. Determine how to display the overhead percentage of filtered entries.
  253. Filters can be applied by --comms, --dsos and/or --symbols options and
  254. Zoom operations on the TUI (thread, dso, etc).
  255. "relative" means it's relative to filtered entries only so that the
  256. sum of shown entries will be always 100%. "absolute" means it retains
  257. the original value before and after the filter is applied.
  258. --header::
  259. Show header information in the perf.data file. This includes
  260. various information like hostname, OS and perf version, cpu/mem
  261. info, perf command line, event list and so on. Currently only
  262. --stdio output supports this feature.
  263. --header-only::
  264. Show only perf.data header (forces --stdio).
  265. --itrace::
  266. Options for decoding instruction tracing data. The options are:
  267. include::itrace.txt[]
  268. To disable decoding entirely, use --no-itrace.
  269. --full-source-path::
  270. Show the full path for source files for srcline output.
  271. --show-ref-call-graph::
  272. When multiple events are sampled, it may not be needed to collect
  273. callgraphs for all of them. The sample sites are usually nearby,
  274. and it's enough to collect the callgraphs on a reference event.
  275. So user can use "call-graph=no" event modifier to disable callgraph
  276. for other events to reduce the overhead.
  277. However, perf report cannot show callgraphs for the event which
  278. disable the callgraph.
  279. This option extends the perf report to show reference callgraphs,
  280. which collected by reference event, in no callgraph event.
  281. include::callchain-overhead-calculation.txt[]
  282. SEE ALSO
  283. --------
  284. linkperf:perf-stat[1], linkperf:perf-annotate[1]