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>
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>
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>
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>
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>
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>
- 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>
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>
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>
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>
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>
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>
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>
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>
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>
- 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>
- 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>
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>
- 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>
- 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>
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>