diff options
author | Daniel Wagner <wagi@monom.org> | 2019-06-05 15:50:56 +0200 |
---|---|---|
committer | John Kacur <jkacur@redhat.com> | 2019-06-19 01:04:14 +0200 |
commit | a037de86a6ff48f361dace1c4ce50c1dae1eab65 (patch) | |
tree | f8ea29ce86ce91d3009f816d9268d4e830b86820 | |
parent | 81f63a4ebd511befc49332db351ce11b4fef40d6 (diff) | |
download | rt-tests-a037de86a6ff48f361dace1c4ce50c1dae1eab65.tar.gz rt-tests-a037de86a6ff48f361dace1c4ce50c1dae1eab65.tar.xz |
pi_stress: Rename -t command line option to -D
Streamline the duration command line argument for all rt-tests. While
at it also add man page.
Signed-off-by: Daniel Wagner <wagi@monom.org>
Signed-off-by: John Kacur <jkacur@redhat.com>
-rw-r--r-- | src/pi_tests/pi_stress.8 | 4 | ||||
-rw-r--r-- | src/pi_tests/pi_stress.c | 11 |
2 files changed, 10 insertions, 5 deletions
diff --git a/src/pi_tests/pi_stress.8 b/src/pi_tests/pi_stress.8 index c92b4bd..475d3c3 100644 --- a/src/pi_tests/pi_stress.8 +++ b/src/pi_tests/pi_stress.8 @@ -57,6 +57,10 @@ seconds and then terminate. The number of inversion groups to run. Defaults to 10. .IP \-d|\-\-debug Run in debug mode; lots of extra prints +.IP "\-D, \-\-duration=TIME" +Specify a length for the test run. +.br +Append 'm', 'h', or 'd' to specify minutes, hours or days. .IP \-v|\-\-verbose Run with verbose messages .IP \-s|\-\-signal diff --git a/src/pi_tests/pi_stress.c b/src/pi_tests/pi_stress.c index 543106b..1286370 100644 --- a/src/pi_tests/pi_stress.c +++ b/src/pi_tests/pi_stress.c @@ -146,7 +146,7 @@ int lockall = 0; /* command line options */ struct option options[] = { - {"duration", required_argument, NULL, 't'}, + {"duration", required_argument, NULL, 'D'}, {"verbose", no_argument, NULL, 'v'}, {"quiet", no_argument, NULL, 'q'}, {"groups", required_argument, NULL, 'g'}, @@ -1027,7 +1027,8 @@ void usage(void) printf("\t--verbose\t- lots of output\n"); printf("\t--quiet\t\t- suppress running output\n"); printf - ("\t--duration=<n>- length of the test run in seconds [infinite]\n"); + ("\t--duration=<n>\t- length of the test run in seconds [infinite]\n"); + printf("\t\t\t Append 'm', 'h', or 'd' to specify minutes, hours or days.\n"); printf("\t--groups=<n>\t- set the number of inversion groups [%d]\n", ngroups); printf @@ -1322,13 +1323,13 @@ int process_sched_line(const char *arg) void process_command_line(int argc, char **argv) { int opt; - while ((opt = getopt_long(argc, argv, "+ht:vqi:g:rs:pdVum", options, NULL)) != -1) { + while ((opt = getopt_long(argc, argv, "+hD:vqi:g:rs:pdVum", options, NULL)) != -1) { switch (opt) { case 'h': usage(); exit(0); - case 't': - duration = strtol(optarg, NULL, 10); + case 'D': + duration = parse_time_string(optarg); break; case 'v': verbose = 1; |