User Tools

Site Tools


realtime:documentation:howto:debugging:cyclictest:details

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
realtime:documentation:howto:debugging:cyclictest:details [2018/07/16 15:32]
ebugden Add test design section
— (current)
Line 1: Line 1:
-====== Cyclictest ====== 
  
-Cyclictest accurately and repeatedly measures the difference between a thread'​s intended wake-up time and the time at which it actually wakes up in order to provide statistics about the system'​s latencies. It can measure latencies in real-time systems caused by the hardware, the firmware, and the operating system. 
- 
-The original test was written by Thomas Gleixner (tglx), but several people have subsequently contributed modifications. Cyclictest is currently maintained by Clark Williams and John Kacur and is part of the test suite [[realtime:​documentation:​howto:​tools:​rt-tests|rt-tests]]. 
- 
----- 
- 
-===== Use Cases ===== 
- 
-  * System benchmarking 
-  * [[realtime:​documentation:​howto:​debugging:​cyclictest:​debugging|Latency debugging]] 
-  * [[realtime:​documentation:​howto:​debugging:​cyclictest:​app-performance|Approximating application performance]] 
- 
-===== Technical Explanation ===== 
- 
-To measure latencies, Cyclictest runs a non real-time master thread (scheduling class SCHED_OTHER) which starts a defined number of measuring threads with a defined real-time priority (scheduling class SCHED_FIFO). The measuring threads are woken up periodically with a defined interval by an expiring timer (cyclic alarm). Subsequently,​ the difference between the programmed and the effective wake-up time is calculated and handed over to the master thread via shared memory. The master thread tracks the latency values and prints the minimum, maximum and average for the latency once the number of iterations specified is completed. 
- 
-===== Installation ===== 
- 
-Cyclictest can be installed by following the instructions on the [[realtime:​documentation:​howto:​tools:​rt-tests#​compile-and-install|rt-tests page]]. 
- 
-===== Execution ===== 
- 
-Cyclictest must be run as root, with sudo, or as a member of the realtime group. Here is a test case that is relevant for most SMP real-time systems: 
- 
-<code bash> 
-# cyclictest --mlockall --smp --priority=80 --interval=200 --distance=0 
-</​code> ​ 
- 
-The options above are not relevant for every situation on every system. The following section goes into more detail about how to choose the right options for measuring a specific latency on a given system. Additionally,​ ''​cyclictest -h''​ provides a quick description of the different program options and more detailed explanations can be found by running ''​man ./​src/​cyclictest/​cyclictest.8''​ from the root of the [[realtime:​documentation:​howto:​tools:​rt-tests|rt-tests]] files. ​ 
- 
-Running Cyclictest without any options is not recommended as it will not necessarily measure anything useful. Without parameters cyclictest creates one thread with an intended wake up period of 1 ms.  
- 
-===== Test Design ===== 
- 
-Cyclictest can be used to detect latencies that occur in a variety of different systems and situations. However, when measuring the latency of a specific situation, the test set-up and the parameters passed to the tool need to be carefully considered and chosen based on this situation. If these elements are not considered thoughtfully,​ the Cyclictest results will not accurately represent the latencies that occur in the situation that was supposed to be measured. In other words, it is relatively easy to accidentally not measure what a test was intended to measure. 
- 
-<WRAP rightalign>​[[realtime:​documentation:​howto:​debugging:​cyclictest:​test-design|Read more about how to design a test]]</​WRAP>​ 
- 
-===== Expected Results ===== 
- 
-<WRAP center round todo 60%> 
-TODO: Run all the tests run in Expected results section of https://​rt.wiki.kernel.org/​index.php/​Cyclictest and update here. We need to rerun the tests because they were run in 2006 on a Pentium III system running 2.6.16 kernel. Things have probably changed a bit now. :) 
-</​WRAP>​ 
- 
-===== Application Examples ===== 
- 
-cyclictest is one of the most frequently used programs for bench-marking realtime systems. It is usually used with some sort of loads. Following are some of the ways cyclictest can be utilized to benchmark a real-time system: 
- 
-  * [[realtime:​documentation:​howto:​tools:​rteval|RTEval]] 
-  * [[realtime:​documentation:​howto:​tools:​worstcaselatency|Worst Case Latency Test Scenarios]] 
- 
- 
-===== FAQ ===== 
- 
-<WRAP rightalign>​[[realtime:​documentation:​howto:​debugging:​cyclictest:​faq|Read the Cyclictest FAQ]]</​WRAP>​ 
realtime/documentation/howto/debugging/cyclictest/details.1531755127.txt.gz ยท Last modified: 2018/07/16 15:32 by ebugden