Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

selftests: timers: clocksource-switch: add 'runtime' command line parameter

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>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>

authored by

Wolfram Sang and committed by
Shuah Khan
248ae6f4 19b6823a

+8 -3
+8 -3
tools/testing/selftests/timers/clocksource-switch.c
··· 124 124 char orig_clk[512]; 125 125 int count, i, status, opt; 126 126 int do_sanity_check = 1; 127 + int runtime = 60; 127 128 pid_t pid; 128 129 129 130 /* Process arguments */ 130 - while ((opt = getopt(argc, argv, "s")) != -1) { 131 + while ((opt = getopt(argc, argv, "st:")) != -1) { 131 132 switch (opt) { 132 133 case 's': 133 134 do_sanity_check = 0; 134 135 break; 136 + case 't': 137 + runtime = atoi(optarg); 138 + break; 135 139 default: 136 - printf("Usage: %s [-s]\n", argv[0]); 140 + printf("Usage: %s [-s] [-t <secs>]\n", argv[0]); 137 141 printf(" -s: skip sanity checks\n"); 142 + printf(" -t: Number of seconds to run\n"); 138 143 exit(-1); 139 144 } 140 145 } ··· 172 167 printf("Running Asynchronous Switching Tests...\n"); 173 168 pid = fork(); 174 169 if (!pid) 175 - return run_tests(60); 170 + return run_tests(runtime); 176 171 177 172 while (pid != waitpid(pid, &status, WNOHANG)) 178 173 for (i = 0; i < count; i++)