Commit Graph

582 Commits

Author SHA1 Message Date
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
Boris Egorov b690dfed2d rt-migrate-test: use variables instead of macros
By default, static variables run_interval and interval assigned to
macros with corresponding uppercase name, RUN_INTERVAL and INTERVAL.
Later in code we should only use these variables to properly handle
options passed by user.

Signed-off-by: Boris Egorov <egorov@linux.com>
Signed-off-by: Clark Williams <williams@redhat.com>
2015-02-17 12:56:44 -06:00
Boris Egorov f2ceb5e1f9 rt-migrate-test: exit early if nr_runs is non-positive
Program will crash if nr_runs is 0 due to dividing by it in
print_results(). Let's exit early instead.

Fixes: http://bugs.debian.org/716237
Signed-off-by: Boris Egorov <egorov@linux.com>
Signed-off-by: Clark Williams <williams@redhat.com>
2015-02-17 12:56:18 -06:00
Clark Williams 48d20ffd06 version bump to 0.90
Signed-off-by: Clark Williams <clark.williams@gmail.com>
2015-01-27 10:26:12 -06:00
Alexey Brodkin c68419b628 Makefile: allow building selected tests with non-NPTL toolchain
Some architectures are still stuck with non-NPTL toolchains.
These are for example ARC, Blackfin, Xtensa etc.

Still rt-tests are very good benchmarks and it would be good to enable use of
at least selected (those that will be built) tests on those architectures.

This change makes it possible to only build subset of tests that don't require
NPTL calls.

By default behavior is not modified - all tests are built, but if one wants
to build with non-NPTL toolchain just add "HAVE_NPTL=no" in command line
or modify "HAVE_NPTL" variable right in Makefile and execute "make".

Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
Cc: Vineet Gupta <vgupta@synopsys.com>
Cc: Clark Williams <clark.williams@gmail.com>
2015-01-15 16:31:20 -06:00
Clark Williams deb1e1eecc specfile: update template and make build exclusive to x86_64
Signed-off-by: Clark Williams <clark.williams@gmail.com>
2015-01-15 16:31:20 -06:00
Clark Williams 53956b6712 pip_stress: parameterize usleep value to work-around platform issues
ARM platforms have timing issues with pip_stress:

    Hello,

    pip_stress works out of the box on my x86 based laptop, but
    doesn't work on ARM devices, returned 'no inversion incurred'.
    Follow the comment to increase usleep value, 2500 worked for
    pandaboard and 3000 worked for Beaglebone Black board.

    I propose that increase the usleep value to 3500 from upstream,
    so that we can use pip_stress right out of the box.

Rather than hardcode the usleep value used by pip_stress, I made
the command line option --usleep which takes a microsecond value
that defaults to 500us.

Reported-by: Chase Qi <chase.qi@linaro.org>
Signed-off-by: Clark Williams <clark.williams@gmail.com>
2015-01-15 16:30:59 -06:00
Daniel Wagner d1f037dc3c pi_stress: Store schedule attributes per thread
Currently, the scheduling class is configured on a global
level. It is possible to run the test either with SCHED_FIFO
or SCHED_RR. All threads run then with the same configuration
except sched_priority is different.

By storing the scheduling attributes per thread we will be able
to use different scheduler classes at the same time. The aim is
to use SCHED_DEADLINE for the high priority thread.

First thing to get there is to introduce low_sa, med_sa, high_sa
and admin_sa. They are configured using the global policy variable
on default. Either using SCHED_FIFO or SCHED_RR. The user
can though use --sched command line options to configure each
thread seperately. E.g.

Starting PI Stress Test
Number of thread groups: 1
Duration of test run: infinite
Number of inversions per group: unlimited
     Admin thread SCHED_FIFO priority 4
1 groups of 3 threads will be created
      High thread SCHED_DEADLINE runtime 100000 deadline 200000 period 200000
       Med thread SCHED_FIFO priority 2
       Low thread SCHED_FIFO priority 1
Current Inversions: 2446249
Stopping test
Terminated

Signed-off-by: Daniel Wagner <daniel.wagner@bmw-carit.de>
2014-11-06 15:43:48 -06:00
Daniel Wagner 7efada9d5b rt-utils: Add gettid()
We still lack a gettid implemenation from libc.

Signed-off-by: Daniel Wagner <daniel.wagner@bmw-carit.de>
2014-11-06 15:43:45 -06:00
Daniel Wagner e875ad63d3 rt-utils: Add helper to parse/print scheduling policies
Signed-off-by: Daniel Wagner <daniel.wagner@bmw-carit.de>
2014-11-06 15:43:43 -06:00
Daniel Wagner ef2dee4232 rt-sched: Add sched_setattr/sched_getattr API
Until we have a proper libc implementation we maintain a simple
version of it. We this new API we are able to use SCHED_DEADLINE.

This is shamelessly stolen from Dario Faggioli's libdl.

Signed-off-by: Daniel Wagner <daniel.wagner@bmw-carit.de>
Cc: Dario Faggioli <raistlin@linux.it>
2014-11-06 15:43:41 -06:00
Daniel Wagner 4450464a96 pi_stress: Use error.h for logging and debugging
In order to be able to use some of the rt-utils.h function we need
to get rid of our own info() & friends implementation.

Signed-off-by: Daniel Wagner <daniel.wagner@bmw-carit.de>
2014-11-06 15:43:38 -06:00
Daniel Wagner bf246ba473 error: Add debug() function
Signed-off-by: Daniel Wagner <daniel.wagner@bmw-carit.de>
2014-11-06 15:43:35 -06:00
Daniel Wagner 62a796727a pi_stress: Remove unused TIMER_SIGNAL definition
Signed-off-by: Daniel Wagner <daniel.wagner@bmw-carit.de>
2014-11-06 15:43:32 -06:00
Daniel Wagner 37c4b02108 rt-tests.h: Remove unused header file
There is no user of this header file.

Signed-off-by: Daniel Wagner <daniel.wagner@bmw-carit.de>
2014-11-06 15:43:29 -06:00
Daniel Wagner b45ce03638 hackbench: Don't re-assign context for each fd
A small optimization. Setting it once is enough.

Signed-off-by: Daniel Wagner <daniel.wagner@bmw-carit.de>
2014-11-06 15:43:00 -06:00
Clark Williams 536baa7648 Merge remote-tracking branch 'jkacur/v0.89-devel' into work 2014-11-06 15:41:21 -06:00
Joakim Hernberg b23d5ced10 cyclictest: make affinity option only use number of online cpus
When I boot my 8 core i7 laptop with the maxcpus=4 kernel boot flag,
cyclictest -S runs 8 threads.  This patch makes it only use the number
of online cpus instead.

Signed-off-by: Joakim Hernberg <jhernberg@alchemy.lu>
Signed-off-by: John Kacur <jkacur@redhat.com>
2014-08-18 22:49:17 +02:00
John Kacur 5078ecff39 cyclictest: Add long option --laptop to preserve battery power
Some people running cyclictest on laptops don't want to automatically
take advantage of the trick that prevents the power management to
transition to high cstates, since it eats up their battery power.

Allow them to suppress this feature with --laptop

This will result in power latency results of course.

Feature-requested-by:  Joakim Hernberg <jhernberg@alchemy.lu>
Signed-off-by: John Kacur <jkacur@redhat.com>
2014-08-18 22:48:35 +02:00
Clark Williams b028c17565 Merge remote-tracking branch 'jkacur/v0.89-devel' into work 2014-08-15 10:38:26 -05:00
Joakim Hernberg 863f148222 cyclictest: make affinity option only use number of online cpus
When I boot my 8 core i7 laptop with the maxcpus=4 kernel boot flag,
cyclictest -S runs 8 threads.  This patch makes it only use the number
of online cpus instead.

Signed-off-by: Joakim Hernberg <jhernberg@alchemy.lu>
Signed-off-by: John Kacur <jkacur@redhat.com>
2014-08-15 14:52:28 +02:00
John Kacur dd01e7dab9 cyclictest: Add long option --laptop to preserve battery power
Some people running cyclictest on laptops don't want to automatically
take advantage of the trick that prevents the power management to
transistion to high cstates, since it eats up their battery power.

Allow them to suppress this feature with --laptop

This will result in power latency results of course.

Feature-requested-by:  Joakim Hernberg <jhernberg@alchemy.lu>
Signed-off-by: John Kacur <jkacur@redhat.com>
2014-08-14 17:24:31 +02:00
John Kacur 72ce09a0fa cyclictest: Fix help for long options only
At some point in the history of cyclictest, a number of short options
were removed and changed to long only options. However the display_help
was not updated to reflect this and indicates short options that
no longer exist. Fix this. I also found a long option that wasn't listed
at all and added that.

Signed-off-by: John Kacur <jkacur@redhat.com>
2014-08-14 17:01:05 +02:00
John Kacur f0b2df877c cyclictest: Change the output from function sighand() to stderr
cyclictest can be run from other tools such as rteval
in order to get current status on long runs, SIGUSR1 is sent to
cyclictest and caught by function sighand()

This creates difficulties for rteval when parsing cyclictest output, so
change the output to stderr.

Note, a RFC was sent out on Apr.15 2014 entitled
"RFC: SIGUSR1 to stderr"
to:	 RT <linux-rt-users@vger.kernel.org>
cc:	 Carsten Emde <C.Emde@osadl.org>,
	 Thomas Gleixner <tglx@linutronix.de>,
	  Clark Williams <williams@redhat.com>

Since I didn't receive any replies, I'm assumin there are no objections

Signed-off-by: John Kacur <jkacur@redhat.com>
2014-08-14 16:22:11 +02:00
John Kacur 4b430a7678 cyclictest: Always print an err message if write of 0 to cpu-dma_latency fails
In set_latency_target() there are some paths that don't print an error
message even when a write of 0 to /dev/cpu_dma_latency fails.

This patch does the following
- always print an error message if the write to /dev/cpu_dma_latency
fails
- Fix the error check with the write call. (a return of 0 or -1 indicate
 problems
- rename ret to err since this function is void and returns no value
- use err_msg_n instead of printf (which also prints to stderr)

Signed-off-by: John Kacur <jkacur@redhat.com>
2014-08-14 16:03:07 +02:00
Joakim Hernberg 629b13d338 make SMP option only use online cpus. 2014-07-23 16:16:16 -05:00
John Kacur 245b19c5f6 rt_numa.h: Suppress discards 'const' qualifier warning
In rt-tests we try to use const where appropriate for read-only, but
we need to tell the compiler we are intentionally discarding const
when calling library functions that expect char *

Signed-off-by: John Kacur <jkacur@redhat.com>
2014-05-09 14:12:26 +02:00
John Kacur 6b6ebd9f0d lib: Rework err_msg_n to output strerror after message
Outputting the message first followed by the strerror makes
the error messages more readable.

Signed-off-by: John Kacur <jkacur@redhat.com>
2014-05-09 01:21:06 +02:00
Clark Williams c5f2a44360 Merge branch 'work' 2014-03-30 11:17:52 -05:00
Clark Williams 9164ec4db2 version bump to 0.89
Signed-off-by: Clark Williams <clark.williams@gmail.com>
2014-03-30 11:16:44 -05:00
Clark Williams 041e643710 cyclictest: fix leftover debbuging comment in argument processing
Left a single line comment in the switch statement for handling
affinity options. Removed it.

Signed-off-by: Clark Williams <clark.williams@gmail.com>
2014-03-30 11:05:49 -05:00
Clark Williams 266a7b90a5 hwlatdetect: convert to run with both python2 and python3
Ran 2to3 on hwlatdetect.py and checked in the result. Tested
on F20 system running 3.12.14-rt23 with both python2 and python3.

Signed-off-by: Clark Williams <clark.williams@gmail.com>
2014-03-29 10:39:26 -05:00
Clark Williams 9a345c1375 removed debugging comments and printfs
Signed-off-by: Clark Williams <clark.williams@gmail.com>
2014-03-28 13:07:55 -05:00
Clark Williams bd4493d6ef Merge branch 'work' 2014-03-28 09:27:18 -05:00
Clark Williams a7fbe4c58b version bump to 0.88
Signed-off-by: Clark Williams <clark.williams@gmail.com>
2014-03-28 09:26:31 -05:00
Gary S. Robertson 9bdd51a808 cyclictest: Don't offer --numa option when unavailable
Signed-off-by: Gary S. Robertson <gary.robertson@linaro.org>
Signed-off-by: Clark Williams <williams@redhat.com>
2014-03-28 09:23:59 -05:00
Gary S. Robertson 618427fab9 cyclictest: Restore CPU affinity function for non-NUMA builds
Signed-off-by: Gary S. Robertson <gary.robertson@linaro.org>
Signed-off-by: Clark Williams <williams@redhat.com>
2014-03-28 09:22:53 -05:00
Gary S. Robertson 751b683a9d Don't offer --numa option when unavailable
Signed-off-by: Gary S. Robertson <gary.robertson@linaro.org>
Signed-off-by: Clark Williams <williams@redhat.com>
2014-03-26 22:37:50 -05:00
Gary S. Robertson 04db73f6c7 Restore CPU affinity function for non-NUMA builds
Signed-off-by: Gary S. Robertson <gary.robertson@linaro.org>
Signed-off-by: Clark Williams <williams@redhat.com>
2014-03-26 22:37:27 -05:00
Uwe Kleine-König 87f1158245 cyclictest: Fix tracemark output when the latency threshold is hit on ARM
on ARM I'm seeing output like:

	cyclicte-623     0....... 19619418us+: tracing_mark_write: hit latency threshold (2000 > 2097)

That's because of a format mismatch in

	tracemark("hit latency threshold (%d > %d)", diff, tracelimit);

diff is a u64 and tracelimit an int. So on ARM the string is passed in r0,
tracelimit in r1 and diff in r2+r3. vsnprintf used in tracemark only
expects two ints passed and so only uses r1 and r2 yielding the permutation
in the output.

This patch also adds a gcc attribute to tracemark that helps catching
similar bugs. In this case just adding the attribute but not touching
the call site, would result in:

	src/cyclictest/cyclictest.c: In function ‘timerthread’:
	src/cyclictest/cyclictest.c:899:4: warning: format ‘%d’ expects argument of type ‘int’, but argument 2 has type ‘uint64_t’ [-Wformat]

---
Hello

after some chatting with Clark and John I dropped the c99 stuff and added the
attribute annotation.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Clark Williams <clark.williams@gmail.com>
2014-01-31 14:11:46 -06:00
Ciprian Barbu 3917fdbe56 rt-tests: hackbench: fix for uninitialized start time
Hello,

While playing around with hackbench I discovered that I would sometimes
get an enormous time reported, even if the run time would be less than a
second or so. The problem was that the struct timeval start was not
initialized until after all children have been created. But if the
program receives a signal before this is done, the start time is left
uninitialized.

I propose that in such situations an error message be displayed, like
the following patch does.

Please let me know if this is acceptable.

Regards,
/Ciprian

Signed-off-by: Clark Williams <williams@redhat.com>
2013-12-12 09:13:12 -06:00
Clark Williams b0413ae5ed version bump to 0.87
Signed-off-by: Clark Williams <clark.williams@gmail.com>
2013-12-11 16:43:14 -06:00
Clark Williams 7c21340615 fixed #ifdef that cuts -A option in display_help()
Signed-off-by: Clark Williams <clark.williams@gmail.com>
2013-12-11 15:30:29 -06:00
Aaron Fabbri 2f060c9ac6 CPU affinity now takes arbitrary set of cpus.
e.g.
  cyclictest -a4,6-8 -t5

will use 5 threads, assigned round-robin to the set of CPUs {4,6,7,8}.
CPU 4 will get threads 1 and 5, CPU 6 gets thread 2, CPU 7 gets thread 3, and
CPU 8 gets thread 4.

As explained in the updated manpage, libnuma >= v2 is required for these
arbitrary CPU sets.  With libnuma v1, the -a option behaves as before.  As
before, compiling without libnuma is supported. The command usage help is fixed
up at compile time to always show the correct usage of the -a option.

Also note that, since numa_parse_cpustring_all() wasn't available in early
libnuma v2 versions, we use numa_parse_cpustring().  This means you'll have to
use taskset in some cases (isolcpus kernel parameter) to add the desired CPUs to
the set of allowed cores, e.g.:

  taskset -c4-6 cyclictest -a4-6

Tested with out libnuma (numactl), and with versions 1.0.2 and 2.0.9-rc3.

Signed-off-by: Aaron Fabbri <ajfabbri@gmail.com>
(cherry picked from commit 5375ab86e77881d8043e5e309bb8daf5a84cc05f)
Signed-off-by: Clark Williams <clark.williams@gmail.com>
2013-12-11 15:26:57 -06:00
Clark Williams 7ff65cfa9d updated Makefile and do-git-push script to use kup
Signed-off-by: Clark Williams <clark.williams@gmail.com>
2013-11-15 15:39:21 -06:00
Clark Williams 4ab63398b9 version bump to 0.86
Signed-off-by: Clark Williams <clark.williams@gmail.com>
2013-11-15 09:50:49 -06:00
John Kacur 1b46049fb5 cyclictest: Align option fixes
These changes make the align option truly optional as claimed.

1. Rename disaligned to offset for readability.
2. Fix the aligned option so that if no optional argument is given,
the offset defaults to 0
3. Fix some white space problems as reported by checkpatch.pl in the kernel
Signed-off-by: John Kacur <jkacur@redhat.com>
2013-11-14 17:40:03 +01:00