All of lore.kernel.org
 help / color / mirror / Atom feed
From: Wolfram Sang <wsa+renesas@sang-engineering.com>
To: linux-renesas-soc@vger.kernel.org
Cc: Wolfram Sang <wsa+renesas@sang-engineering.com>,
	John Stultz <jstultz@google.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	Stephen Boyd <sboyd@kernel.org>, Shuah Khan <shuah@kernel.org>,
	linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org
Subject: [PATCH v2] selftests: timers: clocksource-switch: add 'runtime' command line parameter
Date: Thu, 14 Jul 2022 20:57:21 +0200	[thread overview]
Message-ID: <20220714185721.48125-1-wsa+renesas@sang-engineering.com> (raw)

So the user can decide how long the test should run.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Acked-by: John Stultz <jstultz@google.com>
---

Change since V1:
* added the new parameter to the help printout

 tools/testing/selftests/timers/clocksource-switch.c | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/tools/testing/selftests/timers/clocksource-switch.c b/tools/testing/selftests/timers/clocksource-switch.c
index 5256e6215980..577e4b74211a 100644
--- a/tools/testing/selftests/timers/clocksource-switch.c
+++ b/tools/testing/selftests/timers/clocksource-switch.c
@@ -124,17 +124,22 @@ int main(int argc, char **argv)
 	char orig_clk[512];
 	int count, i, status, opt;
 	int do_sanity_check = 1;
+	int runtime = 60;
 	pid_t pid;
 
 	/* Process arguments */
-	while ((opt = getopt(argc, argv, "s")) != -1) {
+	while ((opt = getopt(argc, argv, "st:")) != -1) {
 		switch (opt) {
 		case 's':
 			do_sanity_check = 0;
 			break;
+		case 't':
+			runtime = atoi(optarg);
+			break;
 		default:
-			printf("Usage: %s [-s]\n", argv[0]);
+			printf("Usage: %s [-s] [-t <secs>]\n", argv[0]);
 			printf("	-s: skip sanity checks\n");
+			printf("	-t: Number of seconds to run\n");
 			exit(-1);
 		}
 	}
@@ -167,7 +172,7 @@ int main(int argc, char **argv)
 	printf("Running Asynchronous Switching Tests...\n");
 	pid = fork();
 	if (!pid)
-		return run_tests(60);
+		return run_tests(runtime);
 
 	while (pid != waitpid(pid, &status, WNOHANG))
 		for (i = 0; i < count; i++)
-- 
2.35.1


             reply	other threads:[~2022-07-14 18:58 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-14 18:57 Wolfram Sang [this message]
2022-07-14 20:48 ` [PATCH v2] selftests: timers: clocksource-switch: add 'runtime' command line parameter Shuah Khan

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=20220714185721.48125-1-wsa+renesas@sang-engineering.com \
    --to=wsa+renesas@sang-engineering.com \
    --cc=jstultz@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=sboyd@kernel.org \
    --cc=shuah@kernel.org \
    --cc=tglx@linutronix.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.