perf-stat.txt 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. perf-stat(1)
  2. ============
  3. NAME
  4. ----
  5. perf-stat - Run a command and gather performance counter statistics
  6. SYNOPSIS
  7. --------
  8. [verse]
  9. 'perf stat' [-e <EVENT> | --event=EVENT] [-a] <command>
  10. 'perf stat' [-e <EVENT> | --event=EVENT] [-a] -- <command> [<options>]
  11. DESCRIPTION
  12. -----------
  13. This command runs a command and gathers performance counter statistics
  14. from it.
  15. OPTIONS
  16. -------
  17. <command>...::
  18. Any command you can specify in a shell.
  19. -e::
  20. --event=::
  21. Select the PMU event. Selection can be a symbolic event name
  22. (use 'perf list' to list all events) or a raw PMU
  23. event (eventsel+umask) in the form of rNNN where NNN is a
  24. hexadecimal event descriptor.
  25. -i::
  26. --no-inherit::
  27. child tasks do not inherit counters
  28. -p::
  29. --pid=<pid>::
  30. stat events on existing process id
  31. -t::
  32. --tid=<tid>::
  33. stat events on existing thread id
  34. -a::
  35. --all-cpus::
  36. system-wide collection from all CPUs
  37. -c::
  38. --scale::
  39. scale/normalize counter values
  40. -r::
  41. --repeat=<n>::
  42. repeat command and print average + stddev (max: 100)
  43. -B::
  44. --big-num::
  45. print large numbers with thousands' separators according to locale
  46. -C::
  47. --cpu=::
  48. Count only on the list of CPUs provided. Multiple CPUs can be provided as a
  49. comma-separated list with no space: 0,1. Ranges of CPUs are specified with -: 0-2.
  50. In per-thread mode, this option is ignored. The -a option is still necessary
  51. to activate system-wide monitoring. Default is to count on all CPUs.
  52. -A::
  53. --no-aggr::
  54. Do not aggregate counts across all monitored CPUs in system-wide mode (-a).
  55. This option is only valid in system-wide mode.
  56. -n::
  57. --null::
  58. null run - don't start any counters
  59. -v::
  60. --verbose::
  61. be more verbose (show counter open errors, etc)
  62. -x SEP::
  63. --field-separator SEP::
  64. print counts using a CSV-style output to make it easy to import directly into
  65. spreadsheets. Columns are separated by the string specified in SEP.
  66. EXAMPLES
  67. --------
  68. $ perf stat -- make -j
  69. Performance counter stats for 'make -j':
  70. 8117.370256 task clock ticks # 11.281 CPU utilization factor
  71. 678 context switches # 0.000 M/sec
  72. 133 CPU migrations # 0.000 M/sec
  73. 235724 pagefaults # 0.029 M/sec
  74. 24821162526 CPU cycles # 3057.784 M/sec
  75. 18687303457 instructions # 2302.138 M/sec
  76. 172158895 cache references # 21.209 M/sec
  77. 27075259 cache misses # 3.335 M/sec
  78. Wall-clock time elapsed: 719.554352 msecs
  79. SEE ALSO
  80. --------
  81. linkperf:perf-top[1], linkperf:perf-list[1]