blob: 7065cd6fbdfc576a28d588f778354d15771a2ad1 [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--------------
19-f::
20--format=::
21Specify format style.
Randy Dunlap854c5542010-03-31 11:31:00 -070022Current available format styles are:
Hitoshi Mitake9fbc04f2009-11-10 20:50:54 +090023
24'default'::
25Default style. This is mainly for human reading.
26---------------------
Randy Dunlap854c5542010-03-31 11:31:00 -070027% perf bench sched pipe # with no style specified
Hitoshi Mitake9fbc04f2009-11-10 20:50:54 +090028(executing 1000000 pipe operations between two tasks)
29 Total time:5.855 sec
30 5.855061 usecs/op
31 170792 ops/sec
32---------------------
33
34'simple'::
35This simple style is friendly for automated
36processing by scripts.
37---------------------
38% perf bench --format=simple sched pipe # specified simple
395.988
40---------------------
41
42SUBSYSTEM
43---------
44
45'sched'::
46 Scheduler and IPC mechanisms.
47
Namhyung Kim08942f62012-06-20 15:08:06 +090048'mem'::
49 Memory access performance.
50
51'all'::
52 All benchmark subsystems.
53
Hitoshi Mitake9fbc04f2009-11-10 20:50:54 +090054SUITES FOR 'sched'
55~~~~~~~~~~~~~~~~~~
56*messaging*::
57Suite for evaluating performance of scheduler and IPC mechanisms.
58Based on hackbench by Rusty Russell.
59
Namhyung Kim08942f62012-06-20 15:08:06 +090060Options of *messaging*
61^^^^^^^^^^^^^^^^^^^^^^
Hitoshi Mitake9fbc04f2009-11-10 20:50:54 +090062-p::
63--pipe::
64Use pipe() instead of socketpair()
65
66-t::
67--thread::
68Be multi thread instead of multi process
69
70-g::
71--group=::
72Specify number of groups
73
74-l::
75--loop=::
76Specify number of loops
77
78Example of *messaging*
79^^^^^^^^^^^^^^^^^^^^^^
80
81---------------------
82% perf bench sched messaging # run with default
83options (20 sender and receiver processes per group)
84(10 groups == 400 processes run)
85
86 Total time:0.308 sec
87
Randy Dunlap854c5542010-03-31 11:31:00 -070088% perf bench sched messaging -t -g 20 # be multi-thread, with 20 groups
Hitoshi Mitake9fbc04f2009-11-10 20:50:54 +090089(20 sender and receiver threads per group)
90(20 groups == 800 threads run)
91
92 Total time:0.582 sec
93---------------------
94
95*pipe*::
96Suite for pipe() system call.
97Based on pipe-test-1m.c by Ingo Molnar.
98
99Options of *pipe*
100^^^^^^^^^^^^^^^^^
101-l::
102--loop=::
103Specify number of loops.
104
105Example of *pipe*
106^^^^^^^^^^^^^^^^^
107
108---------------------
109% perf bench sched pipe
110(executing 1000000 pipe operations between two tasks)
111
112 Total time:8.091 sec
113 8.091833 usecs/op
114 123581 ops/sec
115
116% perf bench sched pipe -l 1000 # loop 1000
117(executing 1000 pipe operations between two tasks)
118
119 Total time:0.016 sec
120 16.948000 usecs/op
121 59004 ops/sec
122---------------------
123
Namhyung Kim08942f62012-06-20 15:08:06 +0900124SUITES FOR 'mem'
125~~~~~~~~~~~~~~~~
126*memcpy*::
127Suite for evaluating performance of simple memory copy in various ways.
128
129Options of *memcpy*
130^^^^^^^^^^^^^^^^^^^
131-l::
132--length::
133Specify length of memory to copy (default: 1MB).
134Available units are B, KB, MB, GB and TB (case insensitive).
135
136-r::
137--routine::
138Specify routine to copy (default: default).
139Available routines are depend on the architecture.
140On x86-64, x86-64-unrolled, x86-64-movsq and x86-64-movsb are supported.
141
142-i::
143--iterations::
144Repeat memcpy invocation this number of times.
145
146-c::
Hitoshi Mitake17d7a112012-07-02 22:46:17 +0900147--cycle::
Namhyung Kim08942f62012-06-20 15:08:06 +0900148Use perf's cpu-cycles event instead of gettimeofday syscall.
149
150-o::
151--only-prefault::
152Show only the result with page faults before memcpy.
153
154-n::
155--no-prefault::
156Show only the result without page faults before memcpy.
157
158*memset*::
159Suite for evaluating performance of simple memory set in various ways.
160
161Options of *memset*
162^^^^^^^^^^^^^^^^^^^
163-l::
164--length::
165Specify length of memory to set (default: 1MB).
166Available units are B, KB, MB, GB and TB (case insensitive).
167
168-r::
169--routine::
170Specify routine to set (default: default).
171Available routines are depend on the architecture.
172On x86-64, x86-64-unrolled, x86-64-stosq and x86-64-stosb are supported.
173
174-i::
175--iterations::
176Repeat memset invocation this number of times.
177
178-c::
Hitoshi Mitake17d7a112012-07-02 22:46:17 +0900179--cycle::
Namhyung Kim08942f62012-06-20 15:08:06 +0900180Use perf's cpu-cycles event instead of gettimeofday syscall.
181
182-o::
183--only-prefault::
184Show only the result with page faults before memset.
185
186-n::
187--no-prefault::
188Show only the result without page faults before memset.
189
Hitoshi Mitake9fbc04f2009-11-10 20:50:54 +0900190SEE ALSO
191--------
192linkperf:perf[1]