mirror of
https://github.com/linux-msm/laptops-kernel.git
synced 2026-08-13 14:19:53 -07:00
selftests: timers: leap-a-day: Fix -w option and update usage comment
Commit98b74e1f31("kselftests: timers: leap-a-day: Change default arguments to help test runs") replaced the -s option with -w and made "wait for the leap second" the non-default behaviour, but it only updated the switch/case handling. Two things were left inconsistent: - The getopt() option string still lists 's' instead of 'w', so passing -w is rejected as an invalid option and the new behaviour cannot be selected at all. - The file header comment still documents the removed -s option and an outdated default for -i. Fix the getopt() string to accept 'w' (matching the existing case 'w': handler) and update the header comment to describe -w, -t and the current -i default. Fixes:98b74e1f31("kselftests: timers: leap-a-day: Change default arguments to help test runs") Signed-off-by: Jiangshan Yi <yijiangshan@kylinos.cn> Signed-off-by: Thomas Gleixner <tglx@kernel.org> Acked-by: John Stultz <jstultz@google.com> Link: https://patch.msgid.link/20260702093915.2652638-1-yijiangshan@kylinos.cn
This commit is contained in:
committed by
Thomas Gleixner
parent
b3afded935
commit
b4b66151a7
@@ -9,16 +9,19 @@
|
|||||||
* kernel's leap-second behavior, as well as how well applications
|
* kernel's leap-second behavior, as well as how well applications
|
||||||
* handle the leap-second discontinuity.
|
* handle the leap-second discontinuity.
|
||||||
*
|
*
|
||||||
* Usage: leap-a-day [-s] [-i <num>]
|
* Usage: leap-a-day [-w] [-i <num>] [-t]
|
||||||
*
|
*
|
||||||
* Options:
|
* Options:
|
||||||
* -s: Each iteration, set the date to 10 seconds before midnight GMT.
|
* -w: Only set the leap-second flag and wait for the leap second
|
||||||
* This speeds up the number of leapsecond transitions tested,
|
* each iteration, instead of advancing the time. By default the
|
||||||
* but because it calls settimeofday frequently, advancing the
|
* date is set to 10 seconds before midnight GMT, which speeds up
|
||||||
* time by 24 hours every ~16 seconds, it may cause application
|
* the number of leapsecond transitions tested, but because it
|
||||||
* disruption.
|
* calls settimeofday frequently, advancing the time by 24 hours
|
||||||
|
* every ~16 seconds, it may cause application disruption.
|
||||||
*
|
*
|
||||||
* -i: Number of iterations to run (default: infinite)
|
* -i: Number of iterations to run (-1 = infinite, default: 10)
|
||||||
|
*
|
||||||
|
* -t: Print TAI time.
|
||||||
*
|
*
|
||||||
* Other notes: Disabling NTP prior to running this is advised, as the two
|
* Other notes: Disabling NTP prior to running this is advised, as the two
|
||||||
* may conflict in their commands to the kernel.
|
* may conflict in their commands to the kernel.
|
||||||
@@ -186,7 +189,7 @@ int main(int argc, char **argv)
|
|||||||
int opt;
|
int opt;
|
||||||
|
|
||||||
/* Process arguments */
|
/* Process arguments */
|
||||||
while ((opt = getopt(argc, argv, "sti:")) != -1) {
|
while ((opt = getopt(argc, argv, "wti:")) != -1) {
|
||||||
switch (opt) {
|
switch (opt) {
|
||||||
case 'w':
|
case 'w':
|
||||||
printf("Only setting leap-flag, not changing time. It could take up to a day for leap to trigger.\n");
|
printf("Only setting leap-flag, not changing time. It could take up to a day for leap to trigger.\n");
|
||||||
|
|||||||
Reference in New Issue
Block a user