zephyr/tests/kernel/timer/timer_behavior
Nicolas Pitre b60cb9cc80 tests: kernel: timer_behavior: improve timer_tick_train output
Print the "perfect" reference period for easier evaluation.
Suggest a remedy to the missed ticks problem.

Still, that wasn't satisfactory. Implemented a count of missed ticks
to get to the bottom of this issue. Found that missed ticks always came
to a perfect count of 40.

Incidentally, the busy loop prints a line every 250 ms and the test spans
10 seconds. There are no such coincidences.

Turns out that CONFIG_PRINTK_SYNC was set by default. This disables IRQs
for the serial output duration, which can be quite long at 115200 bauds.
Given a 60-ish character line length, this represents more than 5 ms of
no IRQ servicing during a timer latency measurement test which is bad.
So make sure CONFIG_PRINTK_SYNC=n for proper statistics.

Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
2023-02-19 20:34:37 -05:00
..
src tests: kernel: timer_behavior: improve timer_tick_train output 2023-02-19 20:34:37 -05:00
CMakeLists.txt
Kconfig tests: kernel: timer_behavior: Fix building on targets with small SRAM 2022-09-29 13:36:00 -05:00
prj.conf tests: kernel: timer_behavior: improve timer_tick_train output 2023-02-19 20:34:37 -05:00
README
testcase.yaml yamllint: fix all yamllint line-length errors 2023-01-04 01:16:45 +09:00

# Test a timer implementations variance and long term drift

Records and calculates statistical values against a timer validating that.

1. Timer variance and standard deviation is below defined acceptable values.
2. Periodic timers do not drift in either direction from expected total time.

Timers are meant to be precise and accurate. This test validates an implementation is both.