From: Daniel Wagner <dwagner@suse.de>
To: Clark Williams <williams@redhat.com>, John Kacur <jkacur@redhat.com>
Cc: linux-rt-users@vger.kernel.org, Daniel Wagner <dwagner@suse.de>
Subject: [rt-tests v1 12/12] rt-migrate-test: Add quiet command line option
Date: Wed, 18 Nov 2020 20:06:42 +0100 [thread overview]
Message-ID: <20201118190642.16006-13-dwagner@suse.de> (raw)
In-Reply-To: <20201118190642.16006-1-dwagner@suse.de>
The quiet option is useful for automated test setups where
only the final result of the run is interesting. This avoids
to fill up the logs.
Signed-off-by: Daniel Wagner <dwagner@suse.de>
---
src/rt-migrate-test/rt-migrate-test.c | 12 +++++++++---
1 file changed, 9 insertions(+), 3 deletions(-)
diff --git a/src/rt-migrate-test/rt-migrate-test.c b/src/rt-migrate-test/rt-migrate-test.c
index f1b7e5e4fe8c..9bf716c9178c 100644
--- a/src/rt-migrate-test/rt-migrate-test.c
+++ b/src/rt-migrate-test/rt-migrate-test.c
@@ -98,6 +98,7 @@ static unsigned long long now;
static int done;
static int loop;
static int duration;
+static int quiet;
static pthread_barrier_t start_barrier;
static pthread_barrier_t end_barrier;
@@ -160,6 +161,7 @@ static void usage(int error)
"-l LOOPS --loops=LOOPS Number of iterations to run (50)\n"
"-m TIME --maxerr=TIME Max allowed error (microsecs)\n"
"-p PRIO --prio=PRIO base priority to start RT tasks with (2)\n"
+ "-q --quiet print a summary only on exit\n"
"-r TIME --run-time=TIME Run time (ms) to busy loop the threads (20)\n"
"-s TIME --sleep-time=TIME Sleep time (ms) between intervals (100)\n\n"
" () above are defaults \n"
@@ -180,11 +182,12 @@ static void parse_options(int argc, char *argv[])
{"loops", required_argument, NULL, 'l'},
{"maxerr", required_argument, NULL, 'm'},
{"prio", required_argument, NULL, 'p'},
+ {"quiet", no_argument, NULL, 'q'},
{"run-time", required_argument, NULL, 'r'},
{"sleep-time", required_argument, NULL, 's'},
{NULL, 0, NULL, 0}
};
- int c = getopt_long(argc, argv, "cD:ehl:m:p:r:s:",
+ int c = getopt_long(argc, argv, "cD:ehl:m:p:qr:s:",
long_options, &option_index);
if (c == -1)
break;
@@ -199,6 +202,7 @@ static void parse_options(int argc, char *argv[])
case 'l': nr_runs = atoi(optarg); break;
case 'm': max_err = usec2nano(atoi(optarg)); break;
case 'p': prio_start = atoi(optarg); break;
+ case 'q': quiet = 1; break;
case 'r':
run_interval = atoi(optarg);
break;
@@ -532,7 +536,8 @@ int main (int argc, char **argv)
intv.tv_sec = nano2sec(INTERVAL);
intv.tv_nsec = INTERVAL % sec2nano(1);
- print_progress_bar(0);
+ if (!quiet)
+ print_progress_bar(0);
setup_ftrace_marker();
@@ -552,7 +557,8 @@ int main (int argc, char **argv)
nanosleep(&intv, NULL);
- print_progress_bar((loop * 100)/nr_runs);
+ if (!quiet)
+ print_progress_bar((loop * 100)/nr_runs);
end = get_time();
ftrace_write("Loop %d end now=%lld diff=%lld\n", loop, end, end - now);
--
2.29.2
next prev parent reply other threads:[~2020-11-18 19:07 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-11-18 19:06 [rt-tests v1 00/12] Add quiet command line option Daniel Wagner
2020-11-18 19:06 ` [rt-tests v1 01/12] cyclicdeadline: Remove dead code Daniel Wagner
2020-11-19 6:54 ` Punit Agrawal
2020-11-19 8:19 ` Daniel Wagner
2020-12-01 6:30 ` John Kacur
2020-12-01 8:21 ` Daniel Wagner
2020-11-18 19:06 ` [rt-tests v1 02/12] cyclicdeadline: Use common error handlers Daniel Wagner
2020-12-01 6:57 ` John Kacur
2020-11-18 19:06 ` [rt-tests v1 03/12] cyclicdeadline: Add quiet command line option Daniel Wagner
2020-12-01 7:00 ` John Kacur
2020-11-18 19:06 ` [rt-tests v1 04/12] pmqtest: Move statictic output into print_stat() Daniel Wagner
2020-12-01 7:02 ` John Kacur
2020-11-18 19:06 ` [rt-tests v1 05/12] pmqtest: Add quiet command line option Daniel Wagner
2020-12-01 7:04 ` John Kacur
2020-11-18 19:06 ` [rt-tests v1 06/12] ptsematest: Move statictic output into print_stat() Daniel Wagner
2020-12-01 7:06 ` John Kacur
2020-11-18 19:06 ` [rt-tests v1 07/12] ptsematest: Add quiet command line option Daniel Wagner
2020-12-01 7:09 ` John Kacur
2020-11-18 19:06 ` [rt-tests v1 08/12] svsematest: Move statictic output into print_stat() Daniel Wagner
2020-12-01 7:11 ` John Kacur
2020-11-18 19:06 ` [rt-tests v1 09/12] svsematest: Add quiet command line option Daniel Wagner
2020-12-01 7:12 ` John Kacur
2020-11-18 19:06 ` [rt-tests v1 10/12] sigwaittest: Move statictic output into print_stat() Daniel Wagner
2020-12-01 7:14 ` John Kacur
2020-11-18 19:06 ` [rt-tests v1 11/12] sigwaittest: Add quiet command line option Daniel Wagner
2020-12-01 7:16 ` John Kacur
2020-11-18 19:06 ` Daniel Wagner [this message]
2020-12-01 7:17 ` [rt-tests v1 12/12] rt-migrate-test: " John Kacur
2020-11-20 16:33 ` [rt-tests v1 00/12] " Daniel Wagner
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=20201118190642.16006-13-dwagner@suse.de \
--to=dwagner@suse.de \
--cc=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