Skip to content

Commit

Permalink
Clarify what tool-specific options are
Browse files Browse the repository at this point in the history
Fixes distributed-system-analysis#3443

Modify the help message of pbench-register-tool to
warn against using generic options 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 generic
options and which are tool-specific options.

PBENCH-1173
  • Loading branch information
ndokos committed May 31, 2023
1 parent 2915816 commit 637dd25
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
8 changes: 7 additions & 1 deletion agent/tool-scripts/base-tool
Original file line number Diff line number Diff line change
Expand Up @@ -191,9 +191,13 @@ esac

function usage {
printf -- "The following options are available:\n\n"
printf -- "Generic options - do *not* specify any of these when you register a tool:\n\n"
printf -- "\t--install verify this perf tool will work\n\n"
printf -- "\t--start|stop|postprocess start/stop/postprocess the data collection\n"
printf -- "\t-d str|--dir=str directory to store data collection (required)\n"

printf -- "\n\nTool-specific options - these should be specified when you register a tool:\n\n"

case "${tool}" in
blktrace|bpftrace|kvmtrace|lockstat|oc|perf|strace|systemtap|tcpdump)
: # These tools don't use interval
Expand Down Expand Up @@ -278,6 +282,8 @@ function usage {
printf -- "\t but not both at the same time\n"
;;
esac

printf -- "Help option - do *not* specify this when you register a tool:\n\n"
printf -- "\n\t-h|--help display this help message\n"
}

Expand Down Expand Up @@ -582,7 +588,7 @@ install)
local _installed_rpm
local _rc
_installed_rpm="$(require-rpm "${_tpn}" "${_tpv}")"
_rc=${?}
_rc=${?}
if [[ ${_rc} != 0 ]]; then
printf -- "%s: %s is not installed\n" "${tool}" "${_tpn}${_tpv:+-${_tpv}}" >&2
else
Expand Down
4 changes: 4 additions & 0 deletions agent/util-scripts/pbench-register-tool
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,10 @@ function usage() {
# (no tab) 12345678901234567890123456789012345678901234567890123456789012345678901234567890
printf -- "\nFor a list of tool specific options, run:\n"
printf -- "\t${pbench_bin}/tool-scripts/<tool-name> --help\n"

printf -- "The tools have a few generic options (marked as such in the help message)\n"
printf -- "which are used internally by pbench: you should *NOT* specify those when you"
printf -- "register a tool.\n"
}

# Process options and arguments
Expand Down

0 comments on commit 637dd25

Please sign in to comment.