Both $(prefix)/src and $(prefix)/share/man/man4 are unused since commit
2829763fdd ("rt-tests: Remove install and build of backfire and
sendme")
Signed-off-by: John Kacur <jkacur@redhat.com>
The called function is called clock_gettime with "only" two t as can be
seen tree lines above. Also there was a wrong r in useful.
Signed-off-by: John Kacur <jkacur@redhat.com>
Add short and long functions as well as help to make ssdd consistent
with the rest of the test suite. Add a help function as well
Signed-off-by: John Kacur <jkacur@redhat.com>
Coverity advises to quote some values to prevent word splitting and to
export variables separately after declaraing them to avoid masking
errors.
Fix these warnings
Signed-off-by: John Kacur <jkacur@redhat.com>
This removes support for LIBNUMA_API_VERSION 1.
You can still build without numa support by doing
make NUMA=0
You can also build with numa and run on machines without numa support.
Suggested-by: Sebastian Siewior <bigeasy@linutronix.de>
Signed-off-by: John Kacur <jkacur@redhat.com>
Most distributions have used libnuma version 2 for awhile now, so make
it the default.
This doesn't prevent people from defining it as version 1, or compiling
without numa.
Signed-off-by: John Kacur <jkacur@redhat.com>
This removes support for LIBNUMA_API_VERSION 1.
You can still build without numa support by doing
make NUMA=0
You can also build with numa and run on machines without numa support.
Suggested-by: Sebastian Siewior <bigeasy@linutronix.de>
Signed-off-by: John Kacur <jkacur@redhat.com>
Most distributions have used libnuma version 2 for awhile now, so make
it the default.
This doesn't prevent people from defining it as version 1, or compiling
without numa.
Signed-off-by: John Kacur <jkacur@redhat.com>
Architecture-specific uaccess.h headers can have dependencies on
linux/uaccess.h (i.e., VERIFY_WRITE), so it cannot be included directly.
Since linux/uaccess.h includes asm/uaccess.h, just do that instead.
This fixes compile errors with certain kernels and architectures.
Signed-off-by: Sultan Alsawaf <sultan@kerneltoast.com>
Signed-off-by: John Kacur <jkacur@redhat.com>
OPT_SYSTEM means use sys_nanosleep and sys_setitimer
if you try to combine it with OPT_POSIX_TIMERS, it breaks.
cyclictest becomes unkillable with ctrl-C and only the first thread is
updated.
Fix this by issuing a warning if the user tries to combine the two
options and then use clock_nanosleep.
Reported-by: Tom Rix <trix@redhat.com>
Signed-off-by: John Kacur <jkacur@redhat.com>
Fix warning 'cpu' maybe uninitialized by giving it a default value in
the switch statement. Note, this is a false positive, but documenting
the default value in the switch statement isn't a bad thing.
Signed-off-by: John Kacur <jkacur@redhat.com>
commit f5ccfbe4d6
was a little too aggressive removing ftrace code.
We were able to remove ftrace code because this functionality is
available using trace-cmd, in conjunction with the tracemark option in
cyclictest. Put back the parts of tracemark needed to make this work
correctly.
After this patch you can get tracing info like this as an example.
trace-cmd record -p function ./cyclictest -t -b100 --tracemark
Signed-off-by: John Kacur <jkacur@redhat.com>
Corrected a typo
Reported-by: Kurt Kanzenbach <kurt.kanzenbach@linutronix.de>
Signed-off-by: John Kacur <jkacur@redhat.com>
Most tracing options have been removed from cyclictest since the
user can now use trace-cmd together with cyclictest to get the same
functionality. Update the manpage to reflect this.
Reported-by: Tom Rix <trix@redhat.com>
Signed-off-by: John Kacur <jkacur@redhat.com>
There are three changes here.
1. If affinity is not specified, but numa is available, then numa
implies AFFINITY_USEALL.
2. Move setting affinity before applying numa
We need to set the affinity before applying numa, so that we don't
apply numa settings to cpus we don't intend to run on.
3. Allow a greater number of threads than cpus to run in a round robin
fashion in the case of numa.
Signed-off-by: John Kacur <jkacur@redhat.com>
Increase the size of the char buffer. gcc 9.1.1 reports:
src/sched_deadline/deadline_test.c:1803:24: warning: ‘%d’ directive writing between 1 and 11 bytes into a region of size 10 [-Wformat-overflow=]
1803 | sprintf(setcpu_buf, "%d", cpu_count - 1);
| ^~
src/sched_deadline/deadline_test.c:1803:23: note: directive argument in the range [-2147483648, 2147483646]
1803 | sprintf(setcpu_buf, "%d", cpu_count - 1);
| ^~~~
src/sched_deadline/deadline_test.c:1803:3: note: ‘sprintf’ output between 2 and 12 bytes into a destination of size 10
1803 | sprintf(setcpu_buf, "%d", cpu_count - 1);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Signed-off-by: Daniel Wagner <wagi@monom.org>
Signed-off-by: John Kacur <jkacur@redhat.com>
Increase the size of the char buffer. gcc 9.1.1 reports:
rc/svsematest/svsematest.c:578:24: warning: ‘%d’ directive writing between 1 and 10 bytes into a region of size 5 [-Wformat-overflow=]
578 | sprintf(f_opt, "-fr%d", i);
| ^~
src/svsematest/svsematest.c:606:5: note: ‘sprintf’ output between 5 and 14 bytes into a destination of size 8
606 | sprintf(f_opt, "-fs%d", i);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
Signed-off-by: Daniel Wagner <wagi@monom.org>
Signed-off-by: John Kacur <jkacur@redhat.com>
Increase the size of the char buffer. gcc 9.1.1 reports:
src/sigwaittest/sigwaittest.c:494:5: note: ‘sprintf’ output between 5 and 14 bytes into a destination of size 8
494 | sprintf(f_opt, "-fr%d", i);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
src/sigwaittest/sigwaittest.c:522:24: warning: ‘%d’ directive writing between 1 and 10 bytes into a region of size 5 [-Wformat-overflow=]
522 | sprintf(f_opt, "-fs%d", i);
| ^~
Signed-off-by: Daniel Wagner <wagi@monom.org>
Signed-off-by: John Kacur <jkacur@redhat.com>
Increase the size of the char buffer. gcc 9.1.1 reports:
src/pmqtest/pmqtest.c: In function ‘main’:
src/pmqtest/pmqtest.c:46:21: warning: ‘%d’ directive writing between 1 and 10 bytes into a region of size 8 [-Wformat-overflow=]
46 | #define SYNCMQ_NAME "/syncmsg%d"
| ^~~~~~~~~~~~
src/pmqtest/pmqtest.c:445:3: note: ‘sprintf’ output between 10 and 19 bytes into a destination of size 16
445 | sprintf(mqname, SYNCMQ_NAME, i);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Signed-off-by: Daniel Wagner <wagi@monom.org>
Signed-off-by: John Kacur <jkacur@redhat.com>
$ make CROSS_COMPILE=<my-toolchain-prefix>
currently does not cause source to be built using the intended
toolchain, instead will use the host toolchain.
CC & AR are not updated with CROSS_COMPILE value since they are
predefined make variables (with default cc & ar respectively) combined
with the fact that CC & AR variables are updated in the makefile only if
not already defined due to the usage of '?='.
Signed-off-by: Afzal Mohammed <afzal.mohd.ma@gmail.com>
Signed-off-by: John Kacur <jkacur@redhat.com>
Don't ignore -t num when detecting if numa support is available.
Also, don't be too smart about details in the case of numa support
This means, if -t is not specified then the default is 1.
affinity must also be explicily set.
Signed-off-by: John Kacur <jkacur@redhat.com>
hwlatdetect has used the ftrace hwlatdetector for quite sometime. When
we first moved away from our own kernel module, it was still possible to
force the use of the module for testing. This was useful for development
but is no longer supported. This patch does the following things.
- Remove references to the kmodule from the help option and the man
page.
- Remove support from the program to force loading of the module.
- Cleans up some differences between the manpage and the program help,
for example, adds the --hardlimit option to man page and removes the
--cleanup of the kmodule option
Signed-off-by: John Kacur <jkacur@redhat.com>
tracing_enabled was deprecated a long time ago and is no longer
available, use tracing_on instead
To reproduce
This patches fixes that
Signed-off-by: Qiao Zhao <qzhao@redhat.com>
Signed-off-by: John Kacur <jkacur@redhat.com>
gettid is defined in rt-utils, so we should use that everywhere instead
of defining a separate macro in each test for it.
Signed-off-by: John Kacur <jkacur@redhat.com>
Acked-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Acked-by: Kurt Kanzenbach <kurt.kanzenbach@linutronix.de>
Deadline tasks cannot be pinned to specific CPUs by using affinities. Cgroups
have to be used instead. Cylicdeadline has code to do so. However, that code is
never executed, because the all_cpus variable is reassigned after argument
parsing. Remove it.
Signed-off-by: Kurt Kanzenbach <kurt@linutronix.de>
Signed-off-by: John Kacur <jkacur@redhat.com>
It is interesting to see what went wrong in case something did. However, the
fail statement is printed always. That is confusing.
Furthermore, the fail value is always 1 when a failure happened. There is no
need to print it.
Signed-off-by: Kurt Kanzenbach <kurt@linutronix.de>
Signed-off-by: John Kacur <jkacur@redhat.com>
The current usage doesn't show the available options:
$ sudo ./cyclicdeadline -h
usage: cyclicdeadline
So, add the options to the help text to see what can be configured.
Signed-off-by: Kurt Kanzenbach <kurt@linutronix.de>
Signed-off-by: John Kacur <jkacur@redhat.com>
gettid() is already implemented in the library code. Use that code instead.
Signed-off-by: Kurt Kanzenbach <kurt@linutronix.de>
Signed-off-by: John Kacur <jkacur@redhat.com>
The getcpu() system call isn't used in the program. Therefore, it can be
removed.
Signed-off-by: Kurt Kanzenbach <kurt@linutronix.de>
Signed-off-by: John Kacur <jkacur@redhat.com>
The system calls for sched_get_attr() and sched_set_attr() are already
implemented. Get rid of the code and use the existing libary.
Signed-off-by: Kurt Kanzenbach <kurt@linutronix.de>
Signed-off-by: John Kacur <jkacur@redhat.com>
Many of the test programs have the --loop argument for automatic
stopping. The main problem with the --loop argument is how long is
--loop 1000?
To simplify automated tests introduce a --duration argument which
allows to set the time how long a test should run. This allows the
test suite to define the execution time and also the timeout which a
normal human can understand.
For example run the test for 10 minutes and timeout at 11 minutes:
# timeout 11m rt-migrate-test -D 10m
Signed-off-by: Daniel Wagner <wagi@monom.org>
Signed-off-by: John Kacur <jkacur@redhat.com>
Many of the test programs have the --loop argument for automatic
stopping. The main problem with the --loop argument is how long is
--loop 1000?
To simplify automated tests introduce a --duration argument which
allows to set the time how long a test should run. This allows the
test suite to define the execution time and also the timeout which a
normal human can understand.
For example run the test for 10 minutes and timeout at 11 minutes:
# timeout 11m svsematest -D 10m
Signed-off-by: Daniel Wagner <wagi@monom.org>
-Fixed some dos line endings on the man page
Signed-off-by: John Kacur <jkacur@redhat.com>
Many of the test programs have the --loop argument for automatic
stopping. The main problem with the --loop argument is how long is
--loop 1000?
To simplify automated tests introduce a --duration argument which
allows to set the time how long a test should run. This allows the
test suite to define the execution time and also the timeout which a
normal human can understand.
For example run the test for 10 minutes and timeout at 11 minutes:
# timeout 11m sigwaittest -D 10m
Signed-off-by: Daniel Wagner <wagi@monom.org>
-Fixed up some dos line endings in the man page changes
Signed-off-by: John Kacur <jkacur@redhat.com>
Many of the test programs have the --loop argument for automatic
stopping. The main problem with the --loop argument is how long is
--loop 1000?
To simplify automated tests introduce a --duration argument which
allows to set the time how long a test should run. This allows the
test suite to define the execution time and also the timeout which a
normal human can understand.
For example run the test for 10 minutes and timeout at 11 minutes:
# timeout 11m signaltest -D 10m
Signed-off-by: Daniel Wagner <wagi@monom.org>
Signed-off-by: John Kacur <jkacur@redhat.com>
Many of the test programs have the --loop argument for automatic
stopping. The main problem with the --loop argument is how long is
--loop 1000?
To simplify automated tests introduce a --duration argument which
allows to set the time how long a test should run. This allows the
test suite to define the execution time and also the timeout which a
normal human can understand.
For example run the test for 10 minutes and timeout at 11 minutes:
# timeout 11m cyclicdeadline -D 10m
Signed-off-by: Daniel Wagner <wagi@monom.org>
Signed-off-by: John Kacur <jkacur@redhat.com>
Many of the test programs have the --loop argument for automatic
stopping. The main problem with the --loop argument is how long is
--loop 1000?
To simplify automated tests introduce a --duration argument which
allows to set the time how long a test should run. This allows the
test suite to define the execution time and also the timeout which a
normal human can understand.
For example run the test for 10 minutes and timeout at 11 minutes:
# timeout 11m ptsematest -D 10m
Signed-off-by: Daniel Wagner <wagi@monom.org>
Signed-off-by: John Kacur <jkacur@redhat.com>
Many of the test programs have the --loop argument for automatic
stopping. The main problem with the --loop argument is how long is
--loop 1000?
To simplify automated tests introduce a --duration argument which
allows to set the time how long a test should run. This allows the
test suite to define the execution time and also the timeout which a
normal human can understand.
For example run the test for 10 minutes and timeout at 11 minutes:
# timeout 11m pmqtest -D 10m
Signed-off-by: Daniel Wagner <wagi@monom.org>
Signed-off-by: John Kacur <jkacur@redhat.com>
Streamline the duration command line argument for all rt-tests. While
at it also add man page.
Signed-off-by: Daniel Wagner <wagi@monom.org>
Signed-off-by: John Kacur <jkacur@redhat.com>
Add optstring to getopt_long() command line parser to support the
short options as it documented in the man page and also in the usage
help text.
Signed-off-by: Daniel Wagner <wagi@monom.org>
Signed-off-by: John Kacur <jkacur@redhat.com>
Move parse_time_string() to rt-utils.c so we can re use it.
Signed-off-by: Daniel Wagner <wagi@monom.org>
Signed-off-by: John Kacur <jkacur@redhat.com>
CPUs such as Cortex-M8 don't have a rdtsc instruction. Fallback using
a syscall.
Signed-off-by: Daniel Wagner <wagi@monom.org>
Signed-off-by: John Kacur <jkacur@redhat.com>
GCC on a BeagleBoneBlack complains:
In file included from src/cyclictest/cyclictest.c:39:0:
src/cyclictest/rt_numa.h:253:13: warning: ‘numa_on_and_available’ defined but not used [-Wunused-function]
static void numa_on_and_available()
^~~~~~~~~~~~~~~~~~~~~
Signed-off-by: Daniel Wagner <wagi@monom.org>
Signed-off-by: John Kacur <jkacur@redhat.com>
- Remove obsolete from __future__
- Fix spacing around calls to print, open and brackets
- Fix spacing around assignments
Signed-off-by: John Kacur <jkacur@redhat.com>
Recent performance tuning problems led me to realize that just running
at fifo:99 and turning off interrupts isn't enough while looking for
BIOS induced latencies. Power savings logic is built into most modern
cpus and so must be disabled while looking for BIOS induced (SMI/NMI)
latencies.
Use the /dev/cpu_dma_latency mechanism to disable c-state transitions
while running the hardware latency detector. Open the file
/dev/cpu_dma_latency and write a 32-bit zero to it, which will prevent
c-state transitions while the file is open.
Signed-off-by: Clark Williams <williams@redhat.com>
Signed-off-by: John Kacur <jkacur@redhat.com>