Commit Graph

997 Commits

Author SHA1 Message Date
Daniel Wagner c7a3abe6be rt-migrate-test: Add JSON output feature
Write the test results as JSON output to a file. This allows to
simplifies any parsing later on.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
Signed-off-by: John Kacur <jkacur@redhat.com>
2021-02-16 22:29:36 -05:00
Daniel Wagner 4db4a76fab oslat: Add JSON output feature
Write the test results as JSON output to a file. This allows to
simplifies any parsing later on.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
- Added a space after a common parse_options
Signed-off-by: John Kacur <jkacur@redhat.com>
2021-02-16 22:27:19 -05:00
Daniel Wagner 09edaef71d svsematest: Add JSON output feature
Write the test results as JSON output to a file. This allows to
simplifies any parsing later on.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
Signed-off-by: John Kacur <jkacur@redhat.com>
2021-02-16 22:25:15 -05:00
Daniel Wagner cbbe3e1ab8 ptsematest: Add JSON output feature
Write the test results as JSON output to a file. This allows to
simplifies any parsing later on.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
Signed-off-by: John Kacur <jkacur@redhat.com>
2021-02-16 22:11:18 -05:00
Daniel Wagner e11e675ecd pmqtest: Add JSON output feature
Write the test results as JSON output to a file. This allows to
simplifies any parsing later on.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
Signed-off-by: John Kacur <jkacur@redhat.com>
2021-02-16 22:08:37 -05:00
Daniel Wagner 68621f3c33 cyclicdeadline: Add JSON output feature
Write the test results as JSON output to a file. This allows to
simplifies any parsing later on.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
Signed-off-by: John Kacur <jkacur@redhat.com>
2021-02-16 22:02:51 -05:00
Daniel Wagner 24aaf9619b cyclictest: Add JSON output feature
Write the test results as JSON output to a file. This allows to
simplifies any parsing later on.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
- Added a space after a comma in fprintf
Signed-off-by: John Kacur <jkacur@redhat.com>
2021-02-16 21:55:55 -05:00
Daniel Wagner e6ca03989f rt-utils: Add JSON common header output helper
rt_write_json writes the common system information header of the
rt-test currently executed.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
2021-02-16 21:50:56 -05:00
Daniel Wagner 07445ec798 rt-tests: Rename error.h to rt-error.h
Avoid confusion with the system header called error.h.

Signed-off-by: Daniel Wagner <dwagner@suse.de>

- Fixed a conflict in cyclictest.c
- Fixed up rt_numa.h
Signed-off-by: John Kacur <jkacur@redhat.com>
2021-02-16 20:08:00 -05:00
John Kacur af0a1e9758 rt-tests: oslat: Allocate memory for cpu_set
- cpu_set is a pointer to a bitmask struct
Memory needs to be allocated for the struct, so call
numa_allocate_cpumask()

- use rt-tests fatal to exit on error conditions

Reviewed-by: Daniel Wagner <dwagner@suse.de>
Signed-off-by: John Kacur <jkacur@redhat.com>
2021-02-12 13:13:22 -05:00
Daniel Wagner 27511be8f7 oslat: Use cpuset size as upper bound
To assign the threads to the correct CPU we need to use the cpuset
size as upper bound for the loop and not the number of threads.

Fixes: 85b0763dac ("oslat: Use parse_cpumask() from rt-numa.h")
Reported-by: Peter Xu <peterx@redhat.com>
Signed-off-by: Daniel Wagner <dwagner@suse.de>
Signed-off-by: John Kacur <jkacur@redhat.com>
2021-02-12 11:15:36 -05:00
John Kacur a1b862a788 rt-tests: oslat: print version string
During the streamlining of the command line options something went awry
with the version. The author of oslat wishes to always print the version
string. This allows us to just exit in the case of -v

Fixes e411219d27

Reported-by: Pradipta Kumar Sahoo <psahoo@redhat.com>
Reported-by: Reported-by: Peter Xu <peterx@redhat.com>

Signed-off-by: John Kacur <jkacur@redhat.com>
2021-02-12 11:15:14 -05:00
Daniel Wagner eadb1a917e rt-numa: Use error message helpers
As we have our small error message helpers use them.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
Signed-off-by: John Kacur <jkacur@redhat.com>
2021-01-26 01:39:25 -05:00
Daniel Wagner 3079f1b10d signaltest: Always use libnuma
libnuma is hard dependency for signaltest. Thus we can always call
numa_initialize(). This allows us to remove the global 'numa' variable
to track if libnuma has been initialized or not.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
Signed-off-by: John Kacur <jkacur@redhat.com>
2021-01-26 01:29:23 -05:00
Daniel Wagner eb6c89ce89 cyclictest: Move verbose message into main
By moving the verbose message down we print the message with the final
affinity_mask. This also handles the case where the bitmask is not set.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
Signed-off-by: John Kacur <jkacur@redhat.com>
2021-01-26 01:27:19 -05:00
Daniel Wagner 1b00086f24 cyclicdeadline: Remove unused struct thread_param
There is no user for this data struct. Remove it.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
Signed-off-by: John Kacur <jkacur@redhat.com>
2021-01-26 01:22:18 -05:00
Daniel Wagner 2433a5266d cyclicdeadline: Add missing step command line argument
When adding long command line options support the --step
argument was missed out. Add it back.

Fixes: 9723329835 ("cyclicdeadline: Add long command line options")
Signed-off-by: Daniel Wagner <dwagner@suse.de>
Signed-off-by: John Kacur <jkacur@redhat.com>
2021-01-26 01:19:24 -05:00
Daniel Wagner 890ce10e6f cyclictest: Remove libnuma API version 1 support
The code depends on libnuma API version 2 or higher. Remove the
leftover.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
Signed-off-by: John Kacur <jkacur@redhat.com>
2021-01-26 01:15:35 -05:00
Daniel Wagner e09c649c3a ptsematest: Return correct exit code when showing help
Instead always return success, use the provided exist code.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
Signed-off-by: John Kacur <jkacur@redhat.com>
2021-01-26 01:08:41 -05:00
Daniel Wagner 8ac90e7ad3 pip_stress: De-constify prio_min
This variables is updated by the result of
sched_get_priority_min(). Hence, it can't be const.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
Signed-off-by: John Kacur <jkacur@redhat.com>
2021-01-26 01:06:12 -05:00
Daniel Wagner 8305e65092 cyclictest: Use affinity_mask for steering thread placement
We don't need an extra variable to track the state if a bitmask is
available or not. Check directly if the mask is usable.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
- fixed spelling of "steering"
Signed-off-by: John Kacur <jkacur@redhat.com>
2021-01-26 00:39:11 -05:00
Daniel Wagner 512d2b7456 cyclictest: Always use libnuma
libnuma is hard dependency for cyclictest. Thus we can always call
numa_initialize(). This allows us to remove the global 'numa' variable
to track if libnuma has been initialized or not.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
Signed-off-by: John Kacur <jkacur@redhat.com>
2021-01-26 00:09:26 -05:00
Jonathan Schwender 244f6ebd05 cyclictest: Fix --affinity when intermediate CPUs are offline
Use max_cpus = sysconf(_SC_NPROCESSORS_CONF) to determine the number of
the maximum CPU (+1).
The cpu_for_thread_*() functions check the first max_cpus bits
in the cpuset / cpumask.
This fixes failing to set the affinity to CPUs >= num_online_cpus,
if some intermediate CPU is offline, e.g. on an AMD system
with nosmt.

Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
Signed-off-by: John Kacur <jkacur@redhat.com>
2021-01-22 18:44:26 -05:00
John Kacur 1c65835407 rt-tests: rm scripts/do-git-push
Remove this old script for maintaining rt-tests.
I have some new scripts that do this kind of thing that I maintain
out of tree, which I think is more appropriate anyway.

Signed-off-by: John Kacur <jkacur@redhat.com>
2021-01-22 18:37:54 -05:00
John Kacur 32819581cc rt-tests: Makefile - update version to v1.10
Update the version in the Makefile to v1.10 for a new release

Signed-off-by: John Kacur <jkacur@redhat.com>
2020-12-22 16:30:14 -05:00
John Kacur a199be80f2 rt-tests: determine_maximum_mpps.sh: Change the -c option to -a
Change -c to -a so that the options in this program match the options
of the other programs in the rt-tests suite as much as possible

Signed-off-by: John Kacur <jkacur@redhat.com>
Reviewed-by: Daniel Wagner <dwagner@suse.de>
2020-12-16 22:36:28 -05:00
John Kacur 009954ca65 rt-tests: queuelat: Add a manpage for determine_maximum_mpps.sh
Add a manpage for determine_maximum_mpps.sh

Signed-off-by: John Kacur <jkacur@redhat.com>
2020-12-09 12:26:53 -05:00
John Kacur a6114da09c rt-tests: queuelat: Remove get_cpuinfo_mhz.sh and old Makefile
The functionality in get_cpuinfo_mhz.sh has been incorporated into
determine_maximum_mpps.sh, so it can safely be removed.

The queuelat is built from the rt-tests suite Makefile, and the old
Makefile in the queuelat directory can be removed.

Signed-off-by: John Kacur <jkacur@redhat.com>
2020-12-09 12:24:57 -05:00
John Kacur ed50451798 rt-tests: determine_maximum_mpps.sh: Add a menu to get user settings.
Incorporate the functionality of the get_cpuinfo_mhz.sh script into
determine_maximum_mpps.sh so that get_cpuinfo_mhz.sh can be removed.

Currently determine_maximum_mpps.sh (part of queuelat) asks the user
to edit the PREAMBLE in the script to set the environment.

Get rid of this by creating a menu that allows the user the set these
variables from a menu when running the script.

Here is the output from running the script with the -h option

./src/queuelat/determine_maximum_mpps.sh -h
Usage:
determine_maximum_mpps.sh [OPTIONS]

-c cpulist
	List of processors to run on. The default is processor 0
	Numbers are separated by commas and may include ranges. Eg. 0,3,7-11
-m maxlat
	maximum latency in nanoseconds. The default is 20000
	if the maximum is exceeded, that run of queuelat quits
-n cycles
	Estimated number of cycles it takes to process one packet
	The default is 300
-f
	Set the scheduling policy to SCHED_FIFO.
	This is the default if not specified
-r
	Set the scheduling policy to SCHED_RR.
-p priority
	default priority = 1. Valid numbers are from 1 to 99
-h
	help
	print this help message and exit

Signed-off-by: John Kacur <jkacur@redhat.com>
2020-12-09 12:18:45 -05:00
Daniel Wagner 8a0c3d909c rt-migrate-test: Add quiet command line option
The quiet option is useful for automated test setups where
only the final result of the run is interesting. This avoids
to fill up the logs.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
Signed-off-by: John Kacur <jkacur@redhat.com>
2020-12-01 02:16:50 -05:00
Daniel Wagner 413695c9cd sigwaittest: Add quiet command line option
The quiet option is useful for automated test setups where
only the final result of the run is interesting. This avoids
to fill up the logs.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
Signed-off-by: John Kacur <jkacur@redhat.com>
2020-12-01 02:15:46 -05:00
Daniel Wagner 653d58fdd1 sigwaittest: Move statictic output into print_stat()
Prepare the code to introduce the quiet command line option by moving
the statistic output code into print_stat(). We follow here the
pattern from cyclictest.

While at it replace the rather sophisticated error printing code with
a fatal(). Just fail if something is not working.

Also reorder the include headers so that project local headers follow
the system include headers.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
Signed-off-by: John Kacur <jkacur@redhat.com>
2020-12-01 02:14:12 -05:00
Daniel Wagner 5b9c83a437 svsematest: Add quiet command line option
The quiet option is useful for automated test setups where
only the final result of the run is interesting. This avoids
to fill up the logs.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
Signed-off-by: John Kacur <jkacur@redhat.com>
2020-12-01 02:12:04 -05:00
Daniel Wagner a4a13cb99b svsematest: Move statictic output into print_stat()
Prepare the code to introduce the quiet command line option by moving
the statistic output code into print_stat(). We follow here the
pattern from cyclictest.

While at it replace the rather sophisticated error printing code with
a fatal(). Just fail if something is not working.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
Signed-off-by: John Kacur <jkacur@redhat.com>
2020-12-01 02:10:44 -05:00
Daniel Wagner 54e328903e ptsematest: Add quiet command line option
The quiet option is useful for automated test setups where
only the final result of the run is interesting. This avoids
to fill up the logs.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
Signed-off-by: John Kacur <jkacur@redhat.com>
2020-12-01 02:08:36 -05:00
Daniel Wagner 67830fee53 ptsematest: Move statictic output into print_stat()
Prepare the code to introduce the quiet command line option by moving
the statistic output code into print_stat(). We follow here the
pattern from cyclictest.

While at it replace the rather sophisticated error printing code with
a fatal(). Just fail if something is not working.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
Signed-off-by: John Kacur <jkacur@redhat.com>
2020-12-01 02:06:25 -05:00
Daniel Wagner bb62fa3786 pmqtest: Add quiet command line option
The quiet option is useful for automated test setups where
only the final result of the run is interesting. This avoids
to fill up the logs.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
2020-12-01 02:04:06 -05:00
Daniel Wagner 6662cb4021 pmqtest: Move statictic output into print_stat()
Prepare the code to introduce the quiet command line option by moving
the statistic output code into print_stat(). We follow here the
pattern from cyclictest.

While at it replace the rather sophisticated error printing code with
a fatal(). Just fail if something is not working.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
Signed-off-by: John Kacur <jkacur@redhat.com>
2020-12-01 02:01:55 -05:00
Daniel Wagner 28fecad2e9 cyclicdeadline: Add quiet command line option
The quiet option is useful for automated test setups where
only the final result of the run is interesting. This avoids
to fill up the logs.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
Signed-off-by: John Kacur <jkacur@redhat.com>
2020-12-01 01:59:06 -05:00
Daniel Wagner 253065e582 cyclicdeadline: Use common error handlers
Use the common error handlers. This will make the fatal, error and
debug output consistent with the output from cyclictest. The current
normal output is not changed.

While at it drop the 'fail' flag and use 'shutdown' flag which does
the same thing.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
- Fixed indentation to use tabs instead of spaces for the line after
  make_cpuset()
- Fixed bare unsigned flags to unsigned int flags
Signed-off-by: John Kacur <jkacur@redhat.com>
2020-12-01 01:54:00 -05:00
Daniel Wagner 5128a4192d cyclicdeadline: Remove dead code
my_sprintf() is not used, remove it.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
Signed-off-by: John Kacur <jkacur@redhat.com>
2020-12-01 01:28:47 -05:00
John Kacur d4d45924d1 rt-tests: Don't compress man pages by default
This patch changes the default behavior of the Makefile to install
man pages without compression. This allows distribution build systems to
use the kind of compression they wish to use without the Makefile
getting in the way.

It is still possible to compress the man pages using the Makefile, for
example

make MAN_COMPRESSION=gzip

or

make MAN_OMPRESSION=bzip2

Signed-off-by: John Kacur <jkacur@redhat.com>
2020-11-21 00:09:50 -05:00
Daniel Wagner 590846ff2a signaltest: Implement thread placing
Without setting the thread affinity, the scheduler will move the
threads around which will lead to spikes. Since any proper realtime
application will use thread affinity, let's pin down the threads to
CPUs.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
- Fixed spelling of "initialize" in the code
Signed-off-by: John Kacur <jkacur@redhat.com>
2020-11-20 16:43:05 -05:00
Daniel Wagner 6db1a48944 rt-numa: Move thread placement code to rt-numa library
cyclictest contains code for calculating where to place threads
according to the cpumask. Let's move it the rt-numa library to be able to
reuse it.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
- small spelling / grammar fix in description
- fixed spelling of initialize in code
Signed-off-by: John Kacur <jkacur@redhat.com>
2020-11-20 16:33:30 -05:00
Daniel Wagner 85b0763dac oslat: Use parse_cpumask() from rt-numa.h
Use the common parse_cpumask() helper and use struct bitmask directly
instead of transforming it into a CPU_SET first.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
minor edit to the message
Signed-off-by: John Kacur <jkacur@redhat.com>
2020-11-18 16:18:02 -05:00
Daniel Wagner dfd42a63d9 cyclictest: Use parse_cpumask() from rt-numa.h
Use the helper function from rt-numa.h to parse the cpumask from the
command line.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
Fixed a minor spelling mistake in the message.
Signed-off-by: John Kacur <jkacur@redhat.com>
2020-11-18 16:15:03 -05:00
Daniel Wagner 308b753fc8 rt-numa: Introduce NUMA helpers
A common task is to parse the provided cpumask from the command
line. Add a helper which uses libnuma. Since we don't want to add
unnecessary dependencies for tests which don't need this helper create
a new library containing the NUMA bits.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
Adding my name to the copyright in the new file src/lib/rt-numa.c
as some of the functions moved here are ones that I've written or
modified / maintained etc.
Signed-off-by: John Kacur <jkacur@redhat.com>
2020-11-18 16:07:09 -05:00
Daniel Wagner 7805058228 cyclictest: Remove deadcode checking for NUMA
The NUMA library is always present for cyclictest, thus NUMA config is
always defined. Remove deadcode.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
Signed-off-by: John Kacur <jkacur@redhat.com>
2020-11-18 16:00:44 -05:00
Daniel Wagner e7f2510fde oslat: Use string parser utilies
Use available parse_time_string() instead locally implemented
version. While at it move the mem parser helper to the global utility
header.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
Signed-off-by: John Kacur <jkacur@redhat.com>
2020-11-18 15:59:28 -05:00
Daniel Wagner bb396a8573 rt-utils: Introduce parse_mem_string()
Add helper to parse common memory prefixes on strings.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
Signed-off-by: John Kacur <jkacur@redhat.com>
2020-11-17 13:27:35 -05:00