Commit Graph

716 Commits

Author SHA1 Message Date
Daniel Wagner a82c7e81b4 ssdd: Add quiet command line option
The quiet option is useful for automated test setups where
only the final result of the run is interesting.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
Signed-off-by: John Kacur <jkacur@redhat.com>
2021-05-07 12:24:45 -04:00
Daniel Wagner d7734bcae0 pi_stress: 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-05-07 12:24:45 -04:00
Daniel Wagner 77ae713003 pi_stress: Prepare command line parser for long options only
Introduce option value enums in order to be able to parse long options
only.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
Signed-off-by: John Kacur <jkacur@redhat.com>
2021-05-07 12:24:45 -04:00
Daniel Wagner 9f90248b2d rt-util: Add return_code to common section of JSON output
Many rt-tests return an error code if the test fails. Let's add
this information to the common section.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
Signed-off-by: John Kacur <jkacur@redhat.com>
2021-05-07 12:24:45 -04:00
Daniel Wagner 5f0864dda9 svsematest: Record start of test execution
Use rt_test_start() to record a timestamp when the test starts.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
Signed-off-by: John Kacur <jkacur@redhat.com>
2021-05-07 12:24:45 -04:00
Daniel Wagner 69519203e6 sigwaittest: Record start of test execution
Use rt_test_start() to record a timestamp when the test starts.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
Signed-off-by: John Kacur <jkacur@redhat.com>
2021-05-07 12:24:45 -04:00
Daniel Wagner 5d15b2e607 signaltest: Record start of test execution
Use rt_test_start() to record a timestamp when the test starts.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
Signed-off-by: John Kacur <jkacur@redhat.com>
2021-05-07 12:24:45 -04:00
Daniel Wagner 5694e46b75 cyclicdeadline: Record start of test execution
Use rt_test_start() to record a timestamp when the test starts.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
Signed-off-by: John Kacur <jkacur@redhat.com>
2021-05-07 12:24:45 -04:00
Daniel Wagner 4b7248df5c rt-migrate-test: Record start of test execution
Use rt_test_start() to record a timestamp when the test starts.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
Signed-off-by: John Kacur <jkacur@redhat.com>
2021-05-07 12:24:45 -04:00
Daniel Wagner ce0892a908 ptesematest: Record start of test execution
Use rt_test_start() to record a timestamp when the test starts.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
Signed-off-by: John Kacur <jkacur@redhat.com>
2021-05-07 12:24:45 -04:00
Daniel Wagner 1f59a08599 pmqtest: Record start of test execution
Use rt_test_start() to record a timestamp when the test starts.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
Signed-off-by: John Kacur <jkacur@redhat.com>
2021-05-07 12:24:45 -04:00
Daniel Wagner 78fd3bc873 oslat: Record start of test execution
Use rt_test_start() to record a timestamp when the test starts.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
Signed-off-by: John Kacur <jkacur@redhat.com>
2021-05-07 12:24:45 -04:00
Daniel Wagner 426c94e536 cyclictest: Record start of test execution
Use rt_test_start() to record a timestamp when the test starts.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
Signed-off-by: John Kacur <jkacur@redhat.com>
2021-05-07 12:24:45 -04:00
Daniel Wagner 19ae9c38b3 rt-util: Introduce rt_test_start()
For the JSON output records a timestamp when the test ended.
Let's introduce a new API to record a timestamp when the test
starts. We could put this into rt_init() but in this case we
would meassure also the time test needs to setup or warm up.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
Signed-off-by: John Kacur <jkacur@redhat.com>
2021-05-07 12:24:45 -04:00
Daniel Wagner a0dba1fe07 rt-util: Remove superfluous arguments from rt_write_json
We copy the command line via the rt_init() API and don't need
the argc, argv arguments for rt_write_json. Remove them.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
Signed-off-by: John Kacur <jkacur@redhat.com>
2021-05-07 12:24:45 -04:00
Daniel Wagner 4b953580db svematest: Initialize rt-util
Allow rt-util make a copy of the command line.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
Signed-off-by: John Kacur <jkacur@redhat.com>
2021-05-07 12:24:45 -04:00
Daniel Wagner a3a0a2e94f sigwaittest: Initialize rt-util
Allow rt-util make a copy of the command line.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
Signed-off-by: John Kacur <jkacur@redhat.com>
2021-05-07 12:24:45 -04:00
Daniel Wagner 38c7f1f36f signaltest: Initialize rt-util
Allow rt-util make a copy of the command line.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
Signed-off-by: John Kacur <jkacur@redhat.com>
2021-05-07 12:24:45 -04:00
Daniel Wagner f80f2be8f5 cyclicdeadline: Initialize rt-util
Allow rt-util make a copy of the command line.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
Signed-off-by: John Kacur <jkacur@redhat.com>
2021-05-07 12:24:45 -04:00
Daniel Wagner 99654cb223 rt-migrate-test: Initialize rt-util
Allow rt-util make a copy of the command line.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
Signed-off-by: John Kacur <jkacur@redhat.com>
2021-05-07 12:24:45 -04:00
Daniel Wagner 516d926451 ptsematest: Initialize rt-util
Allow rt-util make a copy of the command line.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
Signed-off-by: John Kacur <jkacur@redhat.com>
2021-05-07 12:24:45 -04:00
Daniel Wagner c88f922353 pmqtest: Initialize rt-util
Allow rt-util make a copy of the command line.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
Signed-off-by: John Kacur <jkacur@redhat.com>
2021-05-07 12:24:45 -04:00
Daniel Wagner 94bf9fc04d oslat: Initialize rt-util
Allow rt-util make a copy of the command line.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
Signed-off-by: John Kacur <jkacur@redhat.com>
2021-05-07 12:24:45 -04:00
Daniel Wagner 5e313b6c76 cyclictest: Initialize rt-util
Allow rt-util make a copy of the command line.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
Signed-off-by: John Kacur <jkacur@redhat.com>
2021-05-07 12:24:45 -04:00
Daniel Wagner a9fc7fac63 rt-util: Add rt_init function
rt_init() should be called as first in the test program.
The main job for this function is to copy the command line
before getopt() runs. By default, getopt_long() permutes
the contents of argv as it scans, so that eventually all the
nonoptions are at the end. This is confusing in the JSON
output, thus copy the command line before we call getopt_long().

Signed-off-by: Daniel Wagner <dwagner@suse.de>
Signed-off-by: John Kacur <jkacur@redhat.com>
2021-05-07 12:24:45 -04:00
Daniel Wagner 3afeb71c96 signaltest: Add missing --output usage info
signaltest: Add missing --output usage info
Note: the code to process this was already in place, only the usage
info was missing.

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

Added missing commit description
Signed-off-by: John Kacur <jkacur@redhat.com>
2021-05-07 12:24:45 -04:00
Daniel Wagner 9fc0d01904 cyclicdeadline: Remove unused include header
The header was introduced by 68621f3c33 ("cyclicdeadline: Add JSON
output feature")for PRIu64 format specifier. As PRIu64 was removed in
commit 51255cc14051 ("cyclicdeadline.c: Fix printf format specifier")
remove the include header again.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
Signed-off-by: John Kacur <jkacur@redhat.com>
2021-05-07 12:24:45 -04:00
Daniel Wagner 3e72bd2732 cyclictest: Remove unused include header
The header was introduced by 24aaf9619b ("cyclictest: Add JSON
output feature") for PRIu64 format specifier. As PRIu64 was removed in
commit f6881fc42b ("cyclictest: Fix printf format specifier") remove
the include header again.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
Signed-off-by: John Kacur <jkacur@redhat.com>
2021-05-07 12:24:45 -04:00
Daniel Wagner 95066b1a1a cyclicdeadline.c: Fix printf format specifier
The fields are not uint64 just longs, update the printf format
specifiers.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
Also Reported-by: Signed-off-by: Christian Eggers <ceggers@arri.de>
Signed-off-by: John Kacur <jkacur@redhat.com>
2021-03-03 18:22:55 -05:00
Daniel Wagner f6881fc42b cyclictest: Fix printf format specifier
The fields are not uint64 just longs, update the printf format
specifiers.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
Also Reported-by: Christian Eggers <ceggers@arri.de>
Signed-off-by: John Kacur <jkacur@redhat.com>
2021-03-03 18:22:38 -05:00
John Kacur 05a1170b8e rt-tests: cyclicdeadline.c: Remove dead code
In cyclicdeadline there is some unreachable code that was there from the
beginning. By inspection it looks like this change was the original
intention.

Signed-off-by: John Kacur <jkacur@redhat.com>
2021-02-25 20:22:45 -05:00
John Kacur e62593cd40 rt-tests: remove rt_numa_bitmask_count in rt_numa.h
Remove rt_numa_bitmask_count as it is unused.
The code uses numa_bitmask_weight() from numa instead

Signed-off-by: John Kacur <jkacur@redhat.com>
2021-02-24 11:20:21 -05:00
John Kacur 3aec580e90 rt-tests: Don't assume numa is available at runtime
- Rework numa_initialize a bit to return the status of numa
- Don't fail if numa is not available after the call to numa_initialize

Signed-off-by: John Kacur <jkacur@redhat.com>

arm32 seems to work fine.

Tested-by: Kurt Kanzenbach <kurt@linutronix.de> # arm32
2021-02-24 11:19:33 -05:00
John Kacur 6b9ac75508 Revert "signaltest: Always use libnuma"
This reverts commit 3079f1b10d.

libnuma is a build-time requirement but not a runtime requirement

Signed-off-by: John Kacur <jkacur@redhat.com>
2021-02-19 13:32:42 -05:00
John Kacur c30fa9fad6 Revert "cyclictest: Always use libnuma"
This reverts commit 512d2b7456.

libnuma is a buildtime requirement but not a runtime environment

Signed-off-by: John Kacur <jkacur@redhat.com>
2021-02-19 13:32:14 -05:00
John Kacur bdb8350f1b Revert "cyclictest: Use affinity_mask for steering thread placement"
This reverts commit 8305e65092.

Reverting to put back the code that allows us to run on machines
without libnuma.

However, there were some ideas in this patch that were not directly
related to that and could be revisited.

Signed-off-by: John Kacur <jkacur@redhat.com>
2021-02-19 13:30:45 -05:00
Peter Xu 29884cff63 oslat: Fix --cpu-list won't allow to schedule on all possible cores
parse_cpumask() is too strict for oslat, in that use_current_cpuset() will
filter out all the cores that are not allowed for current process to run.  This
seems to be unnecessary at least for oslat.  For example, the bash process that
runs the oslat program may have a sched affinity of 0-2, however it's still
legal to have it start a oslat thread running on the cores outside 0-2 as long
as the follow up sched_setaffinity() will succeed.

numa_parse_cpustring_all() suites exactly for this case, which should already
have considered sysconf(_SC_NPROCESSORS_ONLN) limit.  Use that instead.

Since at it, also remove initialization of cpu_set variable otherwise it's
leaked in previous parse_cpumask too: numa_parse_cpustring_all() will return a
newly allocated buffer already.  Quotting from manual:

    numa_parse_nodestring() parses a character string list of nodes into a bit
    mask.  The bit mask is allocated by numa_allocate_nodemask().

    numa_parse_nodestring_all() is similar to numa_parse_nodestring, but can
    parse all possible nodes, not only current nodeset.

Cc: John Kacur <jkacur@redhat.com>
Cc: Daniel Wagner <dwagner@suse.de>
Cc: Clark Williams <williams@redhat.com>
Reported-by: Pradipta Kumar Sahoo <psahoo@redhat.com>
Reported-by: Mike Stowell <mstowell@redhat.com>
Signed-off-by: Peter Xu <peterx@redhat.com>
Signed-off-by: John Kacur <jkacur@redhat.com>
2021-02-19 11:53:34 -05:00
Daniel Wagner 80299f19cb sigwaittest: 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-19 11:00:56 -05:00
Daniel Wagner bdb20cdaa8 signaltest: 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-19 10:59:52 -05:00
Daniel Wagner 7593a72e01 oslat: Add quiet command line option
The quiet option is useful for automated test setups where
only the final result of the run is interesting.

Furthermore, this makes oslat accept rt-tests standard options.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
Signed-off-by: John Kacur <jkacur@redhat.com>
2021-02-16 22:31:12 -05:00
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 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
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
Kurt Kanzenbach e3d9389b36 rt-tests: oslat: Close trace fds
oslat is also using enable_trace_mark() and never closes the fds. Add it.

Signed-off-by: Kurt Kanzenbach <kurt@linutronix.de>
Signed-off-by: John Kacur <jkacur@redhat.com>
2020-11-10 21:33:43 -05:00
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
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
Peter Xu dc433f68c9 rt-tests: cyclictest: Move ftrace helpers into rt-utils.[ch]
Then they can be further used by other programs too.

Two trivial things to mention.

Firstly, move trace_marker out of enable_trace_mark().  No functional change.

Secondly, remove the fileprefix setting in process_options(), because if
tracelimit is non-zero, fileprefix will be after all replaced by a further call
to get_debugfileprefix() in debugfs_prepare().

Signed-off-by: Peter Xu <peterx@redhat.com>
Signed-off-by: John Kacur <jkacur@redhat.com>
2020-08-18 16:28:25 -04:00
Clark Williams 3359c4464c pi_stress: limit the number of inversion groups to the number of online cores
Each inversion group is three SCHED_FIFO threads, so the chances of more groups
than online cores actually getting to run is very slim. Limit the number of
groups requested to be <= the number of online cpus.

Signed-off-by: Clark Williams <williams@redhat.com>

Changing the conversion in printf to %ld since the number of online
processors is a long.
Signed-off-by: John Kacur <jkacur@redhat.com>
2020-07-22 18:54:49 -04:00
John Kacur c7b4217ff2 rt-tests: get_cyclictest_snapshot: Warn if no cyclictest instance found
- Print a warning if no cyclictest instance is found.
- Also fix up the method take_snapshot for the case when the user
  provides a pid.

Signed-off-by: John Kacur <jkacur@redhat.com>
2020-07-06 16:27:24 -04:00
John Kacur 89f9ce0077 rt-tests: Tweak the cyclictest man page
Tweak the cyclictest man page with the .SY macro to make the cyclictest
command stand out apart from the options

Signed-off-by: John Kacur <jkacur@redhat.com>
2020-07-06 16:27:24 -04:00
John Kacur 82aa302cc1 rt-tests: Add a man page for get_cyclictest_snapshot
Add a man page for get_cyclictest_snapshot based on -h

Signed-off-by: John Kacur <jkacur@redhat.com>
2020-07-06 16:27:24 -04:00
John Kacur e554f3d5d9 rt-tests: ptsematest.8: Update the ptsematest man page
The smp option should be a capital (-S)
Also fix the update synopsis to include missing and options

Signed-off-by: John Kacur <jkacur@redhat.com>
2020-07-06 16:27:24 -04:00
John Kacur 868ee948b6 rt-tests: pi_stress.8: Remove unused -t n from the manpage
The -t option was replaced with the -D, --duration=TIME option
Remove it from the manpage as well.

Signed-off-by: John Kacur <jkacur@redhat.com>
2020-07-06 16:27:24 -04:00
John Kacur 3ee764c75d rt-tests: improvements to the python style in get_cyclictest_snapshot
Improvements to the python style in get_cyclictest_snapshot

- Add comments to the methods, functions, class and moduleb
- Put imports on individual lines
- Use "is" and "is not" with None insteald of == or !=
- Don't compare the length of lists to zero, to determine if they are
  empty

Signed-off-by: John Kacur <jkacur@redhat.com>
2020-07-06 16:26:56 -04:00
Yunfeng Ye caaec484d8 rt-tests: cyclictest: remove the debug log "pid = xxx" in rstat_shm_open()
The infomation "pid = xxx" is printed with other infomation on the same
line. so remove this left over debug message in rstat_shm_open().

Signed-off-by: yeyunfeng <yeyunfeng@huawei.com>

Edited the descriptioin in the log a little bit.
Signed-off-by: John Kacur <jkacur@redhat.com>
2020-07-02 14:38:02 -04:00
John Kacur 41a3f9e539 rt-tests: queuelat: Fix storing unsigned long long in int
queuelat can occassionally hang because of overflow mixing
unsigned long long and int

Attaching to process 173912
Reading symbols from /root/rt-tests/queuelat...done.
Reading symbols from /lib64/librt.so.1...Reading symbols from /usr/lib/debug/usr/lib64/librt-2.28.so.debug...done.
done.
Reading symbols from /lib64/libpthread.so.0...Reading symbols from /usr/lib/debug/usr/lib64/libpthread-2.28.so.debug...done.
done.
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
Reading symbols from /lib64/libc.so.6...Reading symbols from /usr/lib/debug/usr/lib64/libc-2.28.so.debug...done.
done.
Reading symbols from /lib64/ld-linux-x86-64.so.2...Reading symbols from /usr/lib/debug/usr/lib64/ld-2.28.so.debug...done.
done.
__memmove_avx_unaligned_erms ()
    at ../sysdeps/x86_64/multiarch/memmove-vec-unaligned-erms.S:254
254		rep movsb
(gdb) c
Continuing.

Program received signal SIGSEGV, Segmentation fault.
0x0000000000400c02 in account (val=18446744071562067968)
    at src/queuelat/queuelat.c:93
93		buckets[bucket_nr]++;
(gdb) bt full
    at src/queuelat/queuelat.c:93
        bucket_nr = -193273529
        a = 825932047802952
        b = 825925371232340
        dest = 0xf322b0
        src = 0xf4e3f0
        i = 45749
        delta = -2147483648
        loops = 50000
        time = 6500
        bucket_nr = 65
        n = 115000
        delta = 3500
    at src/queuelat/queuelat.c:671
        tsc_freq_mhz = 2398.5039999999999
        max_queue_len_f = 159.900284
        mvalue = 0x7ffc99d3021c "20000"
        cvalue = 0x7ffc99d30225 "300"
        pvalue = 0x7ffc99d30238 "6.1"
        fvalue = 0x7ffc99d3022c "2398.504"
        tvalue = 0x7ffc99d3023f "30"
        qvalue = 0x0
        index = 0
        c = -1

Fix the above by declaring delta as an unsigned long long

Signed-off-by: John Kacur <jkacur@redhat.com>
2020-05-12 11:08:29 -04:00
Yunfeng Ye e68eb4f37e rt-tests: hachbench: Update the usage and man page for -F|--fifo option
The commit 6c0c79b515 ("hackbench mods to work better under stress")
add -F|--fifo option, but not update the usage and man page, so this
patch fix it.

Signed-off-by: Yunfeng Ye <yeyunfeng@huawei.com>

Signed-off-by: John Kacur <jkacur@redhat.com>
- Fixed-up rejected patch hunk in man page
- Changed the wording in the man page
2020-05-05 12:34:37 -04:00
John Kacur 56aae2fd7f cyclictest: Fix setaffinity error on large NUMA machines
On large NUMA machines still getting the following error
WARN: Couldn't setaffinity in main thread: Invalid argument

Instead of calling numa_bitmask_alloc() with max_cpus, use
numa_allocate_cpumask() to fix this.

Also, make sure numa_available() is called before any other calls to the
numa library. Depending on how the options were invoked this could
happen in parse_cpumask for example. Note, this did not seem to cause
any problems in practice, but let's adhere to the library contract.

Signed-off-by: John Kacur <jkacur@redhat.com>
2020-05-04 11:54:49 -04:00
Yunfeng Ye 7b800e897f rt-tests: cyclictest: Fix -a option fail when max_cpus is more
An Error occurs when run: ./cyclictest -v -t 5 -p 80 -i 1000 -a 3

  parse_cpumask: Using 0 cpus.
  Max CPUs = 96
  WARN: Couldn't setaffinity in main thread: Invalid argument
  # /dev/cpu_dma_latency set to 0us
  FATAL: No allowable cpus to run on

We find that numa_bitmask_alloc() is used incorrectly in
use_current_cpuset(), it should pass the number of cpus as parameters,
not the sizeof(struct bitmask), which is only 8 bytes.

The syscall sched_getaffinity will check the parameters, if using
sizeof(struct bitmask), it will fail when cpus is more:

  SYSCALL_DEFINE3(sched_getaffinity, pid_t, pid, unsigned int, len,
                unsigned long __user *, user_mask_ptr)
  {
        int ret;
        cpumask_var_t mask;

        if ((len * BITS_PER_BYTE) < nr_cpu_ids)
                return -EINVAL;

Fix it by passing max_cpus as parameters to numa_bitmask_alloc().

Signed-off-by: Yunfeng Ye <yeyunfeng@huawei.com>
Signed-off-by: John Kacur <jkacur@redhat.com>
2020-04-24 16:59:02 -04:00
John Kacur f240656b05 rt-tests: cyclictest: Fix -t without a user specified [NUM]
Fix -t without a specified [NUM] to run the same number of threads as
available processors.

Currently it runs the same number of threads as cpus on a system.
However, if cyclictest is contrained to run on a smaller set of cpus
either because of a container or a user specified affinity or a
combination of the two, then the actual number of available cpus is
smaller. -t should reflect that.

Signed-off-by: John Kacur <jkacur@redhat.com>
2020-03-04 16:51:40 -05:00
John Kacur 8bc0249b47 rt-tests: cyclictest: Make the affinity mask apply to the main thread too
There is no reason that the main thread should be treated differently,
so apply the affinity setting there too.

Signed-off-by: John Kacur <jkacur@redhat.com>
2020-03-04 13:18:29 -05:00