A function added by the next commit will want to call
this code too.
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Signed-off-by: John Kacur <jkacur@redhat.com>
The kernel uses only 8 bits of the status as a return
code, so this actually becomes 255 in the shell.
In any case, the most widely convension is exit(1)
for failures, so let's be consistent.
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Signed-off-by: John Kacur <jkacur@redhat.com>
Add the description of the --smi comand line option of cyclictest.
"--smi Enable SMI count/detection on processors with SMI count support."
Signed-off-by: Daniel Bristot de Oliveira <bristot@redhat.com>
Signed-off-by: John Kacur <jkacur@redhat.com>
Modify the sample reading code to return correct string data and to
catch exceptions in non-blocking mode correctly on python{2,3}
Signed-off-by: Clark Williams <williams@redhat.com>
Signed-off-by: John Kacur <jkacur@redhat.com>
Use __future__ import of print_function and make sure all instances
of print are now functions rather than statements.
Signed-off-by: Clark Williams <williams@redhat.com>
Signed-off-by: John Kacur <jkacur@redhat.com>
Originally the hwlat_detector was built as only a module and was
controlled by module parameters. The latest version uses debugfs
control files so there is no real need to force it to be a module.
The hwlatdetector script in rt-tests assumes that the hwlat_detector
code was built as a module. This patch adds logic to detect and
handle if hwlat_detector is a builtin.
Signed-off-by: Clark Williams <williams@redhat.com>
Signed-off-by: John Kacur <jkacur@redhat.com>
This helps it compile with clang or any other compilers besides gcc
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: John Kacur <jkacur@redhat.com>
Remove anything to do with rpm, spec, release and so on that should be
maintained in distribution specific ways. One exception is make tarball,
which is useful in a more general way.
Signed-off-by: John Kacur <jkacur@redhat.com>
The doc dir only contains one file which is a list of things for the
maintainers to do at release time, no need to package this in the
tarball.
Since the file rt.spec-in has now been removed, we no-longer need to
mention it in the .gitattributes file
Signed-off-by: John Kacur <jkacur@redhat.com>
There is no need to maintain this file here, since it's not general
enough for general use. Every distribution will have it's own way of
doing this.
Signed-off-by: John Kacur <jkacur@redhat.com>
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>
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>
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>
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>
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>
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>
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>
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>
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>
- 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>
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>
- 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>
- 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>
- 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>
- 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>
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>
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>
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>
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>
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>
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>
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>
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>