rt-tests: pi_stress: Check whether quiet is set, before taking shutdown_mtx
- Check whether quiet is set, before taking shutdown_mtx - Add quiet to the help menu. - Remove unused "signal" from struct options Signed-off-by: John Kacur <jkacur@redhat.com>
This commit is contained in:
parent
9ee4dcad03
commit
cf46ad44b9
|
@ -109,8 +109,7 @@ int verbose = 0;
|
||||||
/* turn on debugging prints */
|
/* turn on debugging prints */
|
||||||
int debugging = 0;
|
int debugging = 0;
|
||||||
|
|
||||||
/* turn off all prints */
|
int quiet = 0; /* turn off all prints, default = 0 (off) */
|
||||||
int quiet = 0;
|
|
||||||
|
|
||||||
/* prompt to start test */
|
/* prompt to start test */
|
||||||
int prompt = 0;
|
int prompt = 0;
|
||||||
|
@ -141,7 +140,6 @@ struct option options[] = {
|
||||||
{"groups", required_argument, NULL, 'g'},
|
{"groups", required_argument, NULL, 'g'},
|
||||||
{"inversions", required_argument, NULL, 'i'},
|
{"inversions", required_argument, NULL, 'i'},
|
||||||
{"rr", no_argument, NULL, 'r'},
|
{"rr", no_argument, NULL, 'r'},
|
||||||
{"signal", no_argument, NULL, 's'},
|
|
||||||
{"uniprocessor", no_argument, NULL, 'u'},
|
{"uniprocessor", no_argument, NULL, 'u'},
|
||||||
{"prompt", no_argument, NULL, 'p'},
|
{"prompt", no_argument, NULL, 'p'},
|
||||||
{"debug", no_argument, NULL, 'd'},
|
{"debug", no_argument, NULL, 'd'},
|
||||||
|
@ -566,12 +564,12 @@ void *reporter(void *arg)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* check for signaled shutdown */
|
/* check for signaled shutdown */
|
||||||
pthread_mutex_lock(&shutdown_mtx);
|
if (!quiet) {
|
||||||
if (shutdown == 0) {
|
pthread_mutex_lock(&shutdown_mtx);
|
||||||
if (!quiet) {
|
if (shutdown == 0) {
|
||||||
fputs(UP_ONE, stdout);
|
fputs(UP_ONE, stdout);
|
||||||
printf("Current Inversions: %lu\n",
|
printf("Current Inversions: %lu\n",
|
||||||
total_inversions());
|
total_inversions());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
pthread_mutex_unlock(&shutdown_mtx);
|
pthread_mutex_unlock(&shutdown_mtx);
|
||||||
|
@ -1004,6 +1002,7 @@ void usage(void)
|
||||||
printf("usage: pi_stress <options>\n");
|
printf("usage: pi_stress <options>\n");
|
||||||
printf(" options:\n");
|
printf(" options:\n");
|
||||||
printf("\t--verbose\t- lots of output\n");
|
printf("\t--verbose\t- lots of output\n");
|
||||||
|
printf("\t--quiet\t\t- surpress running output\n");
|
||||||
printf
|
printf
|
||||||
("\t--duration=<n>- length of the test run in seconds [infinite]\n");
|
("\t--duration=<n>- length of the test run in seconds [infinite]\n");
|
||||||
printf("\t--groups=<n>\t- set the number of inversion groups [%d]\n",
|
printf("\t--groups=<n>\t- set the number of inversion groups [%d]\n",
|
||||||
|
|
Loading…
Reference in New Issue