blob: 0921a3c673815c6a031278be3107f80011eb5c46 [file] [log] [blame]
Hitoshi Mitake9fbc04f2009-11-10 20:50:54 +09001perf-bench(1)
Arnaldo Carvalho de Melo4778e0e2010-05-05 11:23:27 -03002=============
Hitoshi Mitake9fbc04f2009-11-10 20:50:54 +09003
4NAME
5----
6perf-bench - General framework for benchmark suites
7
8SYNOPSIS
9--------
10[verse]
11'perf bench' [<common options>] <subsystem> <suite> [<options>]
12
13DESCRIPTION
14-----------
Namhyung Kim08942f62012-06-20 15:08:06 +090015This 'perf bench' command is a general framework for benchmark suites.
Hitoshi Mitake9fbc04f2009-11-10 20:50:54 +090016
17COMMON OPTIONS
18--------------
Davidlohr Buesob6f06292014-06-16 11:14:19 -070019-r::
20--repeat=::
21Specify amount of times to repeat the run (default 10).
22
Hitoshi Mitake9fbc04f2009-11-10 20:50:54 +090023-f::
24--format=::
25Specify format style.
Randy Dunlap854c5542010-03-31 11:31:00 -070026Current available format styles are:
Hitoshi Mitake9fbc04f2009-11-10 20:50:54 +090027
28'default'::
29Default style. This is mainly for human reading.
30---------------------
Randy Dunlap854c5542010-03-31 11:31:00 -070031% perf bench sched pipe # with no style specified
Hitoshi Mitake9fbc04f2009-11-10 20:50:54 +090032(executing 1000000 pipe operations between two tasks)
33 Total time:5.855 sec
34 5.855061 usecs/op
35 170792 ops/sec
36---------------------
37
38'simple'::
39This simple style is friendly for automated
40processing by scripts.
41---------------------
42% perf bench --format=simple sched pipe # specified simple
435.988
44---------------------
45
46SUBSYSTEM
47---------
48
49'sched'::
50 Scheduler and IPC mechanisms.
51
Namhyung Kim08942f62012-06-20 15:08:06 +090052'mem'::
53 Memory access performance.
54
Ramkumar Ramachandra95a2b3c2014-03-27 19:50:18 -040055'numa'::
56 NUMA scheduling and MM benchmarks.
57
58'futex'::
59 Futex stressing benchmarks.
60
Davidlohr Bueso121dd9e2018-11-06 07:22:25 -080061'epoll'::
62 Eventpoll (epoll) stressing benchmarks.
63
Namhyung Kim08942f62012-06-20 15:08:06 +090064'all'::
65 All benchmark subsystems.
66
Hitoshi Mitake9fbc04f2009-11-10 20:50:54 +090067SUITES FOR 'sched'
68~~~~~~~~~~~~~~~~~~
69*messaging*::
70Suite for evaluating performance of scheduler and IPC mechanisms.
71Based on hackbench by Rusty Russell.
72
Namhyung Kim08942f62012-06-20 15:08:06 +090073Options of *messaging*
74^^^^^^^^^^^^^^^^^^^^^^
Hitoshi Mitake9fbc04f2009-11-10 20:50:54 +090075-p::
76--pipe::
77Use pipe() instead of socketpair()
78
79-t::
80--thread::
81Be multi thread instead of multi process
82
83-g::
84--group=::
85Specify number of groups
86
87-l::
Ingo Molnarb0d22e52015-10-19 10:04:28 +020088--nr_loops=::
Hitoshi Mitake9fbc04f2009-11-10 20:50:54 +090089Specify number of loops
90
91Example of *messaging*
92^^^^^^^^^^^^^^^^^^^^^^
93
94---------------------
95% perf bench sched messaging # run with default
96options (20 sender and receiver processes per group)
97(10 groups == 400 processes run)
98
99 Total time:0.308 sec
100
Randy Dunlap854c5542010-03-31 11:31:00 -0700101% perf bench sched messaging -t -g 20 # be multi-thread, with 20 groups
Hitoshi Mitake9fbc04f2009-11-10 20:50:54 +0900102(20 sender and receiver threads per group)
103(20 groups == 800 threads run)
104
105 Total time:0.582 sec
106---------------------
107
108*pipe*::
109Suite for pipe() system call.
110Based on pipe-test-1m.c by Ingo Molnar.
111
112Options of *pipe*
113^^^^^^^^^^^^^^^^^
114-l::
115--loop=::
116Specify number of loops.
117
118Example of *pipe*
119^^^^^^^^^^^^^^^^^
120
121---------------------
122% perf bench sched pipe
123(executing 1000000 pipe operations between two tasks)
124
125 Total time:8.091 sec
126 8.091833 usecs/op
127 123581 ops/sec
128
129% perf bench sched pipe -l 1000 # loop 1000
130(executing 1000 pipe operations between two tasks)
131
132 Total time:0.016 sec
133 16.948000 usecs/op
134 59004 ops/sec
135---------------------
136
Namhyung Kim08942f62012-06-20 15:08:06 +0900137SUITES FOR 'mem'
138~~~~~~~~~~~~~~~~
139*memcpy*::
140Suite for evaluating performance of simple memory copy in various ways.
141
142Options of *memcpy*
143^^^^^^^^^^^^^^^^^^^
144-l::
Ingo Molnara69b4f72015-10-19 10:04:25 +0200145--size::
146Specify size of memory to copy (default: 1MB).
Namhyung Kim08942f62012-06-20 15:08:06 +0900147Available units are B, KB, MB, GB and TB (case insensitive).
148
Ingo Molnar2f211c82015-10-19 10:04:29 +0200149-f::
150--function::
151Specify function to copy (default: default).
152Available functions are depend on the architecture.
Namhyung Kim08942f62012-06-20 15:08:06 +0900153On x86-64, x86-64-unrolled, x86-64-movsq and x86-64-movsb are supported.
154
Ingo Molnarb0d22e52015-10-19 10:04:28 +0200155-l::
156--nr_loops::
Namhyung Kim08942f62012-06-20 15:08:06 +0900157Repeat memcpy invocation this number of times.
158
159-c::
Ingo Molnarb14f2d32015-10-19 10:04:23 +0200160--cycles::
Namhyung Kim08942f62012-06-20 15:08:06 +0900161Use perf's cpu-cycles event instead of gettimeofday syscall.
162
Namhyung Kim08942f62012-06-20 15:08:06 +0900163*memset*::
164Suite for evaluating performance of simple memory set in various ways.
165
166Options of *memset*
167^^^^^^^^^^^^^^^^^^^
168-l::
Ingo Molnara69b4f72015-10-19 10:04:25 +0200169--size::
170Specify size of memory to set (default: 1MB).
Namhyung Kim08942f62012-06-20 15:08:06 +0900171Available units are B, KB, MB, GB and TB (case insensitive).
172
Ingo Molnar2f211c82015-10-19 10:04:29 +0200173-f::
174--function::
175Specify function to set (default: default).
176Available functions are depend on the architecture.
Namhyung Kim08942f62012-06-20 15:08:06 +0900177On x86-64, x86-64-unrolled, x86-64-stosq and x86-64-stosb are supported.
178
Ingo Molnarb0d22e52015-10-19 10:04:28 +0200179-l::
180--nr_loops::
Namhyung Kim08942f62012-06-20 15:08:06 +0900181Repeat memset invocation this number of times.
182
183-c::
Ingo Molnarb14f2d32015-10-19 10:04:23 +0200184--cycles::
Namhyung Kim08942f62012-06-20 15:08:06 +0900185Use perf's cpu-cycles event instead of gettimeofday syscall.
186
Ramkumar Ramachandra95a2b3c2014-03-27 19:50:18 -0400187SUITES FOR 'numa'
188~~~~~~~~~~~~~~~~~
189*mem*::
190Suite for evaluating NUMA workloads.
191
192SUITES FOR 'futex'
193~~~~~~~~~~~~~~~~~~
194*hash*::
195Suite for evaluating hash tables.
196
197*wake*::
198Suite for evaluating wake calls.
199
Davidlohr Buesod65817b2015-05-08 11:37:59 -0700200*wake-parallel*::
201Suite for evaluating parallel wake calls.
202
Ramkumar Ramachandra95a2b3c2014-03-27 19:50:18 -0400203*requeue*::
204Suite for evaluating requeue calls.
205
Davidlohr Buesod2f3f5d2015-07-07 01:55:53 -0700206*lock-pi*::
207Suite for evaluating futex lock_pi calls.
208
Davidlohr Bueso121dd9e2018-11-06 07:22:25 -0800209SUITES FOR 'epoll'
210~~~~~~~~~~~~~~~~~~
211*wait*::
212Suite for evaluating concurrent epoll_wait calls.
Davidlohr Buesod2f3f5d2015-07-07 01:55:53 -0700213
Davidlohr Bueso231457e2018-11-06 07:22:26 -0800214*ctl*::
215Suite for evaluating multiple epoll_ctl calls.
216
Hitoshi Mitake9fbc04f2009-11-10 20:50:54 +0900217SEE ALSO
218--------
219linkperf:perf[1]