Commit Graph

582 Commits

Author SHA1 Message Date
John Kacur 02d36d03fa rt-tests: hwlat.txt: smidetect renamed to hwlatdetect
- smidetect was long ago renamed to hwlatdetct, reflect this in hwlat.txt
- Fix a few spelling mistakes, and add a missing option

Signed-off-by: John Kacur <jkacur@redhat.com>
2016-05-13 15:24:39 +02:00
John Kacur 4594d66e78 rt-tests: Housekeeping fix some spelling errors.
Fix a number of errors like procesor->processor, specifed->specified and
cylictest->cyclictest.

Note, Uwe Kleine-König <ukleinek@debian.org> pointed out some of these
spelling errors previously.

Signed-off-by: John Kacur <jkacur@redhat.com>
2016-05-13 14:54:13 +02:00
John Kacur e09c5cf849 rt-tests: Add missing option to hwlatdetect man page
Add --watch to the man page. Correct a few spelling errors at the same
time.

Signed-off-by: John Kacur <jkacur@redhat.com>
2016-05-13 14:35:27 +02:00
Clark Williams 3be3cbefcc cyclictest: stop any tracing after hitting a breaktrace threshold
John,

This patch is against the devel/v0.98 branch. It turns off tracing in the tracemark() so that we don't lose information about what was going on when we hit the latency:

The current logic of using --tracemark and --notrace works for running
cyclictest with trace-cmd, but even if we are not doing any trace
manipulation in cyclictest, we still need to stop tracing when we hit a
breaktrace threshold (i.e. -b <n>).

Modify startup logic to hold open file descriptors for the tracemark file
*and* the tracing_on file. When we hit a threshold and call the tracemark()
function, write the marker to the trace buffers and then write a "0\n" to
the tracing_on file to turn off tracing, otherwise we lose the information
immediately prior to the point where we hit the latency.

Signed-off-by: Clark Williams <williams@redhat.com>
Reviewed-by: Luiz Capitulino <lcapitulino@redhat.com>
Signed-off-by: John Kacur <jkacur@redhat.com>
2016-05-04 15:46:32 +02:00
John Kacur b7b2fcca41 rt-tests: Update the cyclictest man page
We have done a good job keeping cyclictest help up-to-date, but we have
not been actively updating the man page.

There were many missing options, as well as options that don't exist
anymore. To be more precise, some short form options had been removed,
but there are still corresponding long-version options.

This patch contains a considerable amount of updates to the man-page to
keep it in sync, and in some cases it also updates the cyclictest help
where needed. For example, the cyclictest help options were not always
in the proper order. In some cases I changed the wording to make it more
closely correspond to the man page

Signed-off-by: John Kacur <jkacur@redhat.com>
Signed-off-by: Clark Williams <williams@redhat.com>
2016-04-25 18:45:28 +02:00
John Kacur 02d5563612 rt-tests: Add man page for rt-migrate-test
Added a man page for rt-migrate-test
Fairly minimal, based on the output from the --help option

Signed-off-by: John Kacur <jkacur@redhat.com>
2016-04-21 23:10:26 +02:00
John Kacur 81a948a2a6 rt-tests: Makefile: Assume numa_parse_cpustring_all available
NUMA users should have long ago stepped up to libs that have
numa_parse_cpustring_all(). Make this the default so that we can include
isolated cpus in the affinity string.

If there are any NUMA users or distros left that have old libraries that
don't have numa_parse_cpu_string_all(), and only numa_parse_cpu_string()
they can compile like this

make HAVE_PARSE_CPUSTRING_ALL=0

Signed-off-by: John Kacur <jkacur@redhat.com>
Reviewed-and-Tested-by: Luiz Capitulino <lcapitulino@redhat.com>
2016-04-21 22:41:45 +02:00
John Kacur 0e8a13a646 rt-tests: Makefile: Bump version number to 0.97
Bump version number to v0.97 for the next release

Signed-off-by: John Kacur <jkacur@redhat.com>
2016-03-31 18:40:54 +02:00
John Kacur ba4dd1bf54 cyclictest: Make the tracemark option imply notrace
The new --tracemark option can be used to run cyclictest under
trace-cmd.

This means we don't want cyclictest's built-in tracing to be used, so
this option is only compatible with --notrace.

Therefore turn --notrace on if --tracemark is invoked even if the user
doesn't explicitly request this.

Signed-off-by: John Kacur <jkacur@redhat.com>
2016-03-24 16:27:12 +01:00
John Kacur 967cb01bd7 Revert changes to rt-migrate-test for exit(1)
Commit 3290f8412a changed
exit(-1) to exit(1) for many programs in rt-tests for consistency.

rt-migrate-test needs tri-state exit statuses, because of the way
some existing bash scripts consume it's results.

This could no-doubt be improved in the future, and there are some
inconsistencies in the exit statuses in this program alone, but as they
are not urgent to fix, and the current fix makes things worse, reverting
this for now.

Signed-off-by: John Kacur <jkacur@redhat.com>
Reviewed-by: Luiz Capitulino <lcapitulino@redhat.com>
2016-03-24 16:26:32 +01:00
Luiz Capitulino 39889fd0b2 cyclictest: add --tracemark option
cyclictest will only write to /sys/kernel/debug/tracing/trace_maker
if it's also setup to do tracing. This conflicts with
running cyclictest under trace-cmd.

The --tracemark option tells cyclictest to write to the
trace_marker file even when it's not doing tracing.

It can be used like this:

 # trace-cmd record [...] cyclictest [...] -bX --tracemark --notrace

Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Signed-off-by: John Kacur <jkacur@redhat.com>
2016-03-24 14:57:51 +01:00
Luiz Capitulino a638701a18 cyclictest: move debugfs init code to its own function
A function added by a future commit will want to call
this code too.

Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Signed-off-by: John Kacur <jkacur@redhat.com>
2016-03-22 15:39:33 +01:00
Luiz Capitulino 42596a70b4 cyclictest: tracing(): check for notrace
If you pass -b and --notrace to cyclictest today, it will
write to tracing_on when -b latency is reached.

Fix this by making tracing() check notrace.

Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Signed-off-by: John Kacur <jkacur@redhat.com>
2016-03-22 15:37:00 +01:00
Luiz Capitulino c20e8c2c55 cyclictest: move tracemark_fd handling to its own function
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>
2016-03-22 15:33:22 +01:00
Luiz Capitulino 3290f8412a don't use exit(-1) for failures
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>
2016-03-22 15:13:03 +01:00
Daniel Bristot de Oliveira 1a1be10bbd cyclictest: Add --smi description on cyclictest man page
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>
2016-02-09 15:01:04 +01:00
Daniel Bristot de Oliveira fc7e151a5a cyclictest: SMI count/detection via MSR/SMI counter
Use the MSR/SMI counter on Intel's processor to detect/count SMIs. It is
based on turbostat's implementation.

SMI counting is enabled via --smi argument. When enabled, and additional
field is added on both regular and verbose ouput.

On the regular output, a SMI column shows how many SMIs occurred on
each CPU during cyclictest's execution. For example:

policy: fifo: loadavg: 0.09 0.05 0.02 1/194 2288

T: 0 ( 2285) P:80 I:1000 C:   9975 Min:      2 Act:    3 Avg:    4 Max:   20831 SMI:       2
T: 1 ( 2286) P:80 I:1500 C:   6650 Min:      2 Act:    2 Avg:    5 Max:   19910 SMI:       2
T: 2 ( 2287) P:80 I:2000 C:   4987 Min:      2 Act:    2 Avg:    6 Max:   20811 SMI:       2
T: 3 ( 2288) P:80 I:2500 C:   3990 Min:      2 Act:    3 Avg:    7 Max:   20322 SMI:       2

On verbose output, the last column shows how many SMIs occurred
on each loop. For example:

[  CPU  |   Loop |   Lat |  SMIs  ]
       0:    2156:       2       0
       0:    2157:       2       0
       0:    2158:       2       0
       0:    2159:   20981       2
       1:    1433:       2       0
       1:    1434:       2       0
       1:    1435:       2       0
       1:    1436:       3       0
       1:    1437:       2       0
       1:    1438:       2       0
       1:    1439:   20249       2

Signed-off-by: Daniel Bristot de Oliveira <bristot@redhat.com>
Signed-off-by: John Kacur <jkacur@redhat.com>
2016-02-09 15:00:37 +01:00
Clark Williams d1ddf82849 hwlatdetect: make reading sample date work with python2 and python3
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>
2016-01-13 15:30:03 +01:00
Clark Williams d7d6d35b15 hwlatdetect: modify to handle python3 prints
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>
2016-01-13 15:29:40 +01:00
Clark Williams bbd5a22182 hwlatdetect: handle hwlat_detector being builtin rather than module
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>
2016-01-13 15:29:17 +01:00
Khem Raj fd3dde99fd Makefile: Set CC/AR variable only if it doesn't have a value
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>
2016-01-05 23:56:25 +01:00
Clark Williams 619c068b60 Makefile: fixed dropped quote in help target text
Signed-off-by: John Kacur <jkacur@redhat.com>
2015-10-22 22:26:31 +02:00
John Kacur 07371fae48 Makefile: Remove anything to do with rpms, specs etc
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>
2015-10-22 17:30:52 +02:00
John Kacur cc85b39dd7 gitattributes: add doc, remove rt.spec-in
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>
2015-10-22 17:13:07 +02:00
John Kacur d9b2daf281 Remove rt-tests.spec-in
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>
2015-10-22 17:06:20 +02:00
John Kacur 24f8c0175e Makefile: Version bump to v0.96
Version bump to v0.96 and changelog additions to rt-tests.spec-in

Signed-off-by: John Kacur <jkacur@redhat.com>
2015-10-22 12:29:10 +02:00
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