Commit Graph

528 Commits

Author SHA1 Message Date
John Kacur 788bb50b8f build: Generate .o, .a, and .d files in bld dir
When building rt-tests, object files, libs and .d (dependencies) were
all generated in the base directory. Instead, place all of these
build files in a dir called bld. The final programs are still in the
basedir

Signed-off-by: John Kacur <jkacur@redhat.com>
2015-10-05 16:15:00 +02:00
John Kacur 685fb2fd01 Explicitly separate VPATH paths with a colon
VPATH paths can be separated by either a space or a colon.
Explicitly insert a colon instead of relying on a space being inserted
due to the spacing of our Makefile

Signed-off-by: John Kacur <jkacur@redhat.com>
2015-10-05 16:14:42 +02:00
John Kacur a8fd81efa7 Version bump to v0.94
Signed-off-by: John Kacur <jkacur@redhat.com>
2015-09-21 22:18:12 +02:00
Henrik Austad 88af643971 android: adjust target for android
Bionic (Android's libc implementation) lacks support for (amongst other
things) pthread_barriers and pthread_setaffinity. The former is removed
by ifdeffery, the latter is added as a per-android wrapper to
sched_setaffinity.

Signed-off-by: Henrik Austad <haustad@cisco.com>
Signed-off-by: John Kacur <jkacur@redhat.com>
2015-09-21 21:56:30 +02:00
Henrik Austad 2f83181e4b Makefile: add librttest to rt-migrate-test
linker must be able to resolve reference to err_msg_n properly

   rt-migrate-test.c:(.text+0x1ff): undefined reference to `err_msg_n'

Signed-off-by: Henrik Austad <haustad@cisco.com>
Signed-off-by: John Kacur <jkacur@redhat.com>
2015-09-21 21:55:33 +02:00
Henrik Austad 6750957ad4 Add a rebuild-switch to Makefile
Update from joshc for job-level safety

Co-authored.by: Josh Cartwright <joshc@ni.com>
Signed-off-by: Henrik Austad <haustad@cisco.com>
Signed-off-by: John Kacur <jkacur@redhat.com>
2015-09-21 21:40:27 +02:00
Henrik Austad 58dbaa3794 Add syscall-number for sched_(gs)etattr() for tile
Signed-off-by: Henrik Austad <haustad@cisco.com>
Signed-off-by: John Kacur <jkacur@redhat.com>
2015-09-21 21:40:17 +02:00
Henrik Austad 2b57b74ffa Add CROSS_COMPILE-switch to CC and AR
Signed-off-by: Henrik Austad <haustad@cisco.com>
Signed-off-by: John Kacur <jkacur@redhat.com>
2015-09-21 21:40:08 +02:00
Josh Cartwright 864fc87eed cyclictest: add option for dumping the histogram in a file
On Wed, Sep 16, 2015 at 01:05:51AM +0200, John Kacur wrote:
> On Mon, 31 Aug 2015, Josh Cartwright wrote:
> > From: Gratian Crisan <gratian.crisan@ni.com>
> >
> > Add an option '-J' or '--histfile' to dump the latency histogram to <path>
> > instead of stdout. This allows for live update of the current min, avg, and max
> > numbers while retaining the option to save histogram data for later analysis.
> >
> > Signed-off-by: Gratian Crisan <gratian.crisan@ni.com>
> > Signed-off-by: Josh Cartwright <joshc@ni.com>
[..]
>
> We worked really hard to remove the large amount of options, and we may
> have been over zealous in some cases (Carsten?).

Fair enough, cyclictest has way too many knobs.  Regardless, we've at
least found this particular option useful.

> If I were to accept this patch, I would at least like you to remove
> the short form option, and just have it in the long form.

Here is a v2 with the short form -J dropped.

Thanks,
  Josh

-- 8< --
From: Gratian Crisan <gratian.crisan@ni.com>
Subject: [PATCH v2] cyclictest: add option for dumping the histogram in a file

Add an option '--histfile' to dump the latency histogram to <path>
instead of stdout. This allows for live update of the current min, avg,
and max numbers while retaining the option to save histogram data for
later analysis.

Signed-off-by: Gratian Crisan <gratian.crisan@ni.com>
Signed-off-by: Josh Cartwright <joshc@ni.com>
Signed-off-by: John Kacur <jkacur@redhat.com>
2015-09-17 21:36:15 +02:00
Josh Cartwright b49f58efd6 error: mark fatal, err_exit, err_quit as being noreturn
These functions never return to their caller.  Mark them as such to aide
in code generation and help out static analysis.

Signed-off-by: Josh Cartwright <joshc@ni.com>
Signed-off-by: John Kacur <jkacur@redhat.com>
2015-09-17 21:19:47 +02:00
Josh Cartwright 10aeea73b4 cyclictest: fail if use_fifo && thread creation failed
Signed-off-by: Josh Cartwright <joshc@ni.com>
Signed-off-by: John Kacur <jkacur@redhat.com>
2015-09-17 21:19:47 +02:00
Josh Cartwright db7b824f83 cyclictest: drop impossible use_fifo conditional
The fifothread is only created when use_fifo is set; having the thread
itself perform a check is redundant and unnecessary.  Drop it.

Signed-off-by: Josh Cartwright <joshc@ni.com>
Signed-off-by: John Kacur <jkacur@redhat.com>
2015-09-17 21:19:47 +02:00
Josh Cartwright 8d20bc5511 cyclictest: use correct type when allocating cpu bitmask size
On any sane platform sizeof(long) == sizeof(unsigned long), so this
does not actually fix a real bug, but the code should at least be
consistent.

Signed-off-by: Josh Cartwright <joshc@ni.com>
Signed-off-by: John Kacur <jkacur@redhat.com>
2015-09-17 21:19:47 +02:00
John Kacur 1d6b1c9d25 numa_on_and_available: Remove from main in cyclictest
We don't support building without numa libs anymore, although we of
course support running on machines without numa. Never-the-less I
created two versions of numa_on_and_available, one for if you build with
the unsupported NUMA=0 and one for if you build with NUMA=1, which is
the default.

I would prefer not to drop this function, since I think it cleanly
documents the fact that numa_available must be called before any other
numa library functions are defined.

As Josh Cartwright reported though, there was no need to call it from
main() since it was already tested in process_options(), so I tested it
there.

Tested by building with NUMA=0, NUMA=1 and with the non-standard
-Wimplicit-function-declaration

Reported-by: Josh Cartwright <joshc@ni.com>
Signed-off-by: John Kacur <jkacur@redhat.com>
2015-09-17 21:19:30 +02:00
Josh Cartwright e4de2b6db9 cyclictest: consistently make all functions 'static'
Most functions in cyclictest were already 'static', with a few
exceptions.  Fixup those exceptions, in the interest of consistency,
optimization, etc.

Signed-off-by: Josh Cartwright <joshc@ni.com>
Signed-off-by: John Kacur <jkacur@redhat.com>
2015-09-02 15:02:23 +02:00
Josh Cartwright 44cd556737 hackbench: cleanup error handling in create_worker
The childinfo_t union shares the 'long long error' member with a
'pthread_t threadid'.  For a "sufficiently large" threadid, it's
possible that the error condition is incorrectly hit even though a valid
thread was created.

Stop conflating the error condition with legitimate thread/process
identifiers by modifying create_worker to explicitly return an error
code.

Inspired by a patch in OpenEmbedded authored by Song Li and Jesse Zhang.

Cc: Song.Li <Song.Li@windriver.com>
Cc: Jesse Zhang <sen.zhang@windriver.com>
Signed-off-by: Josh Cartwright <joshc@ni.com>
Signed-off-by: John Kacur <jkacur@redhat.com>
2015-09-02 15:00:24 +02:00
Josh Cartwright 3991c7bf04 rt-tests: workaround poor gzip implementations
Some 'gzip' implementations, in particular 'pigz' don't properly handle
the '-c' argument if it's passed after the name of the input files.

Work around this by putting the '-c' option before the file names.

Inspired by patches in OpenEmbedded by Robert Yang and Kai Kang.

Cc: Robert Yang <liezhi.yang@windriver.com>
Cc: Kai Kang <kai.kang@windriver.com>
Signed-off-by: Josh Cartwright <joshc@ni.com>
Signed-off-by: John Kacur <jkacur@redhat.com>
2015-09-02 14:57:04 +02:00
Darren Hart d39e249a4a rt-tests: Break out install_hwlatdetect
Allow hwlatdetect to be installed independently of the rest of the
tests. This is convenient for build systems that package it separately
due to the python dependency.

Signed-off-by: Darren Hart <dvhart@linux.intel.com>
CC: Clark Williams <williams@redhat.com>
CC: John Kacur <jkacur@redhat.com>
Signed-off-by: Josh Cartwright <joshc@ni.com>
Signed-off-by: John Kacur <jkacur@redhat.com>
2015-09-02 14:54:51 +02:00
Darren Hart d9f3e351d3 rt-tests: Allow for user-specified PYLIB
Allow users (build systems) to specify PYLIB. This allows for a
cross-build-system to specify the target PYLIB rather than the host
PYLIB.

Signed-off-by: Darren Hart <dvhart@linux.intel.com>
CC: Clark Williams <williams@redhat.com>
CC: John Kacur <jkacur@redhat.com>
Signed-off-by: Josh Cartwright <joshc@ni.com>
Signed-off-by: John Kacur <jkacur@redhat.com>
2015-09-02 14:52:46 +02:00
Clark Williams a837ba6806 rt-migrate-test: updated to latest code from rostedt
Signed-off-by: Clark Williams <williams@redhat.com>
Signed-off-by: John Kacur <jkacur@redhat.com>

Put Back #ifndef _GNU_SOURCE

We define _GNU_SOURCE in our Makefile. I don't mind having it a second
time as documentation in the files, but we need to have the #ifdef to
prevent the compiler warning about it being redfined

Signed-off-by: John Kacur <jkacur@redhat.com>
2015-09-02 14:50:40 +02:00
Clark Williams b1c507531d hwlatdetect: initial cut at tracking the amount of SMIs that occurred during a run
Signed-off-by: Clark Williams <williams@redhat.com>
Signed-off-by: John Kacur <jkacur@redhat.com>
2015-09-02 14:43:45 +02:00
John Kacur a1d3737879 Fix VERSION in rt-migrate-test
- Change VERSION_STRING to VERSION to get the same version number as the
  the rest of the suite

- Assume that VERSION is defined, instead of replacing it with a
  nonsensical number

- Print the help option in the usage() function

Reported-by: DIXLOR <dixlor@gmail.com>
Signed-off-by: John Kacur <jkacur@redhat.com>
2015-08-17 17:40:00 +01:00
Clark Williams 6855394943 Version bump to v0.93
Signed-off-by: Clark Williams <williams@redhat.com>
2015-08-12 14:09:28 -05:00
Clark Williams 090d6e7507 doc: fix VERSION in release-checklist.txt
Signed-off-by: Clark Williams <williams@redhat.com>
2015-08-12 13:54:29 -05:00
Clark Williams 9901c75cbd hwlatdetect: added --watch option to watch output in realtime
Signed-off-by: Clark Williams <williams@redhat.com>
2015-08-12 13:51:43 -05:00
Clark Williams e8e905ce4b Merge remote-tracking branch 'kernel.org/v0.93-devel' into work 2015-08-06 09:22:30 -05:00
Alexander Stein 0b3e1086f8 cyclictest: Fix long priority help text option
The help text shows prio as the long option name for the process priority.
But it is actually priority.

Signed-off-by: Alexander Stein <alexander.stein@systec-electronic.com>
Signed-off-by: Clark Williams <williams@redhat.com>
Signed-off-by: John Kacur <jkacur@redhat.com>
2015-07-24 09:07:24 -04:00
Alexander Stein 417ddb5db0 cyclictest: Fix long priority help text option
The help text shows prio as the long option name for the process priority.
But it is actually priority.

Signed-off-by: Alexander Stein <alexander.stein@systec-electronic.com>
2015-07-22 10:19:22 -05:00
John Kacur a67ec68b94 Create an rt-tests.tar file using git-archive
Create an rt-tests.tar file using git-archive so we don't mistakenly
pull in uncommitted files

Signed-off-by: John Kacur <jkacur@redhat.com>
2015-07-09 15:32:40 +02:00
John Kacur b6b5c594b2 Change VERSION_STRING to VERSION
Adding _STRING doesn't add any extra meaning, but the extra length makes
the Makefile more unreadable than is necessary, so shorten this up

Signed-off-by: John Kacur <jkacur@redhat.com>
2015-07-09 14:31:01 +02:00
John Kacur a8725114cd Add .tar files to .gitignore
Ignore .tar files too

Signed-off-by: John Kacur <jkacur@redhat.com>
2015-07-09 14:31:01 +02:00
John Kacur 38893b530c Create a .gitattribute file to specify what files git-archive should ignore
Signed-off-by: John Kacur <jkacur@redhat.com>
2015-07-09 14:16:28 +02:00
John Kacur 4010c3bce2 Fix possible exit on error without releasing mutex
Coverage tools indicate that there are two spots where the function
low_priority() could exit without releasing the mutex.

Since the only error that pthread_barrier_wait is supposed to give is
EINVAL when the barrier is not an initialized barrier object, the
chances of this happinning seem remote. However, if we are going to
test for the error and potentially exit, then we should release the
mutex too.

Signed-off-by: John Kacur <jkacur@redhat.com>
2015-06-30 23:46:34 +02:00
John Kacur a7eeb3e0a0 Fix warning: unused variable ‘c’
This is a legitimate compiler warning, so remove the unused variable.

Signed-off-by: John Kacur <jkacur@redhat.com>
2015-06-30 21:53:36 +02:00
Clark Williams 5f9f1e3fe3 makefile: fixed release target
Added MAINTAINERS, doc and README.markdown to the tar archive
generation logic.

Signed-off-by: Clark Williams <williams@redhat.com>
2015-06-09 08:57:17 -05:00
John Kacur 4f891fbf1e Version bump to v0.92
Signed-off-by: John Kacur <jkacur@redhat.com>
2015-06-09 14:34:42 +02:00
John Kacur 2a0dd6274e Add a MAINTAINERS file
Adding a MAINTAINERS file to let people know where to send their
patches.

Signed-off-by: John Kacur <jkacur@redhat.com>
2015-06-09 14:22:58 +02:00
Anna-Maria Gleixner b35bc97cfd cyclictest: Align measurement threads to the next full second
cyclictest: Align measurement threads to the next full second

cyclictest starts the test threads at a random point in time. For
fully reproducible tests it is required to schedule the threads with a
specified offset from the timer tick. The influence of the tick can be
measured by running the test with offset = 0 and offset =
tickinterval/2.

To achieve this we rely on the fact, that the kernel starts the tick
at CLOCK_MONOTONIC time 0. So it's guaranteed that the tick timer
expires always every second (if the interval between the ticks defined
by CONFIG_HZ is a whole-number divider of a second). Setting the
global start time of the test threads to a full second (plus offset)
and the interval to the interval between the ticks, the threads are
scheduled with the specified offset to the tick.

Add a new option --secaligned which select this mode and modify the
--aligned option code to support this. The --secaligned and --aligned
options are mutually exclusive.

Signed-off-by Anna-Maria Gleixner <anna-maria@glx-um.de>
Signed-off-by: John Kacur <jkacur@redhat.com>
2015-06-09 14:06:11 +02:00
Anna-Maria Gleixner 7b16a551c5 cyclictest: Convert the offset of the alignment option to microseconds
The offset is specified in microseconds according to the
documentation, but, the microseconds to nanoseconds conversion is
missing so the effective offset has the unit of nanoseconds.

Signed-off-by: Anna-Maria Gleixner <anna-maria@glx-um.de>
Signed-off-by: John Kacur <jkacur@redhat.com>
2015-06-08 19:30:54 +02:00
anna-maria@glx-um.de 5265d5ed96 cyclictest: Ensure that next wakeup time is never in the past
The calculated next wakeup time is already in the past, if the latency
is longer than the interval. Thereby latency is detected that does not
correspond to latency caused by the system but by cyclictest itself.

Force forward the next wakeup time past now.

Signed-off-by: Anna-Maria Gleixner <anna-maria@glx-um.de>
Signed-off-by: John Kacur <jkacur@redhat.com>
2015-06-02 14:50:37 +02:00
John Kacur cc0901e72d Allow building with -DHAVE_PARSE_CPUSTRING_ALL
This is a temporary solution until we have time to look into autotools
If you know that you are building on a system that has
numa_parse_cpustring_all()

Then you can type
make HAVE_PARSE_CPUSTRING_ALL=1
to define it.

If you omit that, then the default is the old behaviour that uses
numa_parse_cpustring((char *)s)

Signed-off-by: John Kacur <jkacur@redhat.com>
2015-05-27 22:51:42 +02:00
Sebastian Andrzej Siewior 3bb3cef704 cyclictest: consider the 4 as the major version
Teach cyclictest to recognize the major version 4 which we do have now.
Featurewise it should behave like the 3.0 series

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: John Kacur <jkacur@redhat.com>
2015-05-20 16:20:48 +02:00
Michael Olbrich bf74ac4067 Makefile: cleanup linking to librttest.a
Only add '-lrttest -L.' where it's actually needed.
Use '$<' instead of '$^'. Otherwise librttest is added twice:
As 'librttest.a' and as '-lrttest'.

Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
Signed-off-by: John Kacur <jkacur@redhat.com>
2015-03-03 19:54:05 +01:00
John Kacur ddc409343e Fix minor grammar mistake in the help output
Change "quick" to quicker, so the help message reads
-c    --check               Stop if lower prio task is quicker than
higher (off)

Signed-off-by: John Kacur <jkacur@redhat.com>
2015-03-03 14:45:29 +01:00
Daniel Wagner 1207d5bdc0 pi_stress: Clear affinity for DEADLINE tasks
Deadline tasks are not allowed to set smp affinity.

Signed-off-by: Daniel Wagner <daniel.wagner@bmw-carit.de>
Signed-off-by: John Kacur <jkacur@redhat.com>
2015-03-03 13:58:57 +01:00
Michael Olbrich 4f09abf780 Makefile: pi_stress need librttest.a so it should depend on it
Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
Signed-off-by: John Kacur <jkacur@redhat.com>
2015-02-24 15:28:33 +01:00
Clark Williams 3fed00ff8d version bump to 0.91
Signed-off-by: Clark Williams <williams@redhat.com>
2015-02-17 14:41:37 -06:00
Uwe Kleine-König a99c44c258 pi_stress: remove timestamp of compilation from version output
Having the date and time of compilation is hardly useful and is in the
way for reproducible building binaries.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Clark Williams <williams@redhat.com>
2015-02-17 13:12:36 -06:00
Clark Williams 9ea917520f rt-migrate-test: sanity check --prio value
Make sure we get a value between 1 and 99 for --prio. Also change
print for invalid --loops from Warning to Error (if we call exit
then it's an error).

Signed-off-by: Clark Williams <williams@redhat.com>
2015-02-17 13:02:02 -06:00
Clark Williams ad68a5d91d rt-migrate-test: make sure input parameters are converted to correct units
The input parameters for run_interval and interval are specified on the
command line as millisecond values. Convert these to nanosecond values
before we use them.

Signed-off-by: Clark Williams <williams@redhat.com>
2015-02-17 12:59:05 -06:00