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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
- 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
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
- 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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
`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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
- 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>
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>
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>
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>
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>
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
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>
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>
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>
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>