autotune(1)
| AUTOTUNE(1) | Xenomai Manual | AUTOTUNE(1) |
NAME
autotune - Calibrate the Xenomai core clock timer
SYNOPSIS
autotune [ options ]
DESCRIPTION
autotune is a utility to determine the best calibration values (aka gravity triplet) for the core clock timer.
The time spent traversing the kernel code from the low-level Xenomai timer handler until the kernel-based client handler is invoked, is shorter than the time required to schedule in a kernel thread instead. It takes even more time to switch in a user-space thread, which entails changing the current memory address space, performing potentially time-consuming MMU-related operations.
For this reason, Xenomai differentiates timers on the target context they activate, among IRQ(handler), kernel and user threads, anticipating the next timer shot accordingly, so that such context is activated as close as possible to the ideal time. This anticipation is called the gravity of the clock serving the timer, which is actually a triplet representing the three possible types of contexts the timer can activate.
Therefore, the gravity is a static adjustment value to account for the basic latency of the target system for responding to timer events, as perceived by the client code waiting for the wake up events. Such latency is increased by additional factors, such as:
autotune runs a series of internal calibration tests for estimating the most appropriate gravity values for its real-time clock timer, retaining the final values.
Important
autotune requires the CONFIG_XENO_OPT_AUTOTUNE option to be enabled in the kernel configuration.
OPTIONS
autotune accepts the following options:
--irq
--kernel
--user
--period <ns>
--reset
--noload
--verbose[=level]
--help
If none of --irq, --kernel or --user is given, an estimation is done for each of them in sequence.
VERSIONS
autotune appeared in Xenomai 3.0 for the Cobalt real-time core.
NOTES
The auto-tuning process may take some time for completing the estimation. Although this delay may vary across hardware platforms, running for 30 seconds is common.
Once the gravity values are known for a particular hardware, one may write them to /proc/xenomai/clock/coreclck from some system init script to set up the Xenomai core clock accordingly, instead of running the auto-tuner after each boot e.g:
/* change the user gravity to 1728 ns (default) */ # echo 1728 > /proc/xenomai/clock/coreclck
/* change the IRQ gravity to 129 ns */ # echo 129i > /proc/xenomai/clock/coreclck
/* change the user and kernel gravities to 1728 and 907 ns resp. */ # echo "1728u 907k" > /proc/xenomai/clock/coreclck
Alternatively, the gravity values can be statically defined in the kernel configuration of the target kernel:
AUTHOR
autotune was written by Philippe Gerum <rpm@xenomai.org>.
| 2014/08/03 | Xenomai 3.1.2 |
