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