User Tools

Site Tools


realtime:documentation:howto:debugging:cyclictest:test-design:priority

This is an old revision of the document!


Cyclictest - Real-Time Priority Option

The Cyclictest priority option (–priority) determines the real-time priority of Cyclictest's latency measuring threads. This option should always be used when running Cyclictest. There are a few things to keep in mind when specifying Cyclictest's priority option. The general idea is that the priority of Cyclictest's measuring threads needs to be lower than what should be measured and higher than what should not be measured. The thread's priority needs to be lower than what should be measured so that the thread will be executed after whatever is producing the latency. In this case the thread's execution will be delayed and the latency will be measured. On the other hand, the thread's priority needs to be higher than what should not be measured so that the thread executes before it and therefore is not delayed by it.


Measuring system latencies

If latencies caused by the hardware, the firmware, and the OS are being measured, then Cyclictest's priority should be higher than the priority of the application or load that is executing on the platform. If Cyclictest's priority is not higher, then the measured system latency times will be longer than reality because other userspace tasks will be able to execute before the Cyclictest measuring thread has a chance to execute in response to the timer expiry.

Measuring application latencies

If Cyclictest is being used to approximate the latency of RT userspace tasks, then the principles explained in the first paragraph still apply. Cyclictest's priority needs to be lower than the priority of the tasks that are producing the latencies that Cyclictest is supposed to be detecting and higher than the lower priority tasks that are producing latencies that are not to be measured. This will ensure that Cyclictest only measures the latencies experienced by the higher priority tasks whose latencies are supposed to be measured.

Consider the following example. Task A (high priority) and Task B (low priority) are running on a system. If the intention is to measure the influence of Task A on the latencies experienced by Task B, then Cyclictest's priority should be lower than Task A's but higher than Task B's. The Cyclictest measuring threads should have a lower priority than Task A so that they execute after this task and are affected by the additional latency it causes. However, their priority should be lower than Task B's so that they execute before it and are not influenced by Task B.

realtime/documentation/howto/debugging/cyclictest/test-design/priority.1532084483.txt.gz · Last modified: 2018/07/20 11:01 by ebugden