kselftest: timers: Add adjtick test to validate adjtimex() tick adjustments
Subsystems (3)
PATCH v4 1/1 kselftest: timers: Add adjtick test to validate adjtimex() tick adjustments
Recently an issue was reported that was difficult to detect except by tweaking the adjtimex tick value, and noticing how quickly the adjustment took to be made:
https://lkml.org/lkml/2015/9/1/488
Thus this patch introduces a new test which manipulates the adjtimex tick value and validates the results are what we expect.
---
v2: - Use sysconf(_SC_CLK_TCK) to properly get USER_HZ value.
v3: - Set STA_PLL to ensure offset is cleared
- Add rational for 100ppm error bound
v4: - Add message informing each iteration takes ~15 secs
- Cleanup error message when ntpd is suspected of running
tools/testing/selftests/timers/Makefile | 3 +- tools/testing/selftests/timers/adjtick.c | 210 +++++++++++++++++++++++++++++++ 2 files changed, 212 insertions(+), 1 deletion(-) create mode 100644 tools/testing/selftests/timers/adjtick.c
tools/testing/selftests/timers/Makefile +2 -1
@@ -8,7 +8,7 @@ LDFLAGS += -lrt -lpthread TEST_PROGS = posix_timers nanosleep nsleep-lat set-timer-lat mqueue-lat \ inconsistency-check raw_skew threadtest rtctest -TEST_PROGS_EXTENDED = alarmtimer-suspend valid-adjtimex change_skew \ +TEST_PROGS_EXTENDED = alarmtimer-suspend valid-adjtimex adjtick change_skew \ skew_consistency clocksource-switch leap-a-day \ leapcrash set-tai set-2038
@@ -24,6 +24,7 @@ include ../lib.mk run_destructive_tests: run_tests ./alarmtimer-suspend ./valid-adjtimex + ./adjtick ./change_skew ./skew_consistency ./clocksource-switch
tools/testing/selftests/timers/adjtick.c new file +210 -0
210 lines not on this page · raw message
Signature · 1 line
1.9.1
tip-bot for John Stultz
merge bot[tip:timers/core] timers, kselftest: Add 'adjtick' test to validate adjtimex() tick adjustments
timers, kselftest: Add 'adjtick' test to validate adjtimex() tick adjustments
Commit-ID: 6035519fcf5aa17084b41790cdc584d881d82c03 Gitweb: http://git.kernel.org/tip/6035519fcf5aa17084b41790cdc584d881d82c03 Author: John Stultz <[email protected]> AuthorDate: Mon, 5 Oct 2015 18:16:57 -0700 Committer: Ingo Molnar <[email protected]> CommitDate: Mon, 12 Oct 2015 09:51:34 +0200
timers, kselftest: Add 'adjtick' test to validate adjtimex() tick adjustments
Recently a kernel side NTP bug was fixed via the following commit:
2619d7e9c92d ("time: Fix timekeeping_freqadjust()'s incorrect use of abs() instead of abs64()")
When the bug was reported it was difficult to detect, except by tweaking the adjtimex tick value, and noticing how quickly the adjustment took:
https://lkml.org/lkml/2015/9/1/488
Thus this patch introduces a new test which manipulates the adjtimex tick value and validates that the results are what we expect.
--- tools/testing/selftests/timers/Makefile | 3 +- tools/testing/selftests/timers/adjtick.c | 221 +++++++++++++++++++++++++++++++ 2 files changed, 223 insertions(+), 1 deletion(-)
tools/testing/selftests/timers/Makefile +2 -1
@@ -8,7 +8,7 @@ LDFLAGS += -lrt -lpthread TEST_PROGS = posix_timers nanosleep nsleep-lat set-timer-lat mqueue-lat \ inconsistency-check raw_skew threadtest rtctest -TEST_PROGS_EXTENDED = alarmtimer-suspend valid-adjtimex change_skew \ +TEST_PROGS_EXTENDED = alarmtimer-suspend valid-adjtimex adjtick change_skew \ skew_consistency clocksource-switch leap-a-day \ leapcrash set-tai set-2038
@@ -24,6 +24,7 @@ include ../lib.mk run_destructive_tests: run_tests ./alarmtimer-suspend ./valid-adjtimex + ./adjtick ./change_skew ./skew_consistency ./clocksource-switch
tools/testing/selftests/timers/adjtick.c new file +221 -0
221 lines not on this page · raw message