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