perf-top.txt 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276
  1. perf-top(1)
  2. ===========
  3. NAME
  4. ----
  5. perf-top - System profiling tool.
  6. SYNOPSIS
  7. --------
  8. [verse]
  9. 'perf top' [-e <EVENT> | --event=EVENT] [<options>]
  10. DESCRIPTION
  11. -----------
  12. This command generates and displays a performance counter profile in real time.
  13. OPTIONS
  14. -------
  15. -a::
  16. --all-cpus::
  17. System-wide collection. (default)
  18. -c <count>::
  19. --count=<count>::
  20. Event period to sample.
  21. -C <cpu-list>::
  22. --cpu=<cpu>::
  23. Monitor only on the list of CPUs provided. Multiple CPUs can be provided as a
  24. comma-separated list with no space: 0,1. Ranges of CPUs are specified with -: 0-2.
  25. Default is to monitor all CPUS.
  26. -d <seconds>::
  27. --delay=<seconds>::
  28. Number of seconds to delay between refreshes.
  29. -e <event>::
  30. --event=<event>::
  31. Select the PMU event. Selection can be a symbolic event name
  32. (use 'perf list' to list all events) or a raw PMU
  33. event (eventsel+umask) in the form of rNNN where NNN is a
  34. hexadecimal event descriptor.
  35. -E <entries>::
  36. --entries=<entries>::
  37. Display this many functions.
  38. -f <count>::
  39. --count-filter=<count>::
  40. Only display functions with more events than this.
  41. --group::
  42. Put the counters into a counter group.
  43. -F <freq>::
  44. --freq=<freq>::
  45. Profile at this frequency.
  46. -i::
  47. --inherit::
  48. Child tasks do not inherit counters.
  49. -k <path>::
  50. --vmlinux=<path>::
  51. Path to vmlinux. Required for annotation functionality.
  52. -m <pages>::
  53. --mmap-pages=<pages>::
  54. Number of mmap data pages (must be a power of two) or size
  55. specification with appended unit character - B/K/M/G. The
  56. size is rounded up to have nearest pages power of two value.
  57. -p <pid>::
  58. --pid=<pid>::
  59. Profile events on existing Process ID (comma separated list).
  60. -t <tid>::
  61. --tid=<tid>::
  62. Profile events on existing thread ID (comma separated list).
  63. -u::
  64. --uid=::
  65. Record events in threads owned by uid. Name or number.
  66. -r <priority>::
  67. --realtime=<priority>::
  68. Collect data with this RT SCHED_FIFO priority.
  69. --sym-annotate=<symbol>::
  70. Annotate this symbol.
  71. -K::
  72. --hide_kernel_symbols::
  73. Hide kernel symbols.
  74. -U::
  75. --hide_user_symbols::
  76. Hide user symbols.
  77. --demangle-kernel::
  78. Demangle kernel symbols.
  79. -D::
  80. --dump-symtab::
  81. Dump the symbol table used for profiling.
  82. -v::
  83. --verbose::
  84. Be more verbose (show counter open errors, etc).
  85. -z::
  86. --zero::
  87. Zero history across display updates.
  88. -s::
  89. --sort::
  90. Sort by key(s): pid, comm, dso, symbol, parent, srcline, weight,
  91. local_weight, abort, in_tx, transaction, overhead, sample, period.
  92. Please see description of --sort in the perf-report man page.
  93. --fields=::
  94. Specify output field - multiple keys can be specified in CSV format.
  95. Following fields are available:
  96. overhead, overhead_sys, overhead_us, overhead_children, sample and period.
  97. Also it can contain any sort key(s).
  98. By default, every sort keys not specified in --field will be appended
  99. automatically.
  100. -n::
  101. --show-nr-samples::
  102. Show a column with the number of samples.
  103. --show-total-period::
  104. Show a column with the sum of periods.
  105. --dsos::
  106. Only consider symbols in these dsos. This option will affect the
  107. percentage of the overhead column. See --percentage for more info.
  108. --comms::
  109. Only consider symbols in these comms. This option will affect the
  110. percentage of the overhead column. See --percentage for more info.
  111. --symbols::
  112. Only consider these symbols. This option will affect the
  113. percentage of the overhead column. See --percentage for more info.
  114. -M::
  115. --disassembler-style=:: Set disassembler style for objdump.
  116. --source::
  117. Interleave source code with assembly code. Enabled by default,
  118. disable with --no-source.
  119. --asm-raw::
  120. Show raw instruction encoding of assembly instructions.
  121. -g::
  122. Enables call-graph (stack chain/backtrace) recording.
  123. --call-graph [mode,type,min[,limit],order[,key][,branch]]::
  124. Setup and enable call-graph (stack chain/backtrace) recording,
  125. implies -g. See `--call-graph` section in perf-record and
  126. perf-report man pages for details.
  127. --children::
  128. Accumulate callchain of children to parent entry so that then can
  129. show up in the output. The output will have a new "Children" column
  130. and will be sorted on the data. It requires -g/--call-graph option
  131. enabled. See the `overhead calculation' section for more details.
  132. --max-stack::
  133. Set the stack depth limit when parsing the callchain, anything
  134. beyond the specified depth will be ignored. This is a trade-off
  135. between information loss and faster processing especially for
  136. workloads that can have a very long callchain stack.
  137. Default: /proc/sys/kernel/perf_event_max_stack when present, 127 otherwise.
  138. --ignore-callees=<regex>::
  139. Ignore callees of the function(s) matching the given regex.
  140. This has the effect of collecting the callers of each such
  141. function into one place in the call-graph tree.
  142. --percent-limit::
  143. Do not show entries which have an overhead under that percent.
  144. (Default: 0).
  145. --percentage::
  146. Determine how to display the overhead percentage of filtered entries.
  147. Filters can be applied by --comms, --dsos and/or --symbols options and
  148. Zoom operations on the TUI (thread, dso, etc).
  149. "relative" means it's relative to filtered entries only so that the
  150. sum of shown entries will be always 100%. "absolute" means it retains
  151. the original value before and after the filter is applied.
  152. -w::
  153. --column-widths=<width[,width...]>::
  154. Force each column width to the provided list, for large terminal
  155. readability. 0 means no limit (default behavior).
  156. --proc-map-timeout::
  157. When processing pre-existing threads /proc/XXX/mmap, it may take
  158. a long time, because the file may be huge. A time out is needed
  159. in such cases.
  160. This option sets the time out limit. The default value is 500 ms.
  161. -b::
  162. --branch-any::
  163. Enable taken branch stack sampling. Any type of taken branch may be sampled.
  164. This is a shortcut for --branch-filter any. See --branch-filter for more infos.
  165. -j::
  166. --branch-filter::
  167. Enable taken branch stack sampling. Each sample captures a series of consecutive
  168. taken branches. The number of branches captured with each sample depends on the
  169. underlying hardware, the type of branches of interest, and the executed code.
  170. It is possible to select the types of branches captured by enabling filters.
  171. For a full list of modifiers please see the perf record manpage.
  172. The option requires at least one branch type among any, any_call, any_ret, ind_call, cond.
  173. The privilege levels may be omitted, in which case, the privilege levels of the associated
  174. event are applied to the branch filter. Both kernel (k) and hypervisor (hv) privilege
  175. levels are subject to permissions. When sampling on multiple events, branch stack sampling
  176. is enabled for all the sampling events. The sampled branch type is the same for all events.
  177. The various filters must be specified as a comma separated list: --branch-filter any_ret,u,k
  178. Note that this feature may not be available on all processors.
  179. --raw-trace::
  180. When displaying traceevent output, do not use print fmt or plugins.
  181. --hierarchy::
  182. Enable hierarchy output.
  183. INTERACTIVE PROMPTING KEYS
  184. --------------------------
  185. [d]::
  186. Display refresh delay.
  187. [e]::
  188. Number of entries to display.
  189. [E]::
  190. Event to display when multiple counters are active.
  191. [f]::
  192. Profile display filter (>= hit count).
  193. [F]::
  194. Annotation display filter (>= % of total).
  195. [s]::
  196. Annotate symbol.
  197. [S]::
  198. Stop annotation, return to full profile display.
  199. [z]::
  200. Toggle event count zeroing across display updates.
  201. [qQ]::
  202. Quit.
  203. Pressing any unmapped key displays a menu, and prompts for input.
  204. include::callchain-overhead-calculation.txt[]
  205. SEE ALSO
  206. --------
  207. linkperf:perf-stat[1], linkperf:perf-list[1], linkperf:perf-report[1]