Skip to content

Commit 98b74e1

Browse files
johnstultz-workShuah Khan
authored andcommitted
kselftests: timers: leap-a-day: Change default arguments to help test runs
Change default arguments for leap-a-day to always set the time each iteration (rather then waiting for midnight UTC), and to only run 10 interations (rather then infinite). If one wants to wait for midnight UTC, they can use the new -w flag, and we add a note to the argument help that -i -1 will run infinitely. Cc: Thomas Gleixner <[email protected]> Cc: Ingo Molnar <[email protected]> Cc: Miroslav Lichvar <[email protected]> Cc: Richard Cochran <[email protected]> Cc: Prarit Bhargava <[email protected]> Cc: Stephen Boyd <[email protected]> Cc: Shuah Khan <[email protected]> Cc: [email protected] Signed-off-by: John Stultz <[email protected]> Cc: stable <[email protected]> [4.13+] Signed-off-by: Shuah Khan <[email protected]>
1 parent b841065 commit 98b74e1

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

tools/testing/selftests/timers/leap-a-day.c

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -179,18 +179,18 @@ int main(int argc, char **argv)
179179
struct sigevent se;
180180
struct sigaction act;
181181
int signum = SIGRTMAX;
182-
int settime = 0;
182+
int settime = 1;
183183
int tai_time = 0;
184184
int insert = 1;
185-
int iterations = -1;
185+
int iterations = 10;
186186
int opt;
187187

188188
/* Process arguments */
189189
while ((opt = getopt(argc, argv, "sti:")) != -1) {
190190
switch (opt) {
191-
case 's':
192-
printf("Setting time to speed up testing\n");
193-
settime = 1;
191+
case 'w':
192+
printf("Only setting leap-flag, not changing time. It could take up to a day for leap to trigger.\n");
193+
settime = 0;
194194
break;
195195
case 'i':
196196
iterations = atoi(optarg);
@@ -199,9 +199,10 @@ int main(int argc, char **argv)
199199
tai_time = 1;
200200
break;
201201
default:
202-
printf("Usage: %s [-s] [-i <iterations>]\n", argv[0]);
203-
printf(" -s: Set time to right before leap second each iteration\n");
204-
printf(" -i: Number of iterations\n");
202+
printf("Usage: %s [-w] [-i <iterations>]\n", argv[0]);
203+
printf(" -w: Set flag and wait for leap second each iteration");
204+
printf(" (default sets time to right before leapsecond)\n");
205+
printf(" -i: Number of iterations (-1 = infinite, default is 10)\n");
205206
printf(" -t: Print TAI time\n");
206207
exit(-1);
207208
}

0 commit comments

Comments
 (0)