cyclictest: Align measurement threads to the next full second

cyclictest: Align measurement threads to the next full second

cyclictest starts the test threads at a random point in time. For
fully reproducible tests it is required to schedule the threads with a
specified offset from the timer tick. The influence of the tick can be
measured by running the test with offset = 0 and offset =
tickinterval/2.

To achieve this we rely on the fact, that the kernel starts the tick
at CLOCK_MONOTONIC time 0. So it's guaranteed that the tick timer
expires always every second (if the interval between the ticks defined
by CONFIG_HZ is a whole-number divider of a second). Setting the
global start time of the test threads to a full second (plus offset)
and the interval to the interval between the ticks, the threads are
scheduled with the specified offset to the tick.

Add a new option --secaligned which select this mode and modify the
--aligned option code to support this. The --secaligned and --aligned
options are mutually exclusive.

Signed-off-by Anna-Maria Gleixner <anna-maria@glx-um.de>
Signed-off-by: John Kacur <jkacur@redhat.com>
1 file changed