mirror of
https://github.com/torvalds/linux.git
synced 2026-11-24 15:33:28 +00:00
Recently a kernel side NTP bug was fixed via the following commit:
2619d7e9c9 ("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.
Signed-off-by: John Stultz <[email protected]>
Cc: Linus Torvalds <[email protected]>
Cc: Miroslav Lichvar <[email protected]>
Cc: Nuno Gonçalves <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: Prarit Bhargava <[email protected]>
Cc: Richard Cochran <[email protected]>
Cc: Shuah Khan <[email protected]>
Cc: Thomas Gleixner <[email protected]>
Link: http://lkml.kernel.org/r/[email protected]
[ Tidied up the code and the changelog a bit. ]
Signed-off-by: Ingo Molnar <[email protected]>
38 lines
938 B
Makefile
38 lines
938 B
Makefile
CC = $(CROSS_COMPILE)gcc
|
|
BUILD_FLAGS = -DKTEST
|
|
CFLAGS += -O3 -Wl,-no-as-needed -Wall $(BUILD_FLAGS)
|
|
LDFLAGS += -lrt -lpthread
|
|
|
|
# these are all "safe" tests that don't modify
|
|
# system time or require escalated privledges
|
|
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 adjtick change_skew \
|
|
skew_consistency clocksource-switch leap-a-day \
|
|
leapcrash set-tai set-2038
|
|
|
|
bins = $(TEST_PROGS) $(TEST_PROGS_EXTENDED)
|
|
|
|
all: ${bins}
|
|
|
|
include ../lib.mk
|
|
|
|
# these tests require escalated privledges
|
|
# and may modify the system time or trigger
|
|
# other behavior like suspend
|
|
run_destructive_tests: run_tests
|
|
./alarmtimer-suspend
|
|
./valid-adjtimex
|
|
./adjtick
|
|
./change_skew
|
|
./skew_consistency
|
|
./clocksource-switch
|
|
./leap-a-day -s -i 10
|
|
./leapcrash
|
|
./set-tai
|
|
./set-2038
|
|
|
|
clean:
|
|
rm -f ${bins}
|