Commit Graph

997 Commits

Author SHA1 Message Date
John Kacur ace8da2c1f rt-tests:hwlatdetect.py: Remove unnecessary 'not'
Remove unnecessary 'not'

Signed-off-by: John Kacur <jkacur@redhat.com>
2021-10-15 01:05:30 -04:00
John Kacur ecb4cfc453 rt-tests:hwlatdetect.py: Remove multiple statements on one line
Remove multiple statements on one line

Signed-off-by: John Kacur <jkacur@redhat.com>
2021-10-15 01:01:04 -04:00
John Kacur 25209843b8 rt-tests:hwlatdetect: Remove useless object in class declaration
There is no need to specify object in python3 when creating a class

Signed-off-by: John Kacur <jkacur@redhat.com>
2021-10-15 00:54:31 -04:00
John Kacur 4235a784b5 rt-tests: cyclictest: Remove unused 'C' and 'E' options
Removing the unused short options 'C' and 'E'.

Suggested-by: Punit Agrawal <punitagrawal@gmail.com>
Signed-off-by: John Kacur <jkacur@redhat.com>
2021-10-04 10:02:24 -04:00
John Kacur 61ba1aa3a0 rt-tests: cyclictest: Add --default-system option
This patch adds the long option --default-system
--default-system runs cyclictest without attempting any tuning.
Power management is not suppressed so cyclictest measures the system as
it is configured.

This is effectively the same as --laptop, but makes it clear to the user
what is done and why.

Tested-by: Leah Leshchinsky <lleshchi@redhat.com>
Signed-off-by: John Kacur <jkacur@redhat.com>
2021-10-04 10:02:24 -04:00
John Kacur e1d4c3e771 rt-tests: Update the help and man page for --latency
- Update the help and man page for --latency
- Fix some sorting of --latency and --loops

Tested-by: Leah Leshchinsky <lleshchi@redhat.com>
Signed-off-by: John Kacur <jkacur@redhat.com>
2021-10-04 10:02:24 -04:00
John Kacur e0183e7779 rt-tests: Add *.dat to .gitignore
Add *.dat to .gitignore so that files such as trace.dat
are ignored by git

Tested-by: Leah Leshchinsky <lleshchi@redhat.com>
Signed-off-by: John Kacur <jkacur@redhat.com>
2021-10-04 10:02:13 -04:00
Punit Agrawal dcb3ac00b4 rt-tests: hwlatdetect: Gracefully handle lack of /dev/cpu_dma_latency
On systems where cpu idle is disabled to reduce latencies,
"/dev/cpu_dma_latency" does not exist and leads to the following
exception report from python when using hwlatdetect.py -

    FileNotFoundError: [Errno 2] No such file or directory: '/dev/cpu_dma_latency

Update hwlatdetect to check whether the file exists before attemping
to write values to it. Also, make the related debug output conditional
to c-states support being enabled in the kernel.

While we are touching this part of the code, also address a couple of
minor issues in the code such as -
* correct typos
* reflow comment to fit 80-char column limit

Reported-by: Suresh Hegde <suresh.c11@toshiba-tsip.com>
Signed-off-by: Punit Agrawal <punit1.agrawal@toshiba.co.jp>
2021-09-29 11:08:03 -04:00
John Kacur 83deb71176 rt-tests: pi_stress: Fix "id" in help
commit 3ef71ab4c4
made some changes to the online help and man page

The --sched policy=deadline option requires id=[high|med|low]
Unfortunately the \tid (slash t) got transformed to "tid"

Fix this by replacing with "id" as originally intended.

Signed-off-by: John Kacur <jkacur@redhat.com>
2021-09-17 14:59:11 -04:00
Nicolas Saenz Julienne 1a17551232 oslat: Avoid out-of-order memory accesses to precede counter read
In arm64 it's possible for the processor to access memory appearing in
program order after the read of the counter before the counter has been
read. This would skew the counter value to a later point than intended.

Fix this my adding an isb() following the counter read instruction.

Suggested-by: Punit Agrawal <punitagrawal@gmail.com>
Signed-off-by: Nicolas Saenz Julienne <nsaenzju@redhat.com>
Acked-by: Peter Xu <peterx@redhat.com>
Signed-off-by: John Kacur <jkacur@redhat.com>
2021-09-14 14:35:12 -04:00
Leah Leshchinsky 419aa72080 rt-tests: Add missing option F to optstring
The cyclictest help output lists -F as the short version of the
--fifo option, yet calling cyclictest -F produces an error
cyclictest: invalid option --'F'".
followed by the usage() message

This patch adds -F as a valid argument.

Signed-off-by: Leah Leshchinsky <lleshchi@redhat.com>
-Minor Fix to the commit message
Signed-off-by: John Kacur <jkacur@redhat.com>
2021-09-14 11:34:16 -04:00
Nicolas Saenz Julienne 8cb3f6d295 oslat: Allow for arch specific counter frequency measurements
Some architectures have special purpose registers to query the system
counter's frequency. Let's use that when available.

Signed-off-by: Nicolas Saenz Julienne <nsaenzju@redhat.com>
--

Changes since v1:
 - Use cleaner method to have generic and arch functions to measure
   couter's freq

 src/oslat/oslat.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

Reviewed-by: Peter Xu <peterx@redhat.com>
Signed-off-by: John Kacur <jkacur@redhat.com>
2021-09-13 14:37:05 -04:00
Nicolas Saenz Julienne 7d42e803ec oslat: Add aarch64 support
The callbacks are based on Linux's implementation:
 - CNTVCT_EL0 provides direct access to the system virtual timer[1].
 - 'yield' serves as a CPU hint with similar semantics as x86's
   'pause'[2].

In contrast with the kernel's implementation, there isn't a need for
isb() after reading CNTVCT_EL0,  this is only needed in-kernel as the
register read has to be ordered with a subsequent locking operation.

[1] See Linux's '__arch_get_hw_counter()' in arch/arm64/include/asm/vdso/gettimeofday.h
[2] See Linux's 1baa82f4803 ("arm64: Implement cpu_relax as yield").
Signed-off-by: Nicolas Saenz Julienne <nsaenzju@redhat.com>
--

Changes since v1:
 - Code cleanup
 - Add compiler barriers

 src/oslat/oslat.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)

Reviewed-by: Peter Xu <peterx@redhat.com>
Signed-off-by: John Kacur <jkacur@redhat.com>
2021-09-13 14:36:33 -04:00
Nicolas Saenz Julienne d2923a6a5e oslat: Rename cpu_mhz/cpu_hz to counter_mhz/counter_hz
'cpu_mhz' in oslat actually represents the frequency at which the high
frequency counter we measure with ticks. There is no requirement for the
counter to match the CPU frequency, nor is forced to do so on any of the
supported architectures[1][2]. So rename it to 'counter_mhz' in order to
better match reality.

[1] x86_64
Intel TRM Vol 3B, 17.17 Time Stamp Counter:
"Constant TSC behavior ensures that the duration of each clock tick is
uniform and supports the use of the TSC as a wall clock timer even if
the processor core changes frequency."

[2] ppc64
From __ppc_get_timebase() manpages: The Time Base Register is a 64-bit
register provided by Power Architecture processors. It stores a
monotonically incremented value that is updated at a system-dependent
frequency that may be different from the processor frequency. Note that
glibc's __ppc_get_timebase() and oslat's ppc64 frc() implementations are
the same.

Signed-off-by: Nicolas Saenz Julienne <nsaenzju@redhat.com>
Reviewed-by: Peter Xu <peterx@redhat.com>
Signed-off-by: John Kacur <jkacur@redhat.com>
2021-09-13 14:35:15 -04:00
John Kacur 75c16956e3 rt-tests: Change VERSION to 2.2
Change the VERSION in the Makefile to 2.2

Signed-off-by: John Kacur <jkacur@redhat.com>
2021-08-30 21:58:19 -04:00
Daniel Wagner 894e0e0949 rt-numa: Use sched_getaffinity() instead of pthread_getaffinity_np()
pthread_getaffinity_np() prevents static builds as glibc does not
expose it for this configuration. Instead use sched_getaffinity()
directly as pthread_getaffinity_np() is just a fancy glibc wrapper
around sched_getaffinity().

Static builds helps in situation where the rootfs is minimal
and does for example not ship libnuma.

The pthread_getaffinity_np call was introduced by
commit f240656b05 ("rt-tests: cyclictest: Fix -t without a user specified
[NUM]")

Signed-off-by: Daniel Wagner <dwagner@suse.de>
- Some minor fixes to the description
Signed-off-by: John Kacur <jkacur@redhat.com>
2021-08-27 13:07:48 -04:00
John Kacur 84963aae34 rt-tests: deadline_test: Exit with message if threads less than 1
If the user tries to run deadline_test with threads less than  1 (zero
for example), then exit with an error message.

Signed-off-by: John Kacur <jkacur@redhat.com>
2021-08-27 11:44:11 -04:00
John Kacur 7ee1df890e rt-tests: pi_stress: Add missing parameter and fix types
Add missing parameter in message and correct type.

Signed-off-by: John Kacur <jkacur@redhat.com>
2021-08-18 16:53:55 -04:00
John Kacur bf9af4d56b rt-tests: pip_stress: Add missing paramater in error message
Add missing string __func__ in error message

Signed-off-by: John Kacur <jkacur@redhat.com>
2021-08-18 16:43:15 -04:00
John Kacur e8f9579619 rt-tests: pi_stress: Don't call free on alloca
strdupa uses alloca to allocate the buffer
free should not be used on space allocated with alloca,
so remove these.

Signed-off-by: John Kacur <jkacur@redhat.com>
2021-08-18 15:19:56 -04:00
John Kacur ea5a1ea9d5 rt-tests: ptsematest: Remove deadcode
Remove deadcode from ptsematest.c

Signed-off-by: John Kacur <jkacur@redhat.com>
2021-08-18 14:46:01 -04:00
John Kacur 62d4d6843b rt-tests: deadline_test: Remove deadcode
Remove deadcode that was probably accidently left in during development.

Signed-off-by: John Kacur <jkacur@redhat.com>
2021-08-18 14:37:38 -04:00
John Kacur 073c386675 rt-tests: deadline_test: Move va_start forward
If open_cpuset fails then we return without calling va_end
Fixing this by moving the call to va_start after that.

Signed-off-by: John Kacur <jkacur@redhat.com>
2021-08-18 14:27:02 -04:00
John Kacur de3cdf9283 sched_deadline: Use HRTICK_DL for sched_deadline tests
If the HRTICK_DL feature is available, use it for the sched_deadline
tests, otherwise fall back to HRTICK

This code is based on changes in stalld - which in turn was based on
these sched_deadline tests

Signed-off-by: John Kacur <jkacur@redhat.com>
2021-07-23 14:59:04 -04:00
John Kacur 84c45a66bf sched_deadline: Accommodate new location of HRTICK file in kernel
Newer kernels rename /sys/kernel/debug/sched_features to
/sys/kernel/debug/sched/features

Modify sched_deadline tests to look for the new file and if that fails
look for the old file name

These functions are based on ones in stalld, and stalld itself has
functions based on the sched_deadline programs in rt-tests

Signed-off-by: John Kacur <jkacur@redhat.com>
2021-07-23 10:38:29 -04:00
Nicolas Saenz Julienne f7f3bd7d07 oslat: Don't take trace_threshold into account during preheat
The point of preheat is to make sure CPUs are out of idle and running at
max frequency by the time the real test starts. So it's expected to
incur into extra latencies we don't really mean to measure. With this in
mind, it doesn't make sense to take into account the trace threshold
during that run. So don't do it.

Note that this has been observed in practice. The threshold would be hit
during preheat but not during the real test.

Signed-off-by: Nicolas Saenz Julienne <nsaenzju@redhat.com>
Reviewed-by: Peter Xu <peterx@redhat.com>
Signed-off-by: John Kacur <jkacur@redhat.com>
2021-07-09 14:06:55 -04:00
Nicolas Saenz Julienne e4984fbe3e oslat: Remove redundant include
inttypes.h is already included above.

Signed-off-by: Nicolas Saenz Julienne <nsaenzju@redhat.com>
Reviewed-by: Peter Xu <peterx@redhat.com>
Signed-off-by: John Kacur <jkacur@redhat.com>
2021-07-09 14:04:43 -04:00
Daniel Wagner 85a60dc6be cyclicdeadline: Fix buffer allocation
gcc complains with "‘sprintf’ output between 2 and 12 bytes" but
the buffer is only 10 bytes long. Update the buffer size to hold
the complete range of [-2147483648, 2147483646].

Signed-off-by: Daniel Wagner <dwagner@suse.de>
Signed-off-by: John Kacur <jkacur@redhat.com>
2021-07-09 14:02:22 -04:00
Daniel Wagner 8870f4fdb8 signaltest: Fix printf format specifier
The fields are not uint64 just longs, update the printf format
specifiers.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
Signed-off-by: John Kacur <jkacur@redhat.com>
2021-07-09 14:00:00 -04:00
John Kacur 667e1aae89 rt-tests: Change VERSION to 2.1
Change the VERSION in the Makefile to 2.1

Signed-off-by: John Kacur <jkacur@redhat.com>
2021-06-29 23:09:41 -04:00
Daniel Wagner b36b34aa63 rt-utils: Remove empty rt_test_start()
rt_test_start() is unused, remove it.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
Signed-off-by: John Kacur <jkacur@redhat.com>
2021-06-29 23:02:06 -04:00
Daniel Wagner 2461ec8d97 rt-utils: Call get_timestmap() in rt_init()
Move the get_timestamp() from rt_test_start() to rt_init(). The idea
of rt_test_start() was to get the start timestamp right before the
'main loop' for the test starts. At least for cyclictest the
rt_test_start() was placed wrongly so that the first test cycle could
hit the pagefault when strftime() wrote into the tsbuf.

We don't have an exact semantic description what start test timestamp
means, so the simplest thing to avoid any further problems with it, is
to take the timestamp right at the beginning when the program
starts. Most test programs have a very short setup phase anyway.

Reported-by: Mike Galbraith <efault@gmx.de>
Signed-off-by: Daniel Wagner <dwagner@suse.de>
Tested-by: Kurt Kanzenbach <kurt@linutronix.de>
Signed-off-by: John Kacur <jkacur@redhat.com>
2021-06-29 23:01:42 -04:00
John Kacur 3014bb16eb rt-tests: Change VERSION to 2.0
Change the VERSION in the Makefile to 2.0

Signed-off-by: John Kacur <jkacur@redhat.com>
2021-06-25 10:26:57 -04:00
John Kacur e333004376 rt-tests: cyclictest: Add entry for mainaffinity in the manpage
Add an entry for mainaffinity in the manpage.
Tweek the output in cyclictest for mainaffinity as well.

Signed-off-by: John Kacur <jkacur@redhat.com>
Reviewed-by: Daniel Wagner <dwagner@suse.de>
2021-06-17 09:02:58 -04:00
Jonathan Schwender fe60405ed3 Subject: [PATCH v4 2/2] cyclictest: Add --mainaffinity=[CPUSET] option.
This allows the user to specify a separate cpuset for the main pid,
e.g. on a housekeeping CPU.
If --mainaffinity is not specified, but --affinity is, then the
current behaviour is preserved and the main thread is bound
to the cpuset specified by --affinity

Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
- Little fix-up applying patch
Signed-off-by: John Kacur <jkacur@redhat.com>
Reviewed-by: Daniel Wagner <dwagner@suse.de>
2021-06-17 09:02:53 -04:00
Jonathan Schwender 5290b62d3e cyclictest: Move main pid setaffinity handling into a function
Move error handling for setting the affinity of the main thread
into a separate function.
This prevents duplicating the code in the next commit,
where the main thread pid can be restricted to one of
two bitmasks depending on the passed parameters.

Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
Signed-off-by: John Kacur <jkacur@redhat.com>
Reviewed-by: Daniel Wagner <dwagner@suse.de>
2021-06-17 09:02:28 -04:00
Daniel Wagner fca9fc32b0 svematest: Add --json to man page
Add the newly introduced --json command line to the man page.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
Signed-off-by: John Kacur <jkacur@redhat.com>
2021-05-21 23:54:12 -04:00
Daniel Wagner 2f34187dfe ssdd: Add --json to man page
Add the newly introduced --json command line to the man page.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
Signed-off-by: John Kacur <jkacur@redhat.com>
2021-05-21 23:52:39 -04:00
Daniel Wagner dbeaf2da78 sigwaittest: Add --json to man page
Add the newly introduced --json command line to the man page.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
Signed-off-by: John Kacur <jkacur@redhat.com>
2021-05-21 23:49:25 -04:00
Daniel Wagner 10b82e0c17 signaltest: Add --json to man page
Add the newly introduced --json command line to the man page.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
Signed-off-by: John Kacur <jkacur@redhat.com>
2021-05-21 23:47:51 -04:00
Daniel Wagner 2d9528f148 cyclicdeadline: Add --json to man page
Add the newly introduced --json command line to the man page.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
Signed-off-by: John Kacur <jkacur@redhat.com>
2021-05-21 23:46:23 -04:00
Daniel Wagner 6b6be5f372 rt-migrate-test: Add --json to man page
Add the newly introduced --json command line to the man page.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
Signed-off-by: John Kacur <jkacur@redhat.com>
2021-05-21 23:44:54 -04:00
Daniel Wagner eb508a1282 ptsematest: Add --json to man page
Add the newly introduced --json command line to the man page.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
Signed-off-by: John Kacur <jkacur@redhat.com>
2021-05-21 23:43:47 -04:00
Daniel Wagner 78ebe67f56 pmqtest: Add --json to man page
Add the newly introduced --json command line to the man page.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
Signed-off-by: John Kacur <jkacur@redhat.com>
2021-05-21 23:42:11 -04:00
Daniel Wagner d8a15a900d pi_stress: Add --json to man page
Add the newly introduced --json command line to the man page.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
Signed-off-by: John Kacur <jkacur@redhat.com>
2021-05-21 23:40:40 -04:00
Daniel Wagner 0d2bd81cd8 oslat: Add --json to man page
Add the newly introduced --json command line to the man page.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
Signed-off-by: John Kacur <jkacur@redhat.com>
2021-05-21 23:38:53 -04:00
Daniel Wagner 1c6cd355b2 cyclictest: Add --json to man page
Add the newly introduced --json command line to the man page.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
Signed-off-by: John Kacur <jkacur@redhat.com>
2021-05-21 23:37:39 -04:00
Daniel Wagner bf10a5660e svsematest: Rename command line option --output to --json
The initial idea was to have several different output format
supported but it turns out everyone is happy with JSON, so
there is no need to add another format.

Thus let's make the command line option more specific and
rename it to --json.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
Signed-off-by: John Kacur <jkacur@redhat.com>
2021-05-21 23:35:16 -04:00
Daniel Wagner 8bdc7c423c ssdd: Rename command line option --output to --json
The initial idea was to have several different output format
supported but it turns out everyone is happy with JSON, so
there is no need to add another format.

Thus let's make the command line option more specific and
rename it to --json.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
Signed-off-by: John Kacur <jkacur@redhat.com>
2021-05-21 23:33:46 -04:00
Daniel Wagner 2f4fdcd463 sigwaittest: Rename command line option --output to --json
The initial idea was to have several different output format
supported but it turns out everyone is happy with JSON, so
there is no need to add another format.

Thus let's make the command line option more specific and
rename it to --json.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
Signed-off-by: John Kacur <jkacur@redhat.com>
2021-05-21 23:32:42 -04:00