perf-stat.txt 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  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] [-S] [-a] <command>
  10. 'perf stat' [-e <EVENT> | --event=EVENT] [-S] [-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 pid
  31. -a::
  32. system-wide collection
  33. -c::
  34. scale counter values
  35. -B::
  36. print large numbers with thousands' separators according to locale
  37. -C::
  38. --cpu=::
  39. Count only on the list of cpus provided. Multiple CPUs can be provided as a
  40. comma-sperated list with no space: 0,1. Ranges of CPUs are specified with -: 0-2.
  41. In per-thread mode, this option is ignored. The -a option is still necessary
  42. to activate system-wide monitoring. Default is to count on all CPUs.
  43. EXAMPLES
  44. --------
  45. $ perf stat -- make -j
  46. Performance counter stats for 'make -j':
  47. 8117.370256 task clock ticks # 11.281 CPU utilization factor
  48. 678 context switches # 0.000 M/sec
  49. 133 CPU migrations # 0.000 M/sec
  50. 235724 pagefaults # 0.029 M/sec
  51. 24821162526 CPU cycles # 3057.784 M/sec
  52. 18687303457 instructions # 2302.138 M/sec
  53. 172158895 cache references # 21.209 M/sec
  54. 27075259 cache misses # 3.335 M/sec
  55. Wall-clock time elapsed: 719.554352 msecs
  56. SEE ALSO
  57. --------
  58. linkperf:perf-top[1], linkperf:perf-list[1]