Commit Graph

700 Commits

Author SHA1 Message Date
John Kacur c5aa9a877b Merge branch 'unstable/devel/latest' into unstable/devel/latest-devel 2019-11-18 20:31:50 +01:00
Uwe Kleine-König e782ceaafc Makefile: don't create empty directories in install target
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>
2019-11-18 20:23:35 +01:00
Uwe Kleine-König ab2ea3fd06 cyclictest: fix typos
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>
2019-11-18 20:23:25 +01:00
John Kacur a6f1ab221f rt-tests: ssdd: Add short and long functions as well as help
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>
2019-11-12 01:21:09 +01:00
John Kacur 6a9f1f6d5a rt-tests: queuelat: Fix some warnings in determine_maximum_mpps.sh
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>
2019-11-11 22:20:23 +01:00
John Kacur 97632deddf rt-tests: cyclictest: Just use LIBNUMA_API_VERSION 2
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>
2019-10-29 22:17:39 +01:00
John Kacur bb93611dd8 rt-tests: cyclictest: Assume libnuma version 2 by default
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>
2019-10-29 22:17:18 +01:00
John Kacur 90449d993f rt-tests: cyclictest: Just use LIBNUMA_API_VERSION 2
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>
2019-09-24 19:44:35 +02:00
John Kacur b0bd20facc rt-tests: cyclictest: Assume libnuma version 2 by default
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>
2019-09-19 20:29:18 +02:00
Sultan Alsawaf 6db215d6fc rt-tests: backfire: Don't include asm/uaccess.h directly
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>
2019-09-17 16:18:13 +02:00
John Kacur 0bf35a2fb5 rt-tests: cyclictest: Don't allow OPT_SYSTEM with OPT_POSIX_TIMERS
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>
2019-09-17 16:18:13 +02:00
John Kacur f70d5f0de6 rt-tests: cyclictest: Fix warning: ‘cpu’ may be used uninitialized
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>
2019-09-17 16:18:13 +02:00
John Kacur 33f07f6ee2 rt-tests: cyclictest: Make tracemark work correctly again
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>
2019-09-17 16:17:07 +02:00
John Kacur abc74dca45 rt-tests: cyclictest.8: Remove invalid tracing options from the manpage
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>
2019-09-16 22:48:13 +02:00
John Kacur e5f59a301e rt-tests: Set affinity before applying numa
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>
2019-09-06 20:59:42 +02:00
Daniel Wagner 33dff61afb deadline_test: Increase buffer to avoid overflow
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>
2019-08-23 17:20:06 +02:00
Daniel Wagner 0651944322 svsematest: Increase buffer to avoid overflow
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>
2019-08-23 17:18:03 +02:00
Daniel Wagner 2d10186636 sigwaittest: Increase buffer to avoid overflow
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>
2019-08-23 17:16:43 +02:00
Daniel Wagner f7c39616fe pmqtest: Increase buffer to avoid overflow
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>
2019-08-23 17:08:47 +02:00
Afzal Mohammed b6a40c6b9b rt-tests: Let git ignore cscope generated files
Let git ignore cscope generated files

Signed-off-by: Afzal Mohammed <afzal.mohd.ma@gmail.com>
Signed-off-by: John Kacur <jkacur@redhat.com>
2019-08-23 17:05:46 +02:00
Afzal Mohammed eee0b80055 rt-tests: Allow cross compilation
$ 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>
2019-08-23 17:02:58 +02:00
John Kacur 24fb632ceb rt-tests: Makefile update version
Update the version in the Makefile to 1.5

Signed-off-by: John Kacur <jkacur@redhat.com>
2019-08-19 19:24:14 +02:00
John Kacur a3ae50a43f rt-tests: cyclictest: Without -t default to 1 thread in numa case
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>
2019-08-14 00:12:35 +02:00
John Kacur edba456218 rt-tests: hwlatdetect: Remove kmodule options and clean-up help
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>
2019-08-07 15:25:25 +02:00
Qiao Zhao 40eb214cc9 ptsematest, sigwaittest, pmqtest, svsematest reprot error "Could not access /sys/kernel/debug/tracing/tracing_enabled"
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>
2019-07-31 17:04:07 +02:00
John Kacur 4591e48594 rt-tests: Use gettid from rt-utils.c everywhere
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>
2019-06-26 13:51:12 +02:00
Kurt Kanzenbach 5a17ea9879 rt-tests: cyclicdeadline: Fix cgroup setup
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>
2019-06-19 17:41:31 +02:00
Kurt Kanzenbach 57d6c38a41 rt-tests: cyclicdeadline: Print fail only if something failed
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>
2019-06-19 17:40:31 +02:00
Kurt Kanzenbach 9f2381a124 rt-tests: cyclicdeadline: Add options to usage
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>
2019-06-19 17:39:30 +02:00
Kurt Kanzenbach f73533e923 rt-tests: deadline: Remove duplicated gettid() code
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>
2019-06-19 17:38:27 +02:00
Kurt Kanzenbach f5fb7b18cd rt-tests: cyclicdeadline: Remove unused getcpu code
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>
2019-06-19 17:33:05 +02:00
Kurt Kanzenbach e81d2c596c rt-tests: deadline: Remove duplicated code for sched_{set,get}_attr
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>
2019-06-19 17:32:58 +02:00
John Kacur 88efdb99bc rt-tests: Version 1.4
Create version 1.4

Signed-off-by: John Kacur <jkacur@redhat.com>
2019-06-19 14:40:42 +02:00
John Kacur ae393cf8d4 Add ssdd to .gitignore
Add ssdd to .gitignore

Signed-off-by: John Kacur <jkacur@redhat.com>
2019-06-19 01:43:22 +02:00
John Kacur d6edef62b8 rt-tests: ssdd: Add a simple manpage for ssdd
Add a simple manpage to rt-tests for ssdd, and modify the manpage to
install it

Signed-off-by: John Kacur <jkacur@redhat.com>
2019-06-19 01:43:22 +02:00
John Kacur c7d35519ac rt-tests: ssdd: Add Licence information to ssdd
Add License Information to ssdd

Signed-off-by: John Kacur <jkacur@redhat.com>
Signed-off-by: Joe Korty <joe.korty@concurrent-rt.com>
2019-06-19 01:43:22 +02:00
Daniel Wagner 37516acefc rt-migrate-test: Add duration command line argument
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>
2019-06-19 01:43:22 +02:00
Daniel Wagner 74e9face21 svsematest: Add duration command line argument
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>
2019-06-19 01:43:09 +02:00
Daniel Wagner 96bd8df1aa sigwaittest: Add duration command line argument
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>
2019-06-19 01:04:58 +02:00
Daniel Wagner f750e58986 signaltest: Add duration command line argument
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>
2019-06-19 01:04:50 +02:00
Daniel Wagner fb61d543d9 cyclicdeadline: Add duration command line argument
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>
2019-06-19 01:04:42 +02:00
Daniel Wagner e3f890b21c ptsematest: Add duration command line argument
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>
2019-06-19 01:04:31 +02:00
Daniel Wagner 9072a472ee pmqtest: Add duration command line argument
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>
2019-06-19 01:04:21 +02:00
Daniel Wagner a037de86a6 pi_stress: Rename -t command line option to -D
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>
2019-06-19 01:04:14 +02:00
Daniel Wagner 81f63a4ebd pi_stress: Allow short command line arguments
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>
2019-06-19 01:04:06 +02:00
Daniel Wagner edd0e70e55 rt-utils: Move parse_time_string()
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>
2019-06-19 01:03:56 +02:00
Daniel Wagner 6a9661a03e queuelat: Use clock syscall for ARM 32 bit
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>
2019-06-19 01:03:45 +02:00
Daniel Wagner 6a7446e489 rt_numa.h: Remove unused function
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>
2019-06-19 01:03:30 +02:00
John Kacur 1c80348ac6 rt-tests: hwlatdetect.py: Code clean-up
- 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>
2019-05-23 17:59:13 +02:00
Clark Williams ef49ccfab8 hwlatdetect: disable/enable c-state transitions during detection
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>
2019-05-09 16:00:36 +02:00