Commit Graph

556 Commits

Author SHA1 Message Date
John Kacur 708e43c923 Merge branch 'devel/v0.96-spikes' into devel/v0.96
There was an easily fixed merge conflict in the option_values, using the
conflict as an opportunity to clean this up

Signed-off-by: John Kacur <jkacur@redhat.com>
2015-10-22 11:54:17 +02:00
Henrik Austad 70744ebc71 rt-sched.h: do not unconditionally define syscall-numbers
These could be defined elsewhere, be careful when defining these

Cc: John Kacur <jkacur@redhat.com>
Signed-off-by: Henrik Austad <haustad@cisco.com>
Signed-off-by: John Kacur <jkacur@redhat.com>
2015-10-22 11:42:18 +02:00
Henrik Austad b0a075980b Android: Expand match for android in ostype
Some buildsystems use androidabe, so an exact match will break in those
circumstances.

Cc: John Kacur <jkacur@redhat.com>
Signed-off-by: Henrik Austad <haustad@cisco.com>
Signed-off-by: John Kacur <jkacur@redhat.com>
2015-10-22 10:38:55 +02:00
Henrik Austad ebe16ac451 Android: rename arch from bionic to android
Bionic is the libc implementation used in Android and should not be
confused with the architecture.

Cc: John Kacur <jkacur@redhat.com>
Signed-off-by: Henrik Austad <haustad@cisco.com>
Signed-off-by: John Kacur <jkacur@redhat.com>
2015-10-22 10:32:41 +02:00
Henrik Austad 841afb64df Android: clean up the bypass ifdeffery
88af643971 (android: adjust target for android) introduced some really
ugly ifdefs to avoid calling into pthread_barrier_wait and
pthread_barrier_init.

This patch attempts to coalesce this into a single place and let the
compiler handle the linking so that cyclictest.c is untouched by evil
ifdefs.

It also combines NO_PTHREAD_BARRIER and NO_PTHREAD_SETAFFINITY into a
PTHREAD_BIONIC as it does not make much sense to keep them separated.

Compiled and tested on:
- x86_64 (v3.13 kernel)
- tilegx (v3.10 kernel)
- arm64 android (v3.10 kernel)

Note: this includes bionic.h unconditionally, so it makes most sense to
keep bionic.h in src/include/ (and not in src/arch/bionic/).

Cc: John Kacur <jkacur@redhat.com>
Signed-off-by: Henrik Austad <haustad@cisco.com>
Signed-off-by: John Kacur <jkacur@redhat.com>
2015-10-22 10:16:08 +02:00
John Kacur 73bc7345ee cyclictest: fix #ifdef broken by NO_PTHREAD_SETAFFINITY
Unfortunately c869f3cdcd wasn't sufficient
to fix #ifdef #else functionality for uclib, broken by the changes for
bionic.

In practice this probably didn't break anyone though, except possibly
for the new bionic code which probaly doesn't have too many adapters
(yet).

This should also help Henrik move the NO_PTHREAD_SETAFFINITY functionality to
the bionic file.

Signed-off-by: John Kacur <jkacur@redhat.com>
2015-10-21 18:30:14 +02:00
John Kacur 88858b71f2 cyclictest: Add a feature to record spikes
Create a linked-list of data, including a time stamp, that is
recorded everytime a latency measurement is above a given number (trigger).
This data is printed out at the end of a run. If we have
more spikes than we have allocated nodes in our list for, we stop
recording the data, but keep counting the number of spikes.

This introduces two new long options.

--spike=trigger, where the trigger is given in usec. Any time a
spike > trigger occurs we record the data.

--spike-nodes=num_of_nodes, is the amount of data we can record, the
default is 1024

Here is what a sample run looks like. (non-rt kernel)

su -c './cyclictest -t4 -p99 --spike=30 --duration=60'
Password:
policy: fifo: loadavg: 0.69 0.78 0.60 1/641 6420

T: 0 ( 6385) P:99 I:1000 C:  59996 Min:      2 Act:    2 Avg:    2 Max:
1476
T: 1 ( 6386) P:99 I:1500 C:  39999 Min:      1 Act:    2 Avg:    2 Max:
952
T: 2 ( 6387) P:99 I:2000 C:  29999 Min:      2 Act:    2 Avg:    3 Max:
504
T: 3 ( 6388) P:99 I:2500 C:  23999 Min:      1 Act:    2 Avg:    2 Max:
1423

T: 2 Spike:     504: TS:    490531620
T: 2 Spike:     270: TS:    526847386
T: 2 Spike:      51: TS:    527211167
T: 2 Spike:      44: TS:    528261160
T: 1 Spike:      31: TS:    528952631
T: 2 Spike:      32: TS:    529253148
T: 2 Spike:      52: TS:    529317169
T: 0 Spike:    1444: TS:    530049519
T: 1 Spike:     419: TS:    530049520
T: 0 Spike:    1476: TS:    530318551
T: 1 Spike:     952: TS:    530318553
T: 3 Spike:    1423: TS:    530318551
T: 0 Spike:     972: TS:    531532046
T: 0 Spike:      34: TS:    531987109
spikes = 14

Signed-off-by: John Kacur <jkacur@redhat.com>
2015-10-21 15:12:45 +02:00
John Kacur afc0f753c3 Makefile: Move TARGETS back to a more logical place in the Makefile
Place TARGETS after sources. The evaluation of it doesn't depend on it's
position in the file, so remove the incorrect comment

Signed-off-by: John Kacur <jkacur@redhat.com>
2015-10-14 14:49:22 +02:00
Clark Williams 32933aadb3 Makefile: have distclean remove .asc file for tarball
Signed-off-by: Clark Williams <williams@redhat.com>
Signed-off-by: John Kacur <jkacur@redhat.com>
2015-10-14 14:45:35 +02:00
Clark Williams 19cba59261 specfile: add signaltest manpage to files section and remove trailing whitespace in changelog
Signed-off-by: Clark Williams <williams@redhat.com>
Signed-off-by: John Kacur <jkacur@redhat.com>
2015-10-14 14:45:02 +02:00
John Kacur 01c2ad58d3 Makefile: OBJDIR should be an order-only-prerequisite
OBJDIR should be an order only prerequisite.
- create the OBJDIR if necessary before .d, .o and before all TARGETS
  including hwlatdetect
- Don't rebuild if the timestamp on the OBJDIR changes

Signed-off-by: John Kacur <jkacur@redhat.com>
2015-10-14 14:39:33 +02:00
Clark Williams d68bda3d43 Makefile: add target to create OBJDIR before use
Signed-off-by: Clark Williams <williams@redhat.com>
Signed-off-by: John Kacur <jkacur@redhat.com>
2015-10-09 13:32:55 +02:00
Uwe Kleine-König cfb3499617 Fix some trivial typos found by codespell(1)
Inheritence ==> Inheritance
occured ==> occurred
surpress ==> suppress

Signed-off-by: John Kacur <jkacur@redhat.com>
2015-10-09 09:27:31 +02:00
John Kacur a43126d192 cyclictest: Clean-ups in timerthread before working on it
- Clean this function up a bit before modifying it
	- Don't use assignment in if statements
	- Put spaces before open braces and parentheses
	- Break lines up where possible that go over 80 chars

Signed-off-by: John Kacur <jkacur@redhat.com>
2015-10-08 16:49:03 +02:00
John Kacur b921fb3d1f maintainence: VERSION bump and Change-log update
- Update the VERSION in the Makefile
- Update the Change-log in rt-tests.spec-in

Signed-off-by: John Kacur <jkacur@redhat.com>
2015-10-07 14:33:05 +02:00
Henrik Austad c869f3cdcd cyclictest: move redefine of CPUSET back to uclib
This was mistakenly included in the #ifdef in 88af643971 (android:
adjust target for android). Moved back into the correct #ifdef-entry.

Cc: Clark Williams <williams@redhat.com>
Cc: John Kacur <jkacur@redhat.com>
Signed-off-by: Henrik Austad <haustad@cisco.com>
Signed-off-by: John Kacur <jkacur@redhat.com>
2015-10-07 12:26:55 +02:00
John Kacur d3bd5df707 Bionic: Move android functionality into it's own arch Makefile
- Make the Makefile more readable by moving android functionality to it's
own Makefile.
- Don't evaluate TARGETS until after including arch Makefiles

Signed-off-by: John Kacur <jkacur@redhat.com>
Tested-by: Henrik Austad <haustad@cisco.com>
2015-10-06 11:27:10 +02:00
John Kacur 8d26afdc2d Makefile: Only call cc -dumpmachine once in the makefile
- Store the result of cc -dumpmachine in the dumpmachine variable
- Use makefile parsing to obtain the ostype
- Use shell and sed functions to obtain the machinetype
- Turn on the bionic functionality if the ostype=android

Signed-off-by: John Kacur <jkacur@redhat.com>
Tested-by: Henrik Austad <haustad@cisco.com>
2015-10-06 11:27:10 +02:00
Uwe Kleine-König 6f3c1ba9e8 drop compiling without NPTL support
all programs apart from sendme use pthreads so NPTL=no is hardly useful
any more.

Signed-off-by: John Kacur <jkacur@redhat.com>
2015-10-06 11:27:09 +02:00
Uwe Kleine-König d8795af232 rt-migrate-test: remove space before \n
This fixes a checkpatch warning

	WARNING: unnecessary whitespace before a quoted newline

Signed-off-by: John Kacur <jkacur@redhat.com>
2015-10-06 11:27:09 +02:00
John Kacur 7faa666c37 Makefile: Document certain compiling options
- Document compiling with and without NUMA, explaining the defaults
- Document compiling with HAVE_PARSE_CPUSTRING_ALL

Reorganize these options a little for readability

Signed-off-by: John Kacur <jkacur@redhat.com>
2015-10-06 11:27:03 +02:00
Uwe Kleine-König 675f551202 remove several unused Makefiles
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: John Kacur <jkacur@redhat.com>
2015-10-05 20:21:15 +02:00
Uwe Kleine-König 300c476e0a backfire: remove unused header file
Signed-off-by: Uwe Kleine-König <uwe@kleine-koenig.org>
Signed-off-by: John Kacur <jkacur@redhat.com>
2015-10-05 20:21:15 +02:00
John Kacur b482ecc2bf signaltest: Add a man page to signaltest
- Add a man page to signaltest
- Improve the display_help in signaltest
- Add install of new man page to makefile

Signed-off-by: John Kacur <jkacur@redhat.com>
2015-10-05 20:21:15 +02:00
John Kacur 3374f941a6 rt-utils: Fix some checkpatch errors in rt-utils.c
Although we have less strict rules than the linux kernel
some of the checkpatch complaints really do make the files better and
easier to read. Fix a few of these.

Signed-off-by: John Kacur <jkacur@redhat.com>
2015-10-05 20:21:15 +02:00
John Kacur fe947f17cd rt-utils: Add John Kacur to the copyright
Not sure why I wasn't added to the copyright of this file
the first time around, but add it now

Signed-off-by: John Kacur <jkacur@redhat.com>
2015-10-05 20:21:15 +02:00
John Kacur 40502982cc signaltest: Check the status of pthread_create
Check the status of pthread_create to help debug signaltest

Signed-off-by: John Kacur <jkacur@redhat.com>
2015-10-05 20:21:15 +02:00
John Kacur aa958b4d6e signaltest: call process_options before calling check_privs
Call process_options beforeing checking priviledges so that
process_options can display help for a normal user as designed.

This was already fixed in cyclictest. I also tested everywhere else to
make sure this is now fixed everywhere.

I fixed some small white spaces problems at the same time.

Signed-off-by: John Kacur <jkacur@redhat.com>
2015-10-05 20:21:15 +02:00
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