Realtime testing
From Rsewiki
RTAI Latency tests
To test the latency use RTAIs build in test program. On the computer to test, go to
/usr/realtime/testsuite/kern/latency
Then insert the module and run the 'display' program:
insmod latency_rt.ko ./display
The program should produce an ouput like this:
## RTAI latency calibration tool ## # period = 100000 (ns) # avrgtime = 1 (s) # do not use the FPU # start the timer # timer_mode is oneshot RTAI Testsuite - KERNEL latency (all data in nanoseconds) RTH| lat min| ovl min| lat avg| lat max| ovl max| overruns RTD| -682| -682| -178| 7826| 7826| 0 RTD| -787| -787| -159| 8111| 8111| 0 RTD| -667| -787| -183| 9802| 9802| 0 RTD| -618| -787| -59| 9277| 9802| 0 RTD| -517| -787| -78| 8651| 9802| 0 RTD| -599| -787| -61| 9964| 9964| 0 RTD| -716| -787| -88| 9442| 9964| 0 RTD| -543| -787| -63| 9982| 9982| 0 RTD| -671| -787| -94| 9521| 9982| 0 RTD| -659| -787| -56| 8576| 9982| 0 RTD| -551| -787| -87| 9397| 9982| 0 RTD| -502| -787| -70| 10001| 10001| 0 RTD| -671| -787| -81| 8006| 10001| 0 RTD| -629| -787| -77| 9629| 10001| 0 RTD| -607| -787| -74| 7799| 10001| 0 RTD| -532| -787| -89| 8921| 10001| 0 RTD| -532| -787| -89| 8921| 10001| 0
Watch the the overrun counter does not increase from zero. The program is stopped by SIGINT (ctrl+c). Remember to unload the module when done.
rmmod latency_rt.ko
CPU time test
In order to verify that rt_get_time_ns() and rt_get_cpu_time_ns() gives the same results use the program p13. The program is compiled by
gcc -Wall -o p13 p13.c -I/usr/realtime/include -L/usr/realtime/lib -llxrt -lpthread
Output