perf-top.txt 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240
  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::
  124. Setup and enable call-graph (stack chain/backtrace) recording,
  125. implies -g.
  126. --children::
  127. Accumulate callchain of children to parent entry so that then can
  128. show up in the output. The output will have a new "Children" column
  129. and will be sorted on the data. It requires -g/--call-graph option
  130. enabled.
  131. --max-stack::
  132. Set the stack depth limit when parsing the callchain, anything
  133. beyond the specified depth will be ignored. This is a trade-off
  134. between information loss and faster processing especially for
  135. workloads that can have a very long callchain stack.
  136. Default: 127
  137. --ignore-callees=<regex>::
  138. Ignore callees of the function(s) matching the given regex.
  139. This has the effect of collecting the callers of each such
  140. function into one place in the call-graph tree.
  141. --percent-limit::
  142. Do not show entries which have an overhead under that percent.
  143. (Default: 0).
  144. --percentage::
  145. Determine how to display the overhead percentage of filtered entries.
  146. Filters can be applied by --comms, --dsos and/or --symbols options and
  147. Zoom operations on the TUI (thread, dso, etc).
  148. "relative" means it's relative to filtered entries only so that the
  149. sum of shown entries will be always 100%. "absolute" means it retains
  150. the original value before and after the filter is applied.
  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. INTERACTIVE PROMPTING KEYS
  156. --------------------------
  157. [d]::
  158. Display refresh delay.
  159. [e]::
  160. Number of entries to display.
  161. [E]::
  162. Event to display when multiple counters are active.
  163. [f]::
  164. Profile display filter (>= hit count).
  165. [F]::
  166. Annotation display filter (>= % of total).
  167. [s]::
  168. Annotate symbol.
  169. [S]::
  170. Stop annotation, return to full profile display.
  171. [z]::
  172. Toggle event count zeroing across display updates.
  173. [qQ]::
  174. Quit.
  175. Pressing any unmapped key displays a menu, and prompts for input.
  176. SEE ALSO
  177. --------
  178. linkperf:perf-stat[1], linkperf:perf-list[1], linkperf:perf-report[1]