Add an option '-J' or '--histfile' to dump the latency histogram to <path>
instead of stdout. This allows for live update of the current min, avg, and max
numbers while retaining the option to save histogram data for later analysis.
Signed-off-by: Gratian Crisan <gratian.crisan@ni.com>
Signed-off-by: Josh Cartwright <joshc@ni.com>
These functions never return to their caller. Mark them as such to aide
in code generation and help out static analysis.
Signed-off-by: Josh Cartwright <joshc@ni.com>
The fifothread is only created when use_fifo is set; having the thread
itself perform a check is redundant and unnecessary. Drop it.
Signed-off-by: Josh Cartwright <joshc@ni.com>
On any sane platform sizeof(long) == sizeof(unsigned long), so this
does not actually fix a real bug, but the code should at least be
consistent.
Signed-off-by: Josh Cartwright <joshc@ni.com>
The condition that numa_on_and_available() checks is impossible to hit,
as it's already being checked during process_options().
Removal of numa_on_and_available() also has the side effect of removing
the following warning during build:
src/cyclictest/rt_numa.h:259:15: warning: implicit declaration of function ‘numa_available’ [-Wimplicit-function-declaration]
Signed-off-by: Josh Cartwright <joshc@ni.com>
Most functions in cyclictest were already 'static', with a few
exceptions. Fixup those exceptions, in the interest of consistency,
optimization, etc.
Signed-off-by: Josh Cartwright <joshc@ni.com>
The childinfo_t union shares the 'long long error' member with a
'pthread_t threadid'. For a "sufficiently large" threadid, it's
possible that the error condition is incorrectly hit even though a valid
thread was created.
Stop conflating the error condition with legitimate thread/process
identifiers by modifying create_worker to explicitly return an error
code.
Inspired by a patch in OpenEmbedded authored by Song Li and Jesse Zhang.
Cc: Song.Li <Song.Li@windriver.com>
Cc: Jesse Zhang <sen.zhang@windriver.com>
Signed-off-by: Josh Cartwright <joshc@ni.com>
Some 'gzip' implementations, in particular 'pigz' don't properly handle
the '-c' argument if it's passed after the name of the input files.
Work around this by putting the '-c' option before the file names.
Inspired by patches in OpenEmbedded by Robert Yang and Kai Kang.
Cc: Robert Yang <liezhi.yang@windriver.com>
Cc: Kai Kang <kai.kang@windriver.com>
Signed-off-by: Josh Cartwright <joshc@ni.com>
Allow hwlatdetect to be installed independently of the rest of the
tests. This is convenient for build systems that package it separately
due to the python dependency.
Signed-off-by: Darren Hart <dvhart@linux.intel.com>
CC: Clark Williams <williams@redhat.com>
CC: John Kacur <jkacur@redhat.com>
Signed-off-by: Josh Cartwright <joshc@ni.com>
Allow users (build systems) to specify PYLIB. This allows for a
cross-build-system to specify the target PYLIB rather than the host
PYLIB.
Signed-off-by: Darren Hart <dvhart@linux.intel.com>
CC: Clark Williams <williams@redhat.com>
CC: John Kacur <jkacur@redhat.com>
Signed-off-by: Josh Cartwright <joshc@ni.com>
- Change VERSION_STRING to VERSION to get the same version number as the
the rest of the suite
- Assume that VERSION is defined, instead of replacing it with a
nonsensical number
- Print the help option in the usage() function
Reported-by: DIXLOR <dixlor@gmail.com>
Signed-off-by: John Kacur <jkacur@redhat.com>
The help text shows prio as the long option name for the process priority.
But it is actually priority.
Signed-off-by: Alexander Stein <alexander.stein@systec-electronic.com>
Signed-off-by: Clark Williams <williams@redhat.com>
Signed-off-by: John Kacur <jkacur@redhat.com>
The help text shows prio as the long option name for the process priority.
But it is actually priority.
Signed-off-by: Alexander Stein <alexander.stein@systec-electronic.com>
Adding _STRING doesn't add any extra meaning, but the extra length makes
the Makefile more unreadable than is necessary, so shorten this up
Signed-off-by: John Kacur <jkacur@redhat.com>
Coverage tools indicate that there are two spots where the function
low_priority() could exit without releasing the mutex.
Since the only error that pthread_barrier_wait is supposed to give is
EINVAL when the barrier is not an initialized barrier object, the
chances of this happinning seem remote. However, if we are going to
test for the error and potentially exit, then we should release the
mutex too.
Signed-off-by: John Kacur <jkacur@redhat.com>
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>
The offset is specified in microseconds according to the
documentation, but, the microseconds to nanoseconds conversion is
missing so the effective offset has the unit of nanoseconds.
Signed-off-by: Anna-Maria Gleixner <anna-maria@glx-um.de>
Signed-off-by: John Kacur <jkacur@redhat.com>
The calculated next wakeup time is already in the past, if the latency
is longer than the interval. Thereby latency is detected that does not
correspond to latency caused by the system but by cyclictest itself.
Force forward the next wakeup time past now.
Signed-off-by: Anna-Maria Gleixner <anna-maria@glx-um.de>
Signed-off-by: John Kacur <jkacur@redhat.com>
This is a temporary solution until we have time to look into autotools
If you know that you are building on a system that has
numa_parse_cpustring_all()
Then you can type
make HAVE_PARSE_CPUSTRING_ALL=1
to define it.
If you omit that, then the default is the old behaviour that uses
numa_parse_cpustring((char *)s)
Signed-off-by: John Kacur <jkacur@redhat.com>
Teach cyclictest to recognize the major version 4 which we do have now.
Featurewise it should behave like the 3.0 series
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: John Kacur <jkacur@redhat.com>
Only add '-lrttest -L.' where it's actually needed.
Use '$<' instead of '$^'. Otherwise librttest is added twice:
As 'librttest.a' and as '-lrttest'.
Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
Signed-off-by: John Kacur <jkacur@redhat.com>
Change "quick" to quicker, so the help message reads
-c --check Stop if lower prio task is quicker than
higher (off)
Signed-off-by: John Kacur <jkacur@redhat.com>
Deadline tasks are not allowed to set smp affinity.
Signed-off-by: Daniel Wagner <daniel.wagner@bmw-carit.de>
Signed-off-by: John Kacur <jkacur@redhat.com>
Having the date and time of compilation is hardly useful and is in the
way for reproducible building binaries.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Clark Williams <williams@redhat.com>
Make sure we get a value between 1 and 99 for --prio. Also change
print for invalid --loops from Warning to Error (if we call exit
then it's an error).
Signed-off-by: Clark Williams <williams@redhat.com>
The input parameters for run_interval and interval are specified on the
command line as millisecond values. Convert these to nanosecond values
before we use them.
Signed-off-by: Clark Williams <williams@redhat.com>
By default, static variables run_interval and interval assigned to
macros with corresponding uppercase name, RUN_INTERVAL and INTERVAL.
Later in code we should only use these variables to properly handle
options passed by user.
Signed-off-by: Boris Egorov <egorov@linux.com>
Signed-off-by: Clark Williams <williams@redhat.com>
Program will crash if nr_runs is 0 due to dividing by it in
print_results(). Let's exit early instead.
Fixes: http://bugs.debian.org/716237
Signed-off-by: Boris Egorov <egorov@linux.com>
Signed-off-by: Clark Williams <williams@redhat.com>
Some architectures are still stuck with non-NPTL toolchains.
These are for example ARC, Blackfin, Xtensa etc.
Still rt-tests are very good benchmarks and it would be good to enable use of
at least selected (those that will be built) tests on those architectures.
This change makes it possible to only build subset of tests that don't require
NPTL calls.
By default behavior is not modified - all tests are built, but if one wants
to build with non-NPTL toolchain just add "HAVE_NPTL=no" in command line
or modify "HAVE_NPTL" variable right in Makefile and execute "make".
Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
Cc: Vineet Gupta <vgupta@synopsys.com>
Cc: Clark Williams <clark.williams@gmail.com>
ARM platforms have timing issues with pip_stress:
Hello,
pip_stress works out of the box on my x86 based laptop, but
doesn't work on ARM devices, returned 'no inversion incurred'.
Follow the comment to increase usleep value, 2500 worked for
pandaboard and 3000 worked for Beaglebone Black board.
I propose that increase the usleep value to 3500 from upstream,
so that we can use pip_stress right out of the box.
Rather than hardcode the usleep value used by pip_stress, I made
the command line option --usleep which takes a microsecond value
that defaults to 500us.
Reported-by: Chase Qi <chase.qi@linaro.org>
Signed-off-by: Clark Williams <clark.williams@gmail.com>
Currently, the scheduling class is configured on a global
level. It is possible to run the test either with SCHED_FIFO
or SCHED_RR. All threads run then with the same configuration
except sched_priority is different.
By storing the scheduling attributes per thread we will be able
to use different scheduler classes at the same time. The aim is
to use SCHED_DEADLINE for the high priority thread.
First thing to get there is to introduce low_sa, med_sa, high_sa
and admin_sa. They are configured using the global policy variable
on default. Either using SCHED_FIFO or SCHED_RR. The user
can though use --sched command line options to configure each
thread seperately. E.g.
Starting PI Stress Test
Number of thread groups: 1
Duration of test run: infinite
Number of inversions per group: unlimited
Admin thread SCHED_FIFO priority 4
1 groups of 3 threads will be created
High thread SCHED_DEADLINE runtime 100000 deadline 200000 period 200000
Med thread SCHED_FIFO priority 2
Low thread SCHED_FIFO priority 1
Current Inversions: 2446249
Stopping test
Terminated
Signed-off-by: Daniel Wagner <daniel.wagner@bmw-carit.de>