perf-report.txt 13 KB

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