安装
基于ubuntu16.04安装参考博客: https://blog.csdn.net/weixin_43455581/article/details/103899362
https://blog.csdn.net/hbxiang200/article/details/86244772
Cyclictest 测试
带RT-linux测试结果:
yaru@yaru-NUC:~$ sudo cyclictest -t 4 -p 80 -n
[sudo] password for yaru:
# /dev/cpu_dma_latency set to 0us
policy: fifo: loadavg: 0.91 0.68 0.57 1/491 12130
T: 0 (12124) P:80 I:1000 C: 79481 Min: 4 Act: 11 Avg: 13 Max: 46
T: 1 (12125) P:80 I:1500 C: 52987 Min: 4 Act: 10 Avg: 13 Max: 62
T: 2 (12126) P:80 I:2000 C: 39740 Min: 4 Act: 9 Avg: 12 Max: 59
T: 3 (12127) P:80 I:2500 C: 31792 Min: 4 Act: 11 Avg: 11 Max: 43
不带RT-linux测试结果:
yaru@yaru-NUC:~$ sudo cyclictest -t 4 -p 80 -n
[sudo] password for yaru:
# /dev/cpu_dma_latency set to 0us
policy: fifo: loadavg: 0.03 0.20 0.13 1/393 2328
T: 0 ( 2298) P:80 I:1000 C: 248093 Min: 2 Act: 9 Avg: 9 Max: 100
T: 1 ( 2299) P:80 I:1500 C: 165395 Min: 3 Act: 9 Avg: 9 Max: 48
T: 2 ( 2300) P:80 I:2000 C: 124046 Min: 3 Act: 9 Avg: 8 Max: 108
T: 3 ( 2301) P:80 I:2500 C: 99237 Min: 2 Act: 9 Avg: 9 Max: 90
cyclictest各个命令参数的使用
cyclictest: option requires an argument -- 'h'
cyclictest V 0.93
Usage:
cyclictest <options>
-a [CPUSET] --affinity Run thread #N on processor #N, if possible, or if CPUSET
given, pin threads to that set of processors in round-
robin order. E.g. -a 2 pins all threads to CPU 2,
but -a 3-5,0 -t 5 will run the first and fifth
threads on CPU (0),thread #2 on CPU 3, thread #3
on CPU 4, and thread #5 on CPU 5.在N#处理器上运行N#线程
-A USEC --aligned=USEC align thread wakeups to a specific offset
-b USEC --breaktrace=USEC send break trace command when latency > USEC#当延时大于USEC指定的值时,发送停止跟踪。USEC,单位为谬秒
-B --preemptirqs both preempt and irqsoff tracing (used with -b)#和 -b一起使用。preempt(抢占)和 irqsoff同时跟踪。cyclictest -b 100 -B
-c CLOCK --clock=CLOCK select clock
0 = CLOCK_MONOTONIC (default)
1 = CLOCK_REALTIME#选择时钟 cyclictest -c 1
-C --context context switch tracing (used with -b)#上下文切换跟踪(和-b一起使用)
-d DIST --distance=DIST distance of thread intervals in us default=500#线程间隔(默认为500)
-D --duration=t specify a length for the test run
default is in seconds, but 'm', 'h', or 'd' maybe added
to modify value to minutes, hours or days#指定要测试多长时间。默认单位是秒,但是也可以指定m(分),h(小时),d(天)
--latency=PM_QOS write PM_QOS to /dev/cpu_dma_latency
-E --event event tracing (used with -b)#事件跟踪,和 -b一起使用
-f --ftrace function trace (when -b is active)#函数跟踪(-b 为激活的)
-F --fifo=<path> create a named pipe at path and write stats to it
-h --histogram=US dump a latency histogram to stdout after the run
(with same priority about many threads)
US is the max time to be be tracked in microseconds#在执行完后在标准输出设备上画出延迟的直方图(很多线程有相同的权限)US为最大的跟踪时间限制(单位为毫秒)。
-H --histofall=US same as -h except with an additional summary column
-i INTV