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