perf-bench.txt 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238
  1. perf-bench(1)
  2. =============
  3. NAME
  4. ----
  5. perf-bench - General framework for benchmark suites
  6. SYNOPSIS
  7. --------
  8. [verse]
  9. 'perf bench' [<common options>] <subsystem> <suite> [<options>]
  10. DESCRIPTION
  11. -----------
  12. This 'perf bench' command is a general framework for benchmark suites.
  13. COMMON OPTIONS
  14. --------------
  15. -r::
  16. --repeat=::
  17. Specify amount of times to repeat the run (default 10).
  18. -f::
  19. --format=::
  20. Specify format style.
  21. Current available format styles are:
  22. 'default'::
  23. Default style. This is mainly for human reading.
  24. ---------------------
  25. % perf bench sched pipe # with no style specified
  26. (executing 1000000 pipe operations between two tasks)
  27. Total time:5.855 sec
  28. 5.855061 usecs/op
  29. 170792 ops/sec
  30. ---------------------
  31. 'simple'::
  32. This simple style is friendly for automated
  33. processing by scripts.
  34. ---------------------
  35. % perf bench --format=simple sched pipe # specified simple
  36. 5.988
  37. ---------------------
  38. SUBSYSTEM
  39. ---------
  40. 'sched'::
  41. Scheduler and IPC mechanisms.
  42. 'syscall'::
  43. System call performance (throughput).
  44. 'mem'::
  45. Memory access performance.
  46. 'numa'::
  47. NUMA scheduling and MM benchmarks.
  48. 'futex'::
  49. Futex stressing benchmarks.
  50. 'epoll'::
  51. Eventpoll (epoll) stressing benchmarks.
  52. 'internals'::
  53. Benchmark internal perf functionality.
  54. 'all'::
  55. All benchmark subsystems.
  56. SUITES FOR 'sched'
  57. ~~~~~~~~~~~~~~~~~~
  58. *messaging*::
  59. Suite for evaluating performance of scheduler and IPC mechanisms.
  60. Based on hackbench by Rusty Russell.
  61. Options of *messaging*
  62. ^^^^^^^^^^^^^^^^^^^^^^
  63. -p::
  64. --pipe::
  65. Use pipe() instead of socketpair()
  66. -t::
  67. --thread::
  68. Be multi thread instead of multi process
  69. -g::
  70. --group=::
  71. Specify number of groups
  72. -l::
  73. --nr_loops=::
  74. Specify number of loops
  75. Example of *messaging*
  76. ^^^^^^^^^^^^^^^^^^^^^^
  77. ---------------------
  78. % perf bench sched messaging # run with default
  79. options (20 sender and receiver processes per group)
  80. (10 groups == 400 processes run)
  81. Total time:0.308 sec
  82. % perf bench sched messaging -t -g 20 # be multi-thread, with 20 groups
  83. (20 sender and receiver threads per group)
  84. (20 groups == 800 threads run)
  85. Total time:0.582 sec
  86. ---------------------
  87. *pipe*::
  88. Suite for pipe() system call.
  89. Based on pipe-test-1m.c by Ingo Molnar.
  90. Options of *pipe*
  91. ^^^^^^^^^^^^^^^^^
  92. -l::
  93. --loop=::
  94. Specify number of loops.
  95. Example of *pipe*
  96. ^^^^^^^^^^^^^^^^^
  97. ---------------------
  98. % perf bench sched pipe
  99. (executing 1000000 pipe operations between two tasks)
  100. Total time:8.091 sec
  101. 8.091833 usecs/op
  102. 123581 ops/sec
  103. % perf bench sched pipe -l 1000 # loop 1000
  104. (executing 1000 pipe operations between two tasks)
  105. Total time:0.016 sec
  106. 16.948000 usecs/op
  107. 59004 ops/sec
  108. ---------------------
  109. SUITES FOR 'syscall'
  110. ~~~~~~~~~~~~~~~~~~
  111. *basic*::
  112. Suite for evaluating performance of core system call throughput (both usecs/op and ops/sec metrics).
  113. This uses a single thread simply doing getppid(2), which is a simple syscall where the result is not
  114. cached by glibc.
  115. SUITES FOR 'mem'
  116. ~~~~~~~~~~~~~~~~
  117. *memcpy*::
  118. Suite for evaluating performance of simple memory copy in various ways.
  119. Options of *memcpy*
  120. ^^^^^^^^^^^^^^^^^^^
  121. -l::
  122. --size::
  123. Specify size of memory to copy (default: 1MB).
  124. Available units are B, KB, MB, GB and TB (case insensitive).
  125. -f::
  126. --function::
  127. Specify function to copy (default: default).
  128. Available functions are depend on the architecture.
  129. On x86-64, x86-64-unrolled, x86-64-movsq and x86-64-movsb are supported.
  130. -l::
  131. --nr_loops::
  132. Repeat memcpy invocation this number of times.
  133. -c::
  134. --cycles::
  135. Use perf's cpu-cycles event instead of gettimeofday syscall.
  136. *memset*::
  137. Suite for evaluating performance of simple memory set in various ways.
  138. Options of *memset*
  139. ^^^^^^^^^^^^^^^^^^^
  140. -l::
  141. --size::
  142. Specify size of memory to set (default: 1MB).
  143. Available units are B, KB, MB, GB and TB (case insensitive).
  144. -f::
  145. --function::
  146. Specify function to set (default: default).
  147. Available functions are depend on the architecture.
  148. On x86-64, x86-64-unrolled, x86-64-stosq and x86-64-stosb are supported.
  149. -l::
  150. --nr_loops::
  151. Repeat memset invocation this number of times.
  152. -c::
  153. --cycles::
  154. Use perf's cpu-cycles event instead of gettimeofday syscall.
  155. SUITES FOR 'numa'
  156. ~~~~~~~~~~~~~~~~~
  157. *mem*::
  158. Suite for evaluating NUMA workloads.
  159. SUITES FOR 'futex'
  160. ~~~~~~~~~~~~~~~~~~
  161. *hash*::
  162. Suite for evaluating hash tables.
  163. *wake*::
  164. Suite for evaluating wake calls.
  165. *wake-parallel*::
  166. Suite for evaluating parallel wake calls.
  167. *requeue*::
  168. Suite for evaluating requeue calls.
  169. *lock-pi*::
  170. Suite for evaluating futex lock_pi calls.
  171. SUITES FOR 'epoll'
  172. ~~~~~~~~~~~~~~~~~~
  173. *wait*::
  174. Suite for evaluating concurrent epoll_wait calls.
  175. *ctl*::
  176. Suite for evaluating multiple epoll_ctl calls.
  177. SUITES FOR 'internals'
  178. ~~~~~~~~~~~~~~~~~~~~~~
  179. *synthesize*::
  180. Suite for evaluating perf's event synthesis performance.
  181. SEE ALSO
  182. --------
  183. linkperf:perf[1]