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