mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-03 07:38:10 +00:00
selftests: timers: clocksource-switch: add command line switch to skip sanity check
The sanity check takes a while. If you do repeated checks when debugging, this is time consuming. Add a parameter to skip it. 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>
This commit is contained in:
parent
5be1fd963f
commit
19b6823a6e
1 changed files with 28 additions and 12 deletions
|
@ -119,12 +119,26 @@ int run_tests(int secs)
|
|||
|
||||
char clocksource_list[10][30];
|
||||
|
||||
int main(int argv, char **argc)
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
char orig_clk[512];
|
||||
int count, i, status;
|
||||
int count, i, status, opt;
|
||||
int do_sanity_check = 1;
|
||||
pid_t pid;
|
||||
|
||||
/* Process arguments */
|
||||
while ((opt = getopt(argc, argv, "s")) != -1) {
|
||||
switch (opt) {
|
||||
case 's':
|
||||
do_sanity_check = 0;
|
||||
break;
|
||||
default:
|
||||
printf("Usage: %s [-s]\n", argv[0]);
|
||||
printf(" -s: skip sanity checks\n");
|
||||
exit(-1);
|
||||
}
|
||||
}
|
||||
|
||||
get_cur_clocksource(orig_clk, 512);
|
||||
|
||||
count = get_clocksources(clocksource_list);
|
||||
|
@ -135,8 +149,10 @@ int main(int argv, char **argc)
|
|||
}
|
||||
|
||||
/* Check everything is sane before we start switching asynchronously */
|
||||
if (do_sanity_check) {
|
||||
for (i = 0; i < count; i++) {
|
||||
printf("Validating clocksource %s\n", clocksource_list[i]);
|
||||
printf("Validating clocksource %s\n",
|
||||
clocksource_list[i]);
|
||||
if (change_clocksource(clocksource_list[i])) {
|
||||
status = -1;
|
||||
goto out;
|
||||
|
@ -146,7 +162,7 @@ int main(int argv, char **argc)
|
|||
goto out;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
printf("Running Asynchronous Switching Tests...\n");
|
||||
pid = fork();
|
||||
|
|
Loading…
Reference in a new issue