Skip to contentSkip to conversation

kselftests: timers: Add test for frequency step

PATCH In review Miroslav Lichvar 2 participants 2 messages Jun 9, 2017 – Jun 13, 2017

Subsystems (3)
lore
Share & tools
lore

Miroslav Lichvar

author reviewer
#0 lore raw

PATCH 1/1 kselftests: timers: Add test for frequency step

This test checks the response of the system clock to frequency steps made with adjtimex(). The frequency error and stability of the CLOCK_MONOTONIC clock relative to the CLOCK_MONOTONIC_RAW clock is measured in two intervals following the step. The test fails if values from the second interval exceed specified limits.

Cc John Stultz <[email protected]>
Cc Richard Cochran <[email protected]>
Cc Prarit Bhargava <[email protected]>
---
 tools/testing/selftests/timers/Makefile    |   5 +-
 tools/testing/selftests/timers/freq-step.c | 268 +++++++++++++++++++++++++++++
 2 files changed, 271 insertions(+), 2 deletions(-)
 create mode 100644 tools/testing/selftests/timers/freq-step.c
tools/testing/selftests/timers/Makefile +3 -2
index 5fa1d7e9..5801bbe 100644
@@ -1,6 +1,6 @@
 BUILD_FLAGS = -DKTEST
 CFLAGS += -O3 -Wl,-no-as-needed -Wall $(BUILD_FLAGS)
-LDFLAGS += -lrt -lpthread
+LDFLAGS += -lrt -lpthread -lm
 
 # these are all "safe" tests that don't modify
 # system time or require escalated privileges
@@ -8,7 +8,7 @@ TEST_GEN_PROGS = posix_timers nanosleep nsleep-lat set-timer-lat mqueue-lat \
 	     inconsistency-check raw_skew threadtest rtctest
 
 TEST_GEN_PROGS_EXTENDED = alarmtimer-suspend valid-adjtimex adjtick change_skew \
-		      skew_consistency clocksource-switch leap-a-day \
+		      skew_consistency clocksource-switch freq-step leap-a-day \
 		      leapcrash set-tai set-2038 set-tz
 
 
@@ -24,6 +24,7 @@ run_destructive_tests: run_tests
 	./change_skew
 	./skew_consistency
 	./clocksource-switch
+	./freq-step
 	./leap-a-day -s -i 10
 	./leapcrash
 	./set-tz
tools/testing/selftests/timers/freq-step.c new file +268 -0

268 lines not on this page · raw message

Signature · 1 line
2.9.3
#1 lore raw
Quoted 5 lines · Miroslav Lichvar

This test checks the response of the system clock to frequency steps made with adjtimex(). The frequency error and stability of the CLOCK_MONOTONIC clock relative to the CLOCK_MONOTONIC_RAW clock is measured in two intervals following the step. The test fails if values from the second interval exceed specified limits.

Queued this up my tree for testing, targeting 4.13.

Thanks!
-john