summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Wagner <dwagner@suse.de>2021-05-19 19:09:26 +0200
committerJohn Kacur <jkacur@redhat.com>2021-05-21 17:38:36 -0400
commit868aceaf095db54bd85398438a7da658e23e307e (patch)
tree9e185cef498d7a61e520660aeff3d448ff6aa4f1
parentb63a591cbd879c11ce3cb4f52e32cb66b3b2d4c3 (diff)
downloadrt-tests-868aceaf095db54bd85398438a7da658e23e307e.tar.gz
pi_stress: Rename command line option --output to --json
The initial idea was to have several different output format supported but it turns out everyone is happy with JSON, so there is no need to add another format. Thus let's make the command line option more specific and rename it to --json. Signed-off-by: Daniel Wagner <dwagner@suse.de> Signed-off-by: John Kacur <jkacur@redhat.com>
-rw-r--r--src/pi_tests/pi_stress.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/pi_tests/pi_stress.c b/src/pi_tests/pi_stress.c
index 3f93d4a..7782ea7 100644
--- a/src/pi_tests/pi_stress.c
+++ b/src/pi_tests/pi_stress.c
@@ -100,7 +100,7 @@ int debugging = 0;
int quiet = 0; /* turn off all prints, default = 0 (off) */
/* filename for JSON output */
-char outfile[MAX_PATH];
+char jsonfile[MAX_PATH];
/* prompt to start test */
int prompt = 0;
@@ -342,8 +342,8 @@ int main(int argc, char **argv)
finish = time(NULL);
summary();
- if (strlen(outfile) != 0)
- rt_write_json(outfile, retval, write_stats, NULL);
+ if (strlen(jsonfile) != 0)
+ rt_write_json(jsonfile, retval, write_stats, NULL);
if (lockall)
munlockall();
@@ -992,8 +992,8 @@ void usage(int error)
"-g N --groups=N set the number of inversion groups\n"
"-h --help print this message\n"
"-i INV --inversions=INV number of inversions per group (default is infinite)\n"
+ " --json=FILENAME write final results into FILENAME, JSON formatted\n"
"-m --mlockall lock current and future memory\n"
- " --output=FILENAME write final results into FILENAME, JSON formatted\n"
"-p --prompt prompt before starting the test\n"
"-q --quiet suppress running output\n"
"-r --rr use SCHED_RR for test threads [SCHED_FIFO]\n"
@@ -1287,7 +1287,7 @@ int process_sched_line(const char *arg)
enum option_values {
OPT_DEBUG=1, OPT_DURATION, OPT_GROUPS, OPT_HELP, OPT_INVERSIONS,
- OPT_MLOCKALL, OPT_OUTPUT, OPT_PROMPT, OPT_QUIET, OPT_RR, OPT_SCHED,
+ OPT_JSON, OPT_MLOCKALL, OPT_PROMPT, OPT_QUIET, OPT_RR, OPT_SCHED,
OPT_UNIPROCESSOR, OPT_VERBOSE, OPT_VERSION,
};
@@ -1300,8 +1300,8 @@ void process_command_line(int argc, char **argv)
{"groups", required_argument, NULL, OPT_GROUPS},
{"help", no_argument, NULL, OPT_HELP},
{"inversions", required_argument, NULL, OPT_INVERSIONS},
+ {"json", required_argument, NULL, OPT_JSON},
{"mlockall", no_argument, NULL, OPT_MLOCKALL},
- {"output", required_argument, NULL, OPT_OUTPUT},
{"prompt", no_argument, NULL, OPT_PROMPT},
{"quiet", no_argument, NULL, OPT_QUIET},
{"rr", no_argument, NULL, OPT_RR},
@@ -1344,13 +1344,13 @@ void process_command_line(int argc, char **argv)
inversions = strtol(optarg, NULL, 10);
pi_info("doing %d inversion per group\n", inversions);
break;
+ case OPT_JSON:
+ strncpy(jsonfile, optarg, strnlen(optarg, MAX_PATH-1));
+ break;
case OPT_MLOCKALL:
case 'm':
lockall = 1;
break;
- case OPT_OUTPUT:
- strncpy(outfile, optarg, strnlen(optarg, MAX_PATH-1));
- break;
case OPT_PROMPT:
case 'p':
prompt = 1;