John Stultz
7290ce1423
selftests/timers: Add clocksource-switch test from timetest suite
...
Adds the clocksource-switch tests which continually switches the
current clocksource between all the available ones, watching for
any timekeeping inconsistencies.
Cc: Shuah Khan <shuahkh@osg.samsung.com >
Cc: Prarit Bhargava <prarit@redhat.com >
Cc: Thomas Gleixner <tglx@linutronix.de >
Cc: Richard Cochran <richardcochran@gmail.com >
Signed-off-by: John Stultz <john.stultz@linaro.org >
Tested-by: Prarit Bhargava <prarit@redhat.com >
Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com >
2015-03-12 13:22:15 -06:00
John Stultz
6e8b285bcd
selftests/timers: Add skew_consistency test from the timetests suite
...
This change adds the skew_consistency test, which twists the
ADJ_FREQUENCY knob back and forth and watches for timekeeping
inconsistencies.
Cc: Shuah Khan <shuahkh@osg.samsung.com >
Cc: Prarit Bhargava <prarit@redhat.com >
Cc: Thomas Gleixner <tglx@linutronix.de >
Cc: Richard Cochran <richardcochran@gmail.com >
Signed-off-by: John Stultz <john.stultz@linaro.org >
Tested-by: Prarit Bhargava <prarit@redhat.com >
Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com >
2015-03-12 13:22:15 -06:00
John Stultz
d869424558
selftests/timers: Add change_skew test from timetest suite
...
This patch adds the change_skew test which validates the
adjtimex freq can be set to various values and then using
the inconsistency-check, raw_skew, and nanosleep tests
ensures time behaves properly.
Cc: Shuah Khan <shuahkh@osg.samsung.com >
Cc: Prarit Bhargava <prarit@redhat.com >
Cc: Thomas Gleixner <tglx@linutronix.de >
Cc: Richard Cochran <richardcochran@gmail.com >
Signed-off-by: John Stultz <john.stultz@linaro.org >
Tested-by: Prarit Bhargava <prarit@redhat.com >
Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com >
2015-03-12 13:22:15 -06:00
John Stultz
b7bb8442fa
selftests/timers: Add alarmtimer-suspend test from timetests suite
...
This adds the alarmtimer-suspend test from the timetests suite,
which tests that the alarmtimers wake the system up from suspend
shortly after the time they were set to fire.
Cc: Shuah Khan <shuahkh@osg.samsung.com >
Cc: Prarit Bhargava <prarit@redhat.com >
Cc: Thomas Gleixner <tglx@linutronix.de >
Cc: Richard Cochran <richardcochran@gmail.com >
Signed-off-by: John Stultz <john.stultz@linaro.org >
Tested-by: Prarit Bhargava <prarit@redhat.com >
Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com >
2015-03-12 13:22:14 -06:00
John Stultz
de52133f18
selftests/timers: Add adjtimex validation test from timetest suite
...
This adds a adjtimex validation test which checks the behavior
for a set of valida and invalid inputs. So far this only tests
ADJ_FREQUENCY, but hopefully will grow.
Cc: Shuah Khan <shuahkh@osg.samsung.com >
Cc: Prarit Bhargava <prarit@redhat.com >
Cc: Thomas Gleixner <tglx@linutronix.de >
Cc: Richard Cochran <richardcochran@gmail.com >
Signed-off-by: John Stultz <john.stultz@linaro.org >
Tested-by: Prarit Bhargava <prarit@redhat.com >
Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com >
2015-03-12 13:22:14 -06:00
John Stultz
274d631e48
selftests/timers: Add mqueue latency test from the timetest suite
...
Add test to validate mqueue timeout latency from the timetest suite
Cc: Shuah Khan <shuahkh@osg.samsung.com >
Cc: Prarit Bhargava <prarit@redhat.com >
Cc: Thomas Gleixner <tglx@linutronix.de >
Cc: Richard Cochran <richardcochran@gmail.com >
Signed-off-by: John Stultz <john.stultz@linaro.org >
Tested-by: Prarit Bhargava <prarit@redhat.com >
Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com >
2015-03-12 13:22:14 -06:00
John Stultz
e39b60f37e
selftests/timers: Add threaded time inconsistency test from timetest suite
...
Add the threaded time inconsistency test from the timetest suite.
This checks for time inconsistencies between cpus, usually associated
with clock skew as sometimes found w/ TSCs.
Cc: Shuah Khan <shuahkh@osg.samsung.com >
Cc: Prarit Bhargava <prarit@redhat.com >
Cc: Thomas Gleixner <tglx@linutronix.de >
Cc: Richard Cochran <richardcochran@gmail.com >
Signed-off-by: John Stultz <john.stultz@linaro.org >
Tested-by: Prarit Bhargava <prarit@redhat.com >
Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com >
2015-03-12 13:22:14 -06:00
John Stultz
4e40d0a22e
selftests/timers: Add set-timer-lat test from timetest suite
...
Add my set-timer-lat test from the timetest suite. This
test checks the latency from set_timer and reports if
any are unreasonable (>40ms).
Cc: Shuah Khan <shuahkh@osg.samsung.com >
Cc: Prarit Bhargava <prarit@redhat.com >
Cc: Thomas Gleixner <tglx@linutronix.de >
Cc: Richard Cochran <richardcochran@gmail.com >
Signed-off-by: John Stultz <john.stultz@linaro.org >
Tested-by: Prarit Bhargava <prarit@redhat.com >
Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com >
2015-03-12 13:22:14 -06:00
John Stultz
51f91cbdf5
selftests/timers: Add clock skew estimation test from timetest suite
...
This adds my clock skew estimation test from the timetest suite.
It measures the drift between CLOCK_MONOTONIC and CLOCK_MONOTONIC_RAW
and compares it with the current frequency value from adjtimex.
It sometimes can trigger false failures when ntpd isn't in a
steady state, but its a useful too when doing adjtimex testing.
Cc: Shuah Khan <shuahkh@osg.samsung.com >
Cc: Prarit Bhargava <prarit@redhat.com >
Cc: Thomas Gleixner <tglx@linutronix.de >
Cc: Richard Cochran <richardcochran@gmail.com >
Signed-off-by: John Stultz <john.stultz@linaro.org >
Tested-by: Prarit Bhargava <prarit@redhat.com >
Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com >
2015-03-12 13:22:13 -06:00
John Stultz
c5fffcb2bd
selftests/timers: Add nsleep-lat test from timetest suite
...
Adds my nanosleep latency test from the timetest suite.
This checks to make sure we don't see "unreasonable"
latencies (> 40ms) when calling nanosleep.
Cc: Shuah Khan <shuahkh@osg.samsung.com >
Cc: Prarit Bhargava <prarit@redhat.com >
Cc: Thomas Gleixner <tglx@linutronix.de >
Cc: Richard Cochran <richardcochran@gmail.com >
Signed-off-by: John Stultz <john.stultz@linaro.org >
Tested-by: Prarit Bhargava <prarit@redhat.com >
Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com >
2015-03-12 13:22:13 -06:00
John Stultz
ed3fe34a2a
selftests/timers: Add inconsistency-check test from timetests
...
This adds my inconsistency-test from my timetests suite,
which checks for (single threaded) time inconsistencies
across the various clockids.
Cc: Shuah Khan <shuahkh@osg.samsung.com >
Cc: Prarit Bhargava <prarit@redhat.com >
Cc: Thomas Gleixner <tglx@linutronix.de >
Cc: Richard Cochran <richardcochran@gmail.com >
Signed-off-by: John Stultz <john.stultz@linaro.org >
Tested-by: Prarit Bhargava <prarit@redhat.com >
Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com >
2015-03-12 13:22:13 -06:00
John Stultz
689f32fbb8
selftests/timers: Add nanosleep test from timetest suite
...
Add my basic nanosleep test from my timetest suite.
This test validates that nanosleep doesn't return early
against a number of clockids.
Cc: Shuah Khan <shuahkh@osg.samsung.com >
Cc: Prarit Bhargava <prarit@redhat.com >
Cc: Thomas Gleixner <tglx@linutronix.de >
Cc: Richard Cochran <richardcochran@gmail.com >
Signed-off-by: John Stultz <john.stultz@linaro.org >
Tested-by: Prarit Bhargava <prarit@redhat.com >
Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com >
2015-03-12 13:22:13 -06:00
John Stultz
2430ec652d
selftests/timers: Quiet warning due to lack of return check on brk
...
The posix_timers.c test has a loop that tries to keep it in
kernel space, repeatedly calling brk(). However, it doesn't
check the return value, which causes warnings.
This patch adds a err value which captures the return value
and modifies the test so it will quit if a failure occurs.
Cc: Shuah Khan <shuahkh@osg.samsung.com >
Cc: Prarit Bhargava <prarit@redhat.com >
Cc: Thomas Gleixner <tglx@linutronix.de >
Cc: Richard Cochran <richardcochran@gmail.com >
Signed-off-by: John Stultz <john.stultz@linaro.org >
Tested-by: Prarit Bhargava <prarit@redhat.com >
Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com >
2015-03-12 13:22:12 -06:00
John Stultz
03438212d0
selftests/timers: Cleanup Makefile to make it easier to add future tests
...
Try to streamline the makefile so its easier to add timer/timekeeping
tests.
Also adds support for the CROSS_COMPILE variable.
Cc: Shuah Khan <shuahkh@osg.samsung.com >
Cc: Prarit Bhargava <prarit@redhat.com >
Cc: Thomas Gleixner <tglx@linutronix.de >
Cc: Richard Cochran <richardcochran@gmail.com >
Signed-off-by: John Stultz <john.stultz@linaro.org >
Tested-by: Prarit Bhargava <prarit@redhat.com >
Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com >
2015-03-12 13:22:12 -06:00
Shuah Khan
884716497d
selftests/timers: change test to use ksft framework
...
Change timers test to use kselftest framework to report
test results.
Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com >
2014-11-17 10:39:30 -07:00
Felipe Pena
c88b05b2cd
tools/testing/selftests: fix uninitialized variable
...
The err variable is intended to receive the timer_create() return before
checking it
Signed-off-by: Felipe Pena <felipensp@gmail.com >
Cc: Frederic Weisbecker <fweisbec@gmail.com >
Signed-off-by: Andrew Morton <akpm@linux-foundation.org >
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org >
2013-10-16 21:35:53 -07:00
Frederic Weisbecker
0bc4b0cf15
selftests: add basic posix timers selftests
...
Add some initial basic tests on a few posix timers interface such as
setitimer() and timer_settime().
These simply check that expiration happens in a reasonable timeframe after
expected elapsed clock time (user time, user + system time, real time,
...).
This is helpful for finding basic breakages while hacking
on this subsystem.
Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com >
Cc: Stanislaw Gruszka <sgruszka@redhat.com >
Cc: Thomas Gleixner <tglx@linutronix.de >
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl >
Cc: Steven Rostedt <rostedt@goodmis.org >
Cc: KOSAKI Motohiro <kosaki.motohiro@gmail.com >
Cc: Olivier Langlois <olivier@trillion01.com >
Signed-off-by: Andrew Morton <akpm@linux-foundation.org >
2013-07-03 16:20:03 +02:00