* [PATCH v2] selftests: timers: clocksource-switch: add 'runtime' command line parameter
@ 2022-07-14 18:57 Wolfram Sang
2022-07-14 20:48 ` Shuah Khan
0 siblings, 1 reply; 2+ messages in thread
From: Wolfram Sang @ 2022-07-14 18:57 UTC (permalink / raw)
To: linux-renesas-soc
Cc: Wolfram Sang, John Stultz, Thomas Gleixner, Stephen Boyd,
Shuah Khan, linux-kernel, linux-kselftest
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
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH v2] selftests: timers: clocksource-switch: add 'runtime' command line parameter
2022-07-14 18:57 [PATCH v2] selftests: timers: clocksource-switch: add 'runtime' command line parameter Wolfram Sang
@ 2022-07-14 20:48 ` Shuah Khan
0 siblings, 0 replies; 2+ messages in thread
From: Shuah Khan @ 2022-07-14 20:48 UTC (permalink / raw)
To: Wolfram Sang, linux-renesas-soc
Cc: John Stultz, Thomas Gleixner, Stephen Boyd, Shuah Khan,
linux-kernel, linux-kselftest, Shuah Khan
On 7/14/22 12:57 PM, Wolfram Sang wrote:
> 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
>
>
Applied to linux-kselftest next for 5.20-rc1 with the rest of
v1 patches in this series.
thanks,
-- Shuah
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-07-14 20:48 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-14 18:57 [PATCH v2] selftests: timers: clocksource-switch: add 'runtime' command line parameter Wolfram Sang
2022-07-14 20:48 ` Shuah Khan
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).