From: John Kacur <jkacur@redhat.com>
To: Clark Williams <williams@redhat.com>
Cc: John Kacur <jkacur@redhat.com>,
rt-users <linux-rt-users@vger.kernel.org>
Subject: [PATCH 2/3] rt-tests: pi_stress: Check whether quiet is set, before taking shutdown_mtx
Date: Thu, 19 Nov 2009 17:35:14 +0100 [thread overview]
Message-ID: <1258648515-7566-3-git-send-email-jkacur@redhat.com> (raw)
In-Reply-To: <1258648515-7566-2-git-send-email-jkacur@redhat.com>
- 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>
---
src/pi_tests/pi_stress.c | 13 ++++++-------
1 files changed, 6 insertions(+), 7 deletions(-)
diff --git a/src/pi_tests/pi_stress.c b/src/pi_tests/pi_stress.c
index 44c8f69..f4b43ed 100644
--- a/src/pi_tests/pi_stress.c
+++ b/src/pi_tests/pi_stress.c
@@ -109,8 +109,7 @@ int verbose = 0;
/* turn on debugging prints */
int debugging = 0;
-/* turn off all prints */
-int quiet = 0;
+int quiet = 0; /* turn off all prints, default = 0 (off) */
/* prompt to start test */
int prompt = 0;
@@ -141,7 +140,6 @@ struct option options[] = {
{"groups", required_argument, NULL, 'g'},
{"inversions", required_argument, NULL, 'i'},
{"rr", no_argument, NULL, 'r'},
- {"signal", no_argument, NULL, 's'},
{"uniprocessor", no_argument, NULL, 'u'},
{"prompt", no_argument, NULL, 'p'},
{"debug", no_argument, NULL, 'd'},
@@ -566,12 +564,12 @@ void *reporter(void *arg)
}
/* check for signaled shutdown */
- pthread_mutex_lock(&shutdown_mtx);
- if (shutdown == 0) {
- if (!quiet) {
+ if (!quiet) {
+ pthread_mutex_lock(&shutdown_mtx);
+ if (shutdown == 0) {
fputs(UP_ONE, stdout);
printf("Current Inversions: %lu\n",
- total_inversions());
+ total_inversions());
}
}
pthread_mutex_unlock(&shutdown_mtx);
@@ -1004,6 +1002,7 @@ void usage(void)
printf("usage: pi_stress <options>\n");
printf(" options:\n");
printf("\t--verbose\t- lots of output\n");
+ printf("\t--quiet\t\t- surpress running output\n");
printf
("\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",
--
1.6.2.5
next prev parent reply other threads:[~2009-11-19 16:35 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-11-19 16:35 [PATCH 0/3] rt-tests: pi_stress fixes John Kacur
2009-11-19 16:35 ` [PATCH 1/3] rt-tests: pi_stress: Use a pthread_mutex_t for the global variable shutdown John Kacur
2009-11-19 16:35 ` John Kacur [this message]
2009-11-19 16:35 ` [PATCH 3/3] rt-tests: pi_stress: Remove racy state variables that cause watchdog to trigger John Kacur
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1258648515-7566-3-git-send-email-jkacur@redhat.com \
--to=jkacur@redhat.com \
--cc=linux-rt-users@vger.kernel.org \
--cc=williams@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).