Commit Graph

996 Commits

Author SHA1 Message Date
Kurt Kanzenbach db390f04d1 rt-tests: cyclictest: Close correct trace fds
Remove the last lefotovers from migrating cyclictest to rt-utils.

The rt-utils module is reponsible for handling the tracing code.

Signed-off-by: Kurt Kanzenbach <kurt@linutronix.de>
Signed-off-by: John Kacur <jkacur@redhat.com>
2020-11-10 21:33:21 -05:00
Kurt Kanzenbach 8198888414 rt-tests: rt-utils: Add function to close trace fds
Currently the trace fds are not closed. Add a function for it.

Signed-off-by: Kurt Kanzenbach <kurt@linutronix.de>
Signed-off-by: John Kacur <jkacur@redhat.com>
2020-11-10 21:30:07 -05:00
Kurt Kanzenbach e4613f7281 rt-tests: rt-utils: Mark internal functions static
There are some helper functions which shouldn't be exported. Mark them static.

Signed-off-by: Kurt Kanzenbach <kurt@linutronix.de>
Signed-off-by: John Kacur <jkacur@redhat.com>
2020-11-10 21:27:15 -05:00
Sebastian Andrzej Siewior 71d8477f77 signaltest: Fix break value argument
The break value '-b' is not working properly:
- Every thread may hit the break value. This is expected for thread
  number > 0 because thread number 0 sleeps every 16 iterations to give
  the system time to breath. This delay may wrongly trigger as the break
  value.

- If a thread hits the break value then it returns signaling "shutdown".
  The main thread will then SIGTERM to each of the remaining threads.
  This is a nop because this signal is blocked.
  Send SIGUSR1 instead which is waited for.

While doing all of this, report the actual `max' value.

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: John Kacur <jkacur@redhat.com>
2020-11-10 15:04:05 -05:00
Sebastian Andrzej Siewior fb1f1fd894 signaltest: Don't expect trace interface at /proc
This was never merged.

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: John Kacur <jkacur@redhat.com>
2020-11-10 15:02:15 -05:00
Sebastian Andrzej Siewior 1f7ef38e1a signaltest: Remove drunk code
`oldtrace' is set for kernels prior 2.6.18. Remove "support" for them.

The alternative code (for new kernels) issues
	prctl(0, [01]);

which is not valid the kernel returns an error. I have no idea what its
purpose is, remove it.

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: John Kacur <jkacur@redhat.com>
2020-11-10 15:00:43 -05:00
Sebastian Andrzej Siewior 3aed30fa0d cyclictest: Only report the first incident
Record only the first incident including tid, value and trace event.
If multiple threads exceed the limit then the reported `tid' might not
match the reported value.

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
- minor grammar and spelling edit
Signed-off-by: John Kacur <jkacur@redhat.com>
2020-11-10 14:58:50 -05:00
John Kacur feb54eaf30 rt-tests: svsematest.c: Fix various style problems
Fix various style problems as reported by checkpatch.pl
For example, spacing around "<", indentation of a lable, and so on.

Signed-off-by: John Kacur <jkacur@redhat.com>
2020-10-29 13:30:13 -04:00
John Kacur bb32f4863f rt-tests: ssdd.c: Remove unncessary "else"
remove unnecessary "else" and also fix function header.

Signed-off-by: John Kacur <jkacur@redhat.com>
2020-10-29 13:28:10 -04:00
John Kacur c9ef96f3c8 rt-tests: sigwaittest.c: Fix spacing around brackets
Fix spacing around brackets, Fix indented lable, etc

Signed-off-by: John Kacur <jkacur@redhat.com>
2020-10-29 13:27:03 -04:00
John Kacur 93ba2235ee rt-tests: signaltest.c: Fix various style problems
Fix various style problems suggested by checkpatch.pl

Signed-off-by: John Kacur <jkacur@redhat.com>
2020-10-29 13:25:50 -04:00
John Kacur 7437a2e2f8 rt-tests: deadline_test.c: Fix spacing around commas
Fix spacing around commas and remove unnecessary brackets

Signed-off-by: John Kacur <jkacur@redhat.com>
2020-10-29 13:23:20 -04:00
John Kacur 6f87b9a7a5 rt-tests: cyclicdeadline.c: Fix spacing around commas
Fix spacing around commas and remove unnecessary brackets

Signed-off-by: John Kacur <jkacur@redhat.com>
2020-10-29 13:21:45 -04:00
John Kacur 91bd57c1fd rt-tests: rt-migrate-test.c: Fix spacing around parentheses
Fix improper spacing around parentheses

Signed-off-by: John Kacur <jkacur@redhat.com>
2020-10-29 13:20:27 -04:00
John Kacur ec30b95c5a rt-tests: queuelat.c: Fix various style problems
Fix various style problems such as spaces in indentation instead of
tabs, unsigned long long int, to just unsigned long long, and so on.

Signed-off-by: John Kacur <jkacur@redhat.com>
2020-10-29 13:19:10 -04:00
John Kacur d7c0ea22fd rt-tests: ptsematest.c: Fix spacing around parentheses
Fix spacing around parentheses as suggested by checkpatch.pl

Signed-off-by: John Kacur <jkacur@redhat.com>
2020-10-29 13:17:49 -04:00
John Kacur 8cc670be67 rt-tests: pmqtest.c: Fix spacing around parentheses
Fix spacing around parentheses as suggestsed by checkpatch.pl

Signed-off-by: John Kacur <jkacur@redhat.com>
2020-10-29 13:16:33 -04:00
John Kacur ca10abadcd rt-tests: pip_stress.c: Remove unnecessary brackets
Remove unnecessary brackets as suggested by checkpatch.pl

Signed-off-by: John Kacur <jkacur@redhat.com>
2020-10-29 13:14:59 -04:00
John Kacur ba6340ecdb rt-tests: pi_stress.c: Change unsigned to unsigned int
Change unsigned to unsigned int as suggested by checkpatch

Signed-off-by: John Kacur <jkacur@redhat.com>
2020-10-29 13:13:54 -04:00
John Kacur 529b233b2b rt-tests: rt-utils.c: Correct mix of spaces and tabs in code indentation
Fix the mix of spaces and tabs in the code indentation.

Signed-off-by: John Kacur <jkacur@redhat.com>
2020-10-29 13:12:06 -04:00
John Kacur 28d159fc3d rt-tests: rt-sched.c: Style change
Style change from checkpatch.pl

Signed-off-by: John Kacur <jkacur@redhat.com>
2020-10-29 13:11:01 -04:00
John Kacur ed154d0fd5 rt-tests: cyclictest: A few style changes from checkpatch.pl
A few style changes as suggested by checkpatch.pl

Please note not everything that checkpatch reports will be applicable to
rt-tests.

Signed-off-by: John Kacur <jkacur@redhat.com>
2020-10-29 13:08:36 -04:00
John Kacur 9fe532b50e rt-tests: remove pi_tests.spec
This is an ancient spec file from way back before this program was
included in the rt-tests suite. There is no need to keep it around
anymore.

Signed-off-by: John Kacur <jkacur@redhat.com>
2020-10-26 14:41:01 -04:00
Daniel Wagner 4af0fb285a hackbench: Streamline usage and man page
Signed-off-by: Daniel Wagner <dwagner@suse.de>
Signed-off-by: John Kacur <jkacur@redhat.com>
2020-10-23 15:01:34 -04:00
Daniel Wagner 5317558c74 svsematest: Streamline usage and man page
Signed-off-by: Daniel Wagner <dwagner@suse.de>
Signed-off-by: John Kacur <jkacur@redhat.com>
2020-10-23 14:58:40 -04:00
Daniel Wagner 2f904fe540 ssdd: Streamline usage and man page
Signed-off-by: Daniel Wagner <dwagner@suse.de>
Signed-off-by: John Kacur <jkacur@redhat.com>
2020-10-23 14:56:46 -04:00
Daniel Wagner 5d1727fd8c sigwaittest: Streamline usage and man page
Signed-off-by: Daniel Wagner <dwagner@suse.de>
Signed-off-by: John Kacur <jkacur@redhat.com>
2020-10-23 14:51:27 -04:00
Daniel Wagner 97b3e350d6 signaltest: Streamline usage and man page
Signed-off-by: Daniel Wagner <dwagner@suse.de>
Signed-off-by: John Kacur <jkacur@redhat.com>
2020-10-23 14:49:31 -04:00
Daniel Wagner bf1b0c0e64 rt-migrate-test: Streamline usage and man page
Signed-off-by: Daniel Wagner <dwagner@suse.de>
Signed-off-by: John Kacur <jkacur@redhat.com>
2020-10-23 14:46:44 -04:00
John Kacur 9cf1ed27b7 rt-tests: queuelat: Remove unused variable 'index'
Compiling queuelat reveals the unusued variable 'index'
removing it.

Signed-off-by: John Kacur <jkacur@redhat.com>
2020-10-23 14:40:58 -04:00
Daniel Wagner 60bc8bcbaf queuelat: Streamline usage and man page
Signed-off-by: Daniel Wagner <dwagner@suse.de>
Signed-off-by: John Kacur <jkacur@redhat.com>
2020-10-23 14:38:53 -04:00
Daniel Wagner f072b58955 ptsematest: Streamline usage output and man page
Signed-off-by: Daniel Wagner <dwagner@suse.de>
Signed-off-by: John Kacur <jkacur@redhat.com>
2020-10-23 14:24:59 -04:00
Daniel Wagner d5c472ef0d pmqtest: Streamline usage output and man page
Signed-off-by: Daniel Wagner <dwagner@suse.de>
Signed-off-by: John Kacur <jkacur@redhat.com>
2020-10-23 14:09:52 -04:00
Daniel Wagner 3ef71ab4c4 pi_stress: Streamline usage output and man page
Signed-off-by: Daniel Wagner <dwagner@suse.de>
Signed-off-by: John Kacur <jkacur@redhat.com>
2020-10-23 13:35:33 -04:00
Daniel Wagner 1325cb7e9e pip_stress: Add command line parser
Add a default command line parser to print at least the current
version.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
Signed-off-by: John Kacur <jkacur@redhat.com>
2020-10-23 13:30:03 -04:00
Daniel Wagner e411219d27 oslat: Streamline usage output and man page
Signed-off-by: Daniel Wagner <dwagner@suse.de>
Signed-off-by: John Kacur <jkacur@redhat.com>
2020-10-23 13:18:27 -04:00
Daniel Wagner 438d27afb4 deadline_test: Streamline usage output and man page
Signed-off-by: Daniel Wagner <dwagner@suse.de>
Signed-off-by: John Kacur <jkacur@redhat.com>
2020-10-23 12:09:23 -04:00
Daniel Wagner 9723329835 cyclicdeadline: Add long command line options
Use getopt_long to parse long version of the commands.

Change the 'a/affinity' option to handle all cases including what '-c'
did. We still keep '-c' silently supported to avoid breaking existing
users.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
Signed-off-by: John Kacur <jkacur@redhat.com>
2020-10-23 12:02:44 -04:00
Daniel Wagner 10d33ed05b cyclicdeadline: Streamline usage output and man page
Signed-off-by: Daniel Wagner <dwagner@suse.de>
Signed-off-by: John Kacur <jkacur@redhat.com>
2020-10-23 11:58:52 -04:00
Daniel Wagner 76ad600da8 cyclictest: Use numa library helpers in get_available_cpus()
The numa library has support for counting the bits in the affinity
mask and how many CPUs are available and usable by the tasks. Let's
use those helpers.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
Signed-off-by: John Kacur <jkacur@redhat.com>
2020-10-23 11:52:45 -04:00
Peter Xu 165b597e30 rt-tests: oslat: Allow build for not supported archs
Now rt-tests won't build for archs other than x86/i386/ppc64 after oslat is
merged.  Instead of failing the build, let's make it pass.  However, whenever
oslat is executed, instead of running the real program, dump an error message,
so that people can try to implement the frc() function for it when there's a
real need for the new arch.

Signed-off-by: Peter Xu <peterx@redhat.com>
Signed-off-by: John Kacur <jkacur@redhat.com>
2020-10-23 10:52:15 -04:00
John Kacur 08f3ec6fed rt-tests: makefile: undefine PYLIB if empty
The makefile will run a shell command to determine the location of the
python libraries. If an error occurs, for example if the system doesn't
have python installed on it, undefine PYLIB

This prevents undesired side effects such as installing man pages for
utilities that will not be installed and does not interfere with other
conditionals such as if test -n "${PYLIB]"

Signed-off-by: John Kacur <jkacur@redhat.com>
2020-10-19 15:22:56 -04:00
Anders Roxell 3d1976ba3c Makefile: manpages: only add get_cyclictest_snapshot if PYLIB
Since the installation of get_cyclictest_snapshot.py is done if PYLIB
then we should only install the manpages then as well.

Signed-off-by: Anders Roxell <anders.roxell@linaro.org>
Signed-off-by: John Kacur <jkacur@redhat.com>
2020-10-19 15:11:47 -04:00
John Kacur 21c1df7d2e rt-tests: Makefile - update version to v1.9
Update the version in the Makefile to v1.9

Signed-off-by: John Kacur <jkacur@redhat.com>
2020-09-18 16:02:13 -04:00
Daniel Wagner 170a8ce6de signaltest: Only print from the first thread stats when quiet
When the quiet option is used don't print all threads stats. The first
thread will pause every 16 cycles for 10000us. This will show up in
the max values for all other threads when the final results are
printed:

 # signaltest -q  -D 2s
 T: 0 ( 4517) P: 0 C:   3121 Min:      5 Act:    8 Avg:    8 Max:      19
 T: 1 ( 4518) P: 0 C:   3121 Min:      5 Act:10065 Avg:  639 Max:   10073

We could also remove the sleep but then the system gets fully loaded
by the test. Furthermore, we would keep the path pretty hot and that's
not ideal if one wants to test the eratic signal behavior. So only
consider the first thread for the stats.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
Signed-off-by: John Kacur <jkacur@redhat.com>
2020-09-03 13:37:17 -04:00
Daniel Wagner c13d4418b1 rt-utils: Move ARRAY_SIZE to common header
Move the ARRAY_SIZE macro to a common header to avoid code
duplication.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
Signed-off-by: John Kacur <jkacur@redhat.com>
2020-09-03 10:35:04 -04:00
Daniel Wagner 7d947e8e62 rt-utils: Move time defininitions to common header
Several tests define the same time values. Move them all to
common header to avoid code duplication.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
Signed-off-by: John Kacur <jkacur@redhat.com>
2020-09-03 10:24:15 -04:00
Daniel Wagner 9f2ecf3c57 rt-utils: Move timestamp calc helper to common header
Several test implement the same helpers. Move it to a
common header to avoid code duplication.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
Signed-off-by: John Kacur <jkacur@redhat.com>
2020-09-03 10:18:00 -04:00
Peter Xu 8dad377d0e rt-tests: oslat: Proper reformat of code
Format the code with kernel coding style.  Meanwhile use spdx license
identifier as suggested by John.

Signed-off-by: Peter Xu <peterx@redhat.com>
Signed-off-by: John Kacur <jkacur@redhat.com>
2020-08-20 09:46:02 -04:00
Peter Xu c86dec5765 rt-tests: oslat: Init commit
oslat was initially a standalone program [1].  This patch merges oslat into
rt-tests repo.

This is a direct port of oslat v0.1.7 into rt-tests.  It naturally bumps the
version to latest rt-tests version.

[1] https://github.com/xzpeter/oslat

Signed-off-by: Peter Xu <peterx@redhat.com>
A few minor fixes to the grammar in the man page
Signed-off-by: John Kacur <jkacur@redhat.com>
2020-08-18 16:48:08 -04:00