Skip to content

Commit c560bdf

Browse files
authored
Clarify what tool-specific options are (#3444)
Fixes #3443 Modify the help message of pbench-register-tool to warn against using operational options (i.e. options used internally by pbench) for a tool when it is registered. Modify the help message of base-tool (and everybody who is symlinked to it) to clarify which are operational options and which are tool-specific options: operational options should not be specified when registering a tool: they are used by pbench internally; only tool-specific options are specifed when registering the tool (on the RHS of `--` in the invocation of `pbench-register-tool`). PBENCH-1173
1 parent 5fe6a7b commit c560bdf

File tree

42 files changed

+329
-5
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+329
-5
lines changed

agent/tool-scripts/base-tool

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -191,17 +191,26 @@ esac
191191

192192
function usage {
193193
printf -- "The following options are available:\n\n"
194+
printf -- "Operational options - do *not* specify any of these when you register a tool:\n\n"
194195
printf -- "\t--install verify this perf tool will work\n\n"
195196
printf -- "\t--start|stop|postprocess start/stop/postprocess the data collection\n"
196197
printf -- "\t-d str|--dir=str directory to store data collection (required)\n"
198+
199+
printf -- "\nTool-specific options - these should be specified when you register a tool:\n\n"
200+
197201
case "${tool}" in
198-
blktrace|bpftrace|kvmtrace|lockstat|oc|perf|strace|systemtap|tcpdump)
199-
: # These tools don't use interval
202+
lockstat)
203+
: # Tools that don't take *any* tool-specific options
204+
printf -- "\tNo tool-specific options for this tool\n"
205+
;;
206+
blktrace|bpftrace|kvmtrace|oc|perf|strace|systemtap|tcpdump)
207+
: # Tools that don't use '--interval' but take other tool-specific options
200208
;;
201209
*)
202210
printf -- "\t--interval=int number of seconds between each data collection (optional, default is %s seconds)\n" "${def_interval}"
203211
;;
204212
esac
213+
205214
case "${tool}" in
206215
blktrace)
207216
printf -- "\t--devices=str,[str] the list of block devices to trace (required w/ --start)\n"
@@ -278,7 +287,9 @@ function usage {
278287
printf -- "\t but not both at the same time\n"
279288
;;
280289
esac
281-
printf -- "\n\t-h|--help display this help message\n"
290+
291+
printf -- "\nHelp option - do *not* specify this when you register a tool:\n\n"
292+
printf -- "\t-h|--help display this help message\n\n"
282293
}
283294

284295
# Process options and arguments
@@ -582,7 +593,7 @@ install)
582593
local _installed_rpm
583594
local _rc
584595
_installed_rpm="$(require-rpm "${_tpn}" "${_tpv}")"
585-
_rc=${?}
596+
_rc=${?}
586597
if [[ ${_rc} != 0 ]]; then
587598
printf -- "%s: %s is not installed\n" "${tool}" "${_tpn}${_tpv:+-${_tpv}}" >&2
588599
else

agent/tool-scripts/tests/blktrace/gold/stderr

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,20 @@ blktrace: Error, one of the following options is required, --install|--start|--s
22

33
The following options are available:
44

5+
Operational options - do *not* specify any of these when you register a tool:
6+
57
--install verify this perf tool will work
68

79
--start|stop|postprocess start/stop/postprocess the data collection
810
-d str|--dir=str directory to store data collection (required)
11+
12+
Tool-specific options - these should be specified when you register a tool:
13+
914
--devices=str,[str] the list of block devices to trace (required w/ --start)
1015

16+
Help option - do *not* specify this when you register a tool:
17+
1118
-h|--help display this help message
19+
1220
blktrace: WARNING - postprocess - tool output directory, '/var/tmp/pbench-test-tool-scripts/blktrace/tools-group/blktrace', missing
1321
blktrace: WARNING - stop - tool output directory, '/var/tmp/pbench-test-tool-scripts/blktrace/tools-group/blktrace', missing

agent/tool-scripts/tests/bpftrace/gold/stderr

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,20 @@ bpftrace: Error, one of the following options is required, --install|--start|--s
22

33
The following options are available:
44

5+
Operational options - do *not* specify any of these when you register a tool:
6+
57
--install verify this perf tool will work
68

79
--start|stop|postprocess start/stop/postprocess the data collection
810
-d str|--dir=str directory to store data collection (required)
11+
12+
Tool-specific options - these should be specified when you register a tool:
13+
914
--script=str path to the bpftrace script (required w/ --start)
1015

16+
Help option - do *not* specify this when you register a tool:
17+
1118
-h|--help display this help message
19+
1220
bpftrace: WARNING - postprocess - tool output directory, '/var/tmp/pbench-test-tool-scripts/bpftrace/tools-group/bpftrace', missing
1321
bpftrace: WARNING - stop - tool output directory, '/var/tmp/pbench-test-tool-scripts/bpftrace/tools-group/bpftrace', missing

agent/tool-scripts/tests/cpuacct/gold/stderr

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,20 @@ cpuacct: Error, one of the following options is required, --install|--start|--st
22

33
The following options are available:
44

5+
Operational options - do *not* specify any of these when you register a tool:
6+
57
--install verify this perf tool will work
68

79
--start|stop|postprocess start/stop/postprocess the data collection
810
-d str|--dir=str directory to store data collection (required)
11+
12+
Tool-specific options - these should be specified when you register a tool:
13+
914
--interval=int number of seconds between each data collection (optional, default is 10 seconds)
1015

16+
Help option - do *not* specify this when you register a tool:
17+
1118
-h|--help display this help message
19+
1220
cpuacct: WARNING - postprocess - tool output directory, '/var/tmp/pbench-test-tool-scripts/cpuacct/tools-group/cpuacct', missing
1321
cpuacct: WARNING - stop - tool output directory, '/var/tmp/pbench-test-tool-scripts/cpuacct/tools-group/cpuacct', missing

agent/tool-scripts/tests/disk/gold/stderr

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,20 @@ disk: Error, one of the following options is required, --install|--start|--stop|
22

33
The following options are available:
44

5+
Operational options - do *not* specify any of these when you register a tool:
6+
57
--install verify this perf tool will work
68

79
--start|stop|postprocess start/stop/postprocess the data collection
810
-d str|--dir=str directory to store data collection (required)
11+
12+
Tool-specific options - these should be specified when you register a tool:
13+
914
--interval=int number of seconds between each data collection (optional, default is 10 seconds)
1015

16+
Help option - do *not* specify this when you register a tool:
17+
1118
-h|--help display this help message
19+
1220
disk: WARNING - postprocess - tool output directory, '/var/tmp/pbench-test-tool-scripts/disk/tools-group/disk', missing
1321
disk: WARNING - stop - tool output directory, '/var/tmp/pbench-test-tool-scripts/disk/tools-group/disk', missing

agent/tool-scripts/tests/dm-cache/gold/stderr

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,20 @@ dm-cache: Error, one of the following options is required, --install|--start|--s
22

33
The following options are available:
44

5+
Operational options - do *not* specify any of these when you register a tool:
6+
57
--install verify this perf tool will work
68

79
--start|stop|postprocess start/stop/postprocess the data collection
810
-d str|--dir=str directory to store data collection (required)
11+
12+
Tool-specific options - these should be specified when you register a tool:
13+
914
--interval=int number of seconds between each data collection (optional, default is 10 seconds)
1015

16+
Help option - do *not* specify this when you register a tool:
17+
1118
-h|--help display this help message
19+
1220
dm-cache: WARNING - postprocess - tool output directory, '/var/tmp/pbench-test-tool-scripts/dm-cache/tools-group/dm-cache', missing
1321
dm-cache: WARNING - stop - tool output directory, '/var/tmp/pbench-test-tool-scripts/dm-cache/tools-group/dm-cache', missing

agent/tool-scripts/tests/docker-info/gold/stderr

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,20 @@ docker-info: Error, one of the following options is required, --install|--start|
22

33
The following options are available:
44

5+
Operational options - do *not* specify any of these when you register a tool:
6+
57
--install verify this perf tool will work
68

79
--start|stop|postprocess start/stop/postprocess the data collection
810
-d str|--dir=str directory to store data collection (required)
11+
12+
Tool-specific options - these should be specified when you register a tool:
13+
914
--interval=int number of seconds between each data collection (optional, default is 10 seconds)
1015

16+
Help option - do *not* specify this when you register a tool:
17+
1118
-h|--help display this help message
19+
1220
docker-info: WARNING - postprocess - tool output directory, '/var/tmp/pbench-test-tool-scripts/docker-info/tools-group/docker-info', missing
1321
docker-info: WARNING - stop - tool output directory, '/var/tmp/pbench-test-tool-scripts/docker-info/tools-group/docker-info', missing

agent/tool-scripts/tests/docker/gold/stderr

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,20 @@ docker: Error, one of the following options is required, --install|--start|--sto
22

33
The following options are available:
44

5+
Operational options - do *not* specify any of these when you register a tool:
6+
57
--install verify this perf tool will work
68

79
--start|stop|postprocess start/stop/postprocess the data collection
810
-d str|--dir=str directory to store data collection (required)
11+
12+
Tool-specific options - these should be specified when you register a tool:
13+
914
--interval=int number of seconds between each data collection (optional, default is 10 seconds)
1015

16+
Help option - do *not* specify this when you register a tool:
17+
1118
-h|--help display this help message
19+
1220
docker: WARNING - postprocess - tool output directory, '/var/tmp/pbench-test-tool-scripts/docker/tools-group/docker', missing
1321
docker: WARNING - stop - tool output directory, '/var/tmp/pbench-test-tool-scripts/docker/tools-group/docker', missing

agent/tool-scripts/tests/haproxy-ocp/gold/stderr

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,21 @@ haproxy-ocp: Error, one of the following options is required, --install|--start|
22

33
The following options are available:
44

5+
Operational options - do *not* specify any of these when you register a tool:
6+
57
--install verify this perf tool will work
68

79
--start|stop|postprocess start/stop/postprocess the data collection
810
-d str|--dir=str directory to store data collection (required)
11+
12+
Tool-specific options - these should be specified when you register a tool:
13+
914
--interval=int number of seconds between each data collection (optional, default is 10 seconds)
1015
--counters-clear-all clear all HAProxy counters at tool start (optional, default: 'false')
1116

17+
Help option - do *not* specify this when you register a tool:
18+
1219
-h|--help display this help message
20+
1321
haproxy-ocp: WARNING - postprocess - tool output directory, '/var/tmp/pbench-test-tool-scripts/haproxy-ocp/tools-group/haproxy-ocp', missing
1422
haproxy-ocp: WARNING - stop - tool output directory, '/var/tmp/pbench-test-tool-scripts/haproxy-ocp/tools-group/haproxy-ocp', missing

agent/tool-scripts/tests/iostat/gold/stderr

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,21 @@ iostat: Error, one of the following options is required, --install|--start|--sto
22

33
The following options are available:
44

5+
Operational options - do *not* specify any of these when you register a tool:
6+
57
--install verify this perf tool will work
68

79
--start|stop|postprocess start/stop/postprocess the data collection
810
-d str|--dir=str directory to store data collection (required)
11+
12+
Tool-specific options - these should be specified when you register a tool:
13+
914
--interval=int number of seconds between each data collection (optional, default is 10 seconds)
1015
--options=str options passed directly to the tool (optional)
1116

17+
Help option - do *not* specify this when you register a tool:
18+
1219
-h|--help display this help message
20+
1321
iostat: WARNING - postprocess - tool output directory, '/var/tmp/pbench-test-tool-scripts/iostat/tools-group/iostat', missing
1422
iostat: WARNING - stop - tool output directory, '/var/tmp/pbench-test-tool-scripts/iostat/tools-group/iostat', missing

0 commit comments

Comments
 (0)