Commit Graph

233 Commits

Author SHA1 Message Date
John Kacur 20b8b253f3 rt-tests: pip - Use check_privs() from the rt-utils library.
Use check_privs() from the rt-utils library to make sure that the user is
running with real-time privileges for the pip test program.

Signed-off-by: John Kacur <jkacur@redhat.com>
2009-12-23 16:41:12 +01:00
John Kacur 3dec3c9e04 rt-tests: Move header files from src/lib to src/include
Move header files from src/lib to src/include and adjust the Makefile to
reflect this change.

Signed-off-by: John Kacur <jkacur@redhat.com>
2009-12-23 16:26:49 +01:00
John Kacur 3b0dcdaefc rt-tests: Add a new test pip - priority inheritance with processes
This test is similar to pi_stress in that it purpursely triggers a priority-
inversion. However, instead of using pthreads it uses processes.
Since pthread_mutex_t are the only objects backed by priority inheritance
this is accomplished by having the processes use a pthread_mutex_t in
shared memory. See the header of pip.c for more information as well as the
code of course.

In addition this patch starts a src/include directory as a common place
to put header files.

Signed-off-by: John Kacur <jkacur@redhat.com>
2009-12-23 16:01:17 +01:00
John Kacur aee58a288f rt-tests: Add error routines to the library
Add error routines, similar to those found in Advanced Programming in the
UNIX Environment 2nd ed. for use by all rt test programs

Signed-off-by: John Kacur <jkacur@redhat.com>
2009-12-23 14:43:54 +01:00
Clark Williams 3115847ca0 version bump to 0.59
Signed-off-by: Clark Williams <williams@redhat.com>
2009-12-22 16:27:15 -06:00
Clark Williams 8ab7958d06 deleted classic_pi program
classic_pi was the original proof of concept for a Priority
Inheritance mutex demonstration, but pi_stress does that much
better now.

Signed-off-by: Clark Williams <williams@redhat.com>
2009-12-22 16:22:11 -06:00
John Kacur d3f77dcefc rt-tests: Add help screen info about -M / refresh_on_max in cyclictest
Signed-off-by: David Sommerseth <davids@redhat.com>
Signed-off-by: John Kacur <jkacur@redhat.com>
2009-12-22 22:54:00 +01:00
David Sommerseth 61b1309285 Missing parsing of --mlockall in signaltest
Signed-off-by: David Sommerseth <davids@redhat.com>
2009-12-22 21:54:37 +01:00
David Sommerseth 2e2c1eb6ae Fixed missing parsing of short arguments in classic_pi (David)
- Added the '+' back to the arguments (John)

Signed-off-by: David Sommerseth <davids@redhat.com>
Signed-off-by: John Kacur <jkacur@redhat.com>
2009-12-22 21:42:28 +01:00
Carsten Emde 77c00420d0 rt-tests: Better explanation in the kernel module
Signed-off-by: Carsten Emde <C.Emde@osadl.org>
Signed-off-by: John Kacur <jkacur@redhat.com>
2009-12-22 00:58:59 +01:00
John Kacur b1ff404d55 rt-tests: Clean-up, Fix the comment part of the #endif protecting include files
Clean-up, Fix the comment part of the #endif protecting include files

Signed-off-by: John Kacur <jkacur@redhat.com>
2009-12-22 00:43:04 +01:00
Clark Williams c663bf76dd version bump to 0.58 2009-12-21 16:11:09 -06:00
Clark Williams e3c3bab1c6 fixed missing function invocation in cyclictest
Added missing () to get_debugfileprefix in cyclictest.

Signed-off-by: Clark Williams <williams@redhat.com>
2009-12-21 16:04:41 -06:00
Clark Williams 1c6c589606 move guard macros into implementor namespace
renamed the guard macros in rt-get_cpu.h and rt-utils.h to
have leading double underscores which takes them out of the
application namespace. Also changed a '.' in the rt-get_cpu.h
guard macro to an underscore.

Signed-off-by: Clark Williams <williams@redhat.com>
2009-12-21 16:02:21 -06:00
Carsten Emde d6e8606c24 Completely remove VERSION_STRING until we have a better solution.
Signed-off-by: Carsten Emde <C.Emde@osadl.org>
Signed-off-by: John Kacur <jkacur@redhat.com>
2009-12-21 22:36:55 +01:00
John Kacur 738ab3ea95 rt-tests: Clean-up - protect rt-utils.h
Clean-up: Protect rt-utils.h with #ifndef RT_UTILS_H

Signed-off-by: John Kacur <jkacur@redhat.com>
2009-12-21 22:17:59 +01:00
John Kacur 2d85600632 rt-tests: Add a get_cpu() function to the library.
Add a get_cpu() function to the library.
Most platforms will simply use sched_getcpu()
However, if you have a glibc < 2.6 then
64-bits will use vsyscall for getcpu (if available).
32-bits will use getcpu() (if available)

Signed-off-by: John Kacur <jkacur@redhat.com>
2009-12-21 22:02:38 +01:00
John Kacur 5ee3c0f037 rt-tests: Makefile - Changes to unify and simplify the Makefile
- These changes simplify the Makefile. For example, notice that we no
longer need to specify the full path to the source file
- These changes also unify the Makefile, for example, every program
gets VERSION_STRING as an floating point number.
- Due to the above change I had to make a number of changes in the programs
that expected VERSION_STRING as a string.
- By unifying what we CFLAGS, to include -D_GNU_SOURCE, I had to remove
__USE_GNU which is reduncant in a number of files.

Signed-off-by: John Kacur <jkacur@redhat.com>
2009-12-21 21:08:00 +01:00
John Kacur 273aa36231 Merge remote branch 'clrk/master' into rt-tests-dev
Conflicts:
	src/backfire/sendme.c
2009-12-21 17:48:20 +01:00
Clark Williams 1c3c9e34d6 convert source back to unix text (was DOS text)
Somehow the last set of tests added got converted to DOS text
(CRLF line terminators). Change them back

Signed-off-by: Clark Williams <williams@redhat.com>
2009-12-21 10:27:18 -06:00
John Kacur 2e1f658161 Merge commit 'clrk/master' into rt-tests-dev
Conflicts:
	rt-tests.spec-in
2009-12-15 23:21:00 +01:00
Clark Williams ff74d0eb70 version bump to 0.57 2009-12-15 13:48:37 -06:00
Carsten Emde 116a02e456 Add the following new tests - ptsematest - sigwaittest - svsematest - sendme
John,

thanks a lot for taking care of the new tests.

By some reason, the spec file was not included in the patch. This
patch is needed to prevent the rpm build from finding installed
but unpackaged files.

Signed-off-by: Carsten Emde <C.Emde@osadl.org>
2009-12-15 15:40:40 +01:00
Carsten Emde a6010f928e Explain that the backfire kernel module may need building.
Do a better job of explaining that the backfire kernel module may need
building in the sendme program.

Signed-off-by: Carsten Emde <C.Emde@osadl.org>
Signed-off-by: John Kacur <jkacur@redhat.com>
2009-12-15 00:09:40 +01:00
John Kacur e9007a0edd Add a .gitignore file in the backfire directory for generated files.
Add a .gitignore file in the backfire directory for generated files
that are created when making the kernel module.

Signed-off-by: John Kacur <jkacur@redhat.com>
2009-12-14 22:31:08 +01:00
John Kacur 863280b7d5 Remove making of backfire kernel module from the rt-tests makefile
The kernel module can be made by cding to src/backfire and doing
make modules
sudo make modules_install

Signed-off-by: John Kacur <jkacur@redhat.com>
2009-12-14 21:44:19 +01:00
John Kacur 1a29a37968 The PHONY target for install is incorrectly specified as "all"
Change the PHONY target for install to install

Signed-off-by: John Kacur <jkacur@redhat.com>
2009-12-14 21:14:28 +01:00
John Kacur 2c4267ff9a The version of check_privs that got added to the library must have come
from signaltest - because it doesn't have the fix that check_privs in
cyclictest has - to return the sched_priority to 0

This is a good example of why common functions should be put into libraries -
so all programs benefit from fixes.

Signed-off-by: John Kacur <jkacur@redhat.com>
2009-12-14 16:19:59 +01:00
John Kacur 150f680979 Add the new tests to .gitignore
Signed-off-by: John Kacur <jkacur@redhat.com>
2009-12-14 16:15:11 +01:00
John Kacur a017e969b3 Use sched_getcpu
- sched_getcpu is available since glibc 2.6
- the current tests were broken in anycase.

Signed-off-by: John Kacur <jkacur@redhat.com>
2009-12-14 16:13:09 +01:00
Carsten Emde 92b0181ce8 Add the following new tests
- ptsematest
- sigwaittest
- svsematest
- sendme

Signed-off-by: Carsten Emde <carsten.emde@osadl.org>
Signed-off-by: John Kacur <jkacur@redhat.com>
2009-12-14 15:53:20 +01:00
Carsten Emde da4e865225 Make use of the new library functions in signaltest.
Signed-off-by: Carsten Emde <carsten.emde@osadl.org>
Signed-off-by: John Kacur <jkacur@redhat.com>
2009-12-14 14:58:52 +01:00
Carsten Emde c51afec7fd Make use of the library functions in cyclic test.
Signed-off-by: Carsten Emde <carsten.emde@osadl.org>
Signed-off-by: John Kacur <jkacur@redhat.com>
2009-12-14 14:49:33 +01:00
Carsten Emde dce15eefef Start a separate library of functions for the rt-test suite.
The first couple are taken from cyclictest.

Signed-off-by: Carsten Emde <carsten.emde@osadl.org>
Signed-off-by: John Kacur <jkacur@redhat.com>
2009-12-14 14:21:19 +01:00
John Kacur a6d367302e Merge commit 'v0.56' into rt-tests-dev 2009-12-11 14:45:27 +01:00
Clark Williams 996e0f5e4d version bump to 0.56
Signed-off-by: Clark Williams <williams@redhat.com>
2009-12-10 14:33:40 -06:00
Clark Williams 93989ec0d6 [cyclictest] print thread ids when breaktracing
This commit adds some output then the -b option is used to break on
exceeding a threshold. the thread id of the thread that exceeded the
threshold is printed for use when looking at the trace log.

Signed-off-by: Clark Williams <williams@redhat.com>
2009-12-10 14:17:34 -06:00
John Kacur 3085482cff Merge commit 'v0.55' into rt-tests-dev 2009-11-19 23:31:29 +01:00
Clark Williams 4176f242c2 version bump to 0.55 2009-11-19 15:04:43 -06:00
Clark Williams 0b34a7b2bf rt-tests: pi_stress: cosmetic newline added
Add a second newline to the "Low thread priority" display line
so that updating number of inversions doesn't overwrite it.

Signed-off-by: Clark Williams <williams@redhat.com>
2009-11-19 14:17:10 -06:00
John Kacur d2ad7c7506 rt-tests: pi_stress: Remove racy state variables that cause watchdog to trigger
When using pthread_barrier_wait, it is important that barriers are called
the correct number of times. That is - the same number given as the count
when initializing the barrier.

There was a do-while loop around elevate_barrier in the med priority thread.
On most machines, it actually never looped.

On threads with enough processors (nehelam for example), there was a racy
situation in which the high priority thread could come out of the finish
barrier, and before it could set high_has_run = 0, the medium priority
thread would test the value and call the elevate barrier an extra time.

This patch removes the bogus loop and related state variables and fixes
the hang.

Signed-off-by: John Kacur <jkacur@redhat.com>
2009-11-19 10:58:00 -06:00
John Kacur cf46ad44b9 rt-tests: pi_stress: Check whether quiet is set, before taking shutdown_mtx
- Check whether quiet is set, before taking shutdown_mtx
- Add quiet to the help menu.
- Remove unused "signal" from struct options

Signed-off-by: John Kacur <jkacur@redhat.com>
2009-11-19 10:57:47 -06:00
John Kacur 9ee4dcad03 rt-tests: pi_stress: Use a pthread_mutex_t for the global variable shutdown
- Use a pthread_mutex_t for the global variable shutdown.
- Remove the volatile qualifier from shutdown. (Since the original author
probably simply meant the variable should be atomic which we effectively
get through the mutex.

Signed-off-by: John Kacur <jkacur@redhat.com>
2009-11-19 10:57:32 -06:00
John Kacur 2712903a40 rt-tests: pi_stress: Remove racy state variables that cause watchdog to trigger
When using pthread_barrier_wait, it is important that barriers are called
the correct number of times. That is - the same number given as the count
when initializing the barrier.

There was a do-while loop around elevate_barrier in the med priority thread.
On most machines, it actually never looped.

On threads with enough processors (nehelam for example), there was a racy
situation in which the high priority thread could come out of the finish
barrier, and before it could set high_has_run = 0, the medium priority
thread would test the value and call the elevate barrier an extra time.

This patch removes the bogus loop and related state variables and fixes
the hang.

Signed-off-by: John Kacur <jkacur@redhat.com>
2009-11-19 16:24:07 +01:00
John Kacur 9093a5de51 rt-tests: pi_stress: Check whether quiet is set, before taking shutdown_mtx
- Check whether quiet is set, before taking shutdown_mtx
- Add quiet to the help menu.
- Remove unused "signal" from struct options

Signed-off-by: John Kacur <jkacur@redhat.com>
2009-11-19 12:02:52 +01:00
John Kacur 97dbb3cebd rt-tests: pi_stress: Use a pthread_mutex_t for the global variable shutdown
- Use a pthread_mutex_t for the global variable shutdown.
- Remove the volatile qualifier from shutdown. (Since the original author
probably simply meant the variable should be atomic which we effectively
get through the mutex.

Signed-off-by: John Kacur <jkacur@redhat.com>
2009-11-19 11:50:10 +01:00
John Kacur 8f9ffd3750 Merge branch 'master' into rt-tests-dev 2009-11-18 10:21:47 +01:00
Clark Williams c8fdec1e07 version bump to 0.54 2009-11-17 17:01:37 -06:00
John Kacur edce3be048 rt-tests: Makefile - rt-tests.spec is not a PHONY target
Reported-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: John Kacur <jkacur@redhat.com>
Signed-off-by: Clark Williams <williams@redhat.com>
2009-11-17 15:24:25 -06:00
John Kacur 168f2a35eb pi_stress: Convert c-plus style comments to c-style comments
Signed-off-by: John Kacur <jkacur@redhat.com>
Signed-off-by: Clark Williams <williams@redhat.com>
2009-11-17 15:17:29 -06:00