-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbm.1
116 lines (116 loc) · 2.47 KB
/
bm.1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
.TH BM 1 "2 May 2024"
.SH NAME
bm \- benchmark commands
.SH SYNOPSIS
.PP
\fBbm\fP
[\fIoptions\fP...]
\fIcommand\fP
['\fB;\fP' \fIcommand\fP]...
.PP
\fBbm\fP
\fB\-a\fP
[\fIoptions\fP...]
\fIargs\fP '\fB;\fP'
\fIcommand\fP
['\fB;\fP' \fIcommand\fP]...
.PP
\fBbm\fP
\fB\-A\fP
[\fIoptions\fP...]
\fIargs\fP '\fB;\fP'
\fIutility\fP
[\fIutility\fP]...
.PP
\fBbm\fP
\fB\-c\fP
[\fIoptions\fP...]
\fIcommand\fP '\fB;\fP'
\fIargs\fP
['\fB;\fP' \fIargs\fP]...
.PP
\fBbm\fP
\fB\-C\fP
[\fIoptions\fP...]
\fItemplate\fP '\fB;\fP'
\fIarg\fP
[\fIarg\fP]...
.SH DESCRIPTION
.B bm
runs commands repeatedly and reports how long on average each of them take to
complete. It takes the following options and operands.
.TP
\fB\-i\fP \fIinfile\fP
Direct the standard input of each command from the file \fIinfile\fP. This file
is reopened for each run.
.TP
\fB\-q\fP
Direct the standard error of each command to its standard output, which is
always directed to \fB/dev/null\fP.
.TP
\fB\-n\fP \fIruns\fP
Run each command
.I runs
times. 1000 by default.
.TP
\fB\-k\fP \fIsample\fP
Consider only
.I sample
randomly selected runs of each command. Each command is run at least
.I sample
times even if a smaller number is specified with \fB\-n\fP. 100 by default.
.TP
\fB\-j\fP \fIjobs\fP
Perform
.I jobs
runs concurrently. 1 by default.
.TP
\fB\-j\fP\ \fIjobs\fP \fB\-P\fP
Run
.I jobs
commands in parallel. Unlimited by default, 1 if \fB\-P\fP is specified alone.
.TP
\fB\-z\fP \fIsleep\fP
Sleep
.I sleep
milliseconds between runs of a command. 0 by default.
.TP
\fIargs\fP
Optionally empty list of additional arguments. The following options control
how it is used.
.RS
.TP
\fB\-a\fP
Argument list \fIargs\fP is appended to each \fIcommand\fP.
.TP
\fB\-A\fP
Each \fIutility\fP is run with argument list \fIargs\fP.
.TP
\fB\-c\fP
Each argument list \fIargs\fP is prepended with \fIcommand\fP.
.RE
.TP
\fIcommand\fP
A utility name optionally followed by arguments.
.TP
\fIutility\fP
The name of a utility.
.TP
\fIarg\fP
A single argument.
.TP
\fItemplate\fP
A command template. The first word matching the string
.B {}
is replaced with each \fIarg\fP.
.IP '\fB;\fP'
A semicolon. Used for separating groups of operands. This needs to be quoted in
most shells.
.PP
.B bm
scans each command for arguments consisting of one or more backslashes followed
by a semicolon or the string \fB{}\fP, and removes one backslash from each.
.PP
.B bm
forks itself for each command. Each fork prints the percentage of runs it has
completed to standard error if sent a USR1 signal.