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