aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavidlohr Bueso <dave@stgolabs.net>2015-07-01 16:29:48 -0400
committerThomas Gleixner <tglx@linutronix.de>2015-07-20 05:45:45 -0400
commit1b0b7c1762679a2f8bc359da95649249dfcf4195 (patch)
tree72e476909ae0c6ee258ed171580405c1ba4603b6
parentab51fbab39d864f3223e44a2600fd951df261f0b (diff)
rtmutex: Delete scriptable tester
No one uses this anymore, and this is not the first time the idea of replacing it with a (now possible) userspace side. Lock stealing logic was removed long ago in when the lock was granted to the highest prio. Signed-off-by: Davidlohr Bueso <dbueso@suse.de> Cc: Darren Hart <dvhart@infradead.org> Cc: Steven Rostedt <rostedt@goodmis.org> Cc: Mike Galbraith <umgwanakikbuti@gmail.com> Cc: Paul E. McKenney <paulmck@linux.vnet.ibm.com> Cc: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Cc: Davidlohr Bueso <dave@stgolabs.net> Cc: Peter Zijlstra <peterz@infradead.org> Link: http://lkml.kernel.org/r/1435782588-4177-2-git-send-email-dave@stgolabs.net Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
-rw-r--r--arch/parisc/configs/c8000_defconfig1
-rw-r--r--arch/parisc/configs/generic-32bit_defconfig1
-rw-r--r--arch/xtensa/configs/iss_defconfig1
-rw-r--r--kernel/locking/Makefile1
-rw-r--r--kernel/locking/rtmutex-tester.c420
-rw-r--r--kernel/locking/rtmutex.c2
-rw-r--r--kernel/locking/rtmutex_common.h22
-rw-r--r--lib/Kconfig.debug6
-rw-r--r--scripts/rt-tester/check-all.sh21
-rwxr-xr-xscripts/rt-tester/rt-tester.py218
-rw-r--r--scripts/rt-tester/t2-l1-2rt-sameprio.tst94
-rw-r--r--scripts/rt-tester/t2-l1-pi.tst77
-rw-r--r--scripts/rt-tester/t2-l1-signal.tst72
-rw-r--r--scripts/rt-tester/t2-l2-2rt-deadlock.tst84
-rw-r--r--scripts/rt-tester/t3-l1-pi-1rt.tst87
-rw-r--r--scripts/rt-tester/t3-l1-pi-2rt.tst88
-rw-r--r--scripts/rt-tester/t3-l1-pi-3rt.tst87
-rw-r--r--scripts/rt-tester/t3-l1-pi-signal.tst93
-rw-r--r--scripts/rt-tester/t3-l1-pi-steal.tst91
-rw-r--r--scripts/rt-tester/t3-l2-pi.tst87
-rw-r--r--scripts/rt-tester/t4-l2-pi-deboost.tst118
-rw-r--r--scripts/rt-tester/t5-l4-pi-boost-deboost-setsched.tst178
-rw-r--r--scripts/rt-tester/t5-l4-pi-boost-deboost.tst138
23 files changed, 1 insertions, 1986 deletions
diff --git a/arch/parisc/configs/c8000_defconfig b/arch/parisc/configs/c8000_defconfig
index 269c23d23fcb..1a8f6f95689e 100644
--- a/arch/parisc/configs/c8000_defconfig
+++ b/arch/parisc/configs/c8000_defconfig
@@ -242,7 +242,6 @@ CONFIG_LOCKUP_DETECTOR=y
242CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC=y 242CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC=y
243CONFIG_PANIC_ON_OOPS=y 243CONFIG_PANIC_ON_OOPS=y
244CONFIG_DEBUG_RT_MUTEXES=y 244CONFIG_DEBUG_RT_MUTEXES=y
245CONFIG_RT_MUTEX_TESTER=y
246CONFIG_PROVE_RCU_DELAY=y 245CONFIG_PROVE_RCU_DELAY=y
247CONFIG_DEBUG_BLOCK_EXT_DEVT=y 246CONFIG_DEBUG_BLOCK_EXT_DEVT=y
248CONFIG_LATENCYTOP=y 247CONFIG_LATENCYTOP=y
diff --git a/arch/parisc/configs/generic-32bit_defconfig b/arch/parisc/configs/generic-32bit_defconfig
index 33b148f825ba..0ffb08ff5125 100644
--- a/arch/parisc/configs/generic-32bit_defconfig
+++ b/arch/parisc/configs/generic-32bit_defconfig
@@ -295,7 +295,6 @@ CONFIG_DEBUG_SHIRQ=y
295CONFIG_DETECT_HUNG_TASK=y 295CONFIG_DETECT_HUNG_TASK=y
296CONFIG_TIMER_STATS=y 296CONFIG_TIMER_STATS=y
297CONFIG_DEBUG_RT_MUTEXES=y 297CONFIG_DEBUG_RT_MUTEXES=y
298CONFIG_RT_MUTEX_TESTER=y
299CONFIG_DEBUG_SPINLOCK=y 298CONFIG_DEBUG_SPINLOCK=y
300CONFIG_DEBUG_MUTEXES=y 299CONFIG_DEBUG_MUTEXES=y
301CONFIG_RCU_CPU_STALL_INFO=y 300CONFIG_RCU_CPU_STALL_INFO=y
diff --git a/arch/xtensa/configs/iss_defconfig b/arch/xtensa/configs/iss_defconfig
index e4d193e7a300..f3dfe0d921c2 100644
--- a/arch/xtensa/configs/iss_defconfig
+++ b/arch/xtensa/configs/iss_defconfig
@@ -616,7 +616,6 @@ CONFIG_SCHED_DEBUG=y
616# CONFIG_SLUB_DEBUG_ON is not set 616# CONFIG_SLUB_DEBUG_ON is not set
617# CONFIG_SLUB_STATS is not set 617# CONFIG_SLUB_STATS is not set
618# CONFIG_DEBUG_RT_MUTEXES is not set 618# CONFIG_DEBUG_RT_MUTEXES is not set
619# CONFIG_RT_MUTEX_TESTER is not set
620# CONFIG_DEBUG_SPINLOCK is not set 619# CONFIG_DEBUG_SPINLOCK is not set
621# CONFIG_DEBUG_MUTEXES is not set 620# CONFIG_DEBUG_MUTEXES is not set
622# CONFIG_DEBUG_SPINLOCK_SLEEP is not set 621# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
diff --git a/kernel/locking/Makefile b/kernel/locking/Makefile
index 7dd5c9918e4c..36942047ffc0 100644
--- a/kernel/locking/Makefile
+++ b/kernel/locking/Makefile
@@ -20,7 +20,6 @@ obj-$(CONFIG_PROVE_LOCKING) += spinlock.o
20obj-$(CONFIG_QUEUED_SPINLOCKS) += qspinlock.o 20obj-$(CONFIG_QUEUED_SPINLOCKS) += qspinlock.o
21obj-$(CONFIG_RT_MUTEXES) += rtmutex.o 21obj-$(CONFIG_RT_MUTEXES) += rtmutex.o
22obj-$(CONFIG_DEBUG_RT_MUTEXES) += rtmutex-debug.o 22obj-$(CONFIG_DEBUG_RT_MUTEXES) += rtmutex-debug.o
23obj-$(CONFIG_RT_MUTEX_TESTER) += rtmutex-tester.o
24obj-$(CONFIG_DEBUG_SPINLOCK) += spinlock.o 23obj-$(CONFIG_DEBUG_SPINLOCK) += spinlock.o
25obj-$(CONFIG_DEBUG_SPINLOCK) += spinlock_debug.o 24obj-$(CONFIG_DEBUG_SPINLOCK) += spinlock_debug.o
26obj-$(CONFIG_RWSEM_GENERIC_SPINLOCK) += rwsem-spinlock.o 25obj-$(CONFIG_RWSEM_GENERIC_SPINLOCK) += rwsem-spinlock.o
diff --git a/kernel/locking/rtmutex-tester.c b/kernel/locking/rtmutex-tester.c
deleted file mode 100644
index 1d96dd0d93c1..000000000000
--- a/kernel/locking/rtmutex-tester.c
+++ /dev/null
@@ -1,420 +0,0 @@
1/*
2 * RT-Mutex-tester: scriptable tester for rt mutexes
3 *
4 * started by Thomas Gleixner:
5 *
6 * Copyright (C) 2006, Timesys Corp., Thomas Gleixner <tglx@timesys.com>
7 *
8 */
9#include <linux/device.h>
10#include <linux/kthread.h>
11#include <linux/export.h>
12#include <linux/sched.h>
13#include <linux/sched/rt.h>
14#include <linux/spinlock.h>
15#include <linux/timer.h>
16#include <linux/freezer.h>
17#include <linux/stat.h>
18
19#include "rtmutex.h"
20
21#define MAX_RT_TEST_THREADS 8
22#define MAX_RT_TEST_MUTEXES 8
23
24static spinlock_t rttest_lock;
25static atomic_t rttest_event;
26
27struct test_thread_data {
28 int opcode;
29 int opdata;
30 int mutexes[MAX_RT_TEST_MUTEXES];
31 int event;
32 struct device dev;
33};
34
35static struct test_thread_data thread_data[MAX_RT_TEST_THREADS];
36static struct task_struct *threads[MAX_RT_TEST_THREADS];
37static struct rt_mutex mutexes[MAX_RT_TEST_MUTEXES];
38
39enum test_opcodes {
40 RTTEST_NOP = 0,
41 RTTEST_SCHEDOT, /* 1 Sched other, data = nice */
42 RTTEST_SCHEDRT, /* 2 Sched fifo, data = prio */
43 RTTEST_LOCK, /* 3 Lock uninterruptible, data = lockindex */
44 RTTEST_LOCKNOWAIT, /* 4 Lock uninterruptible no wait in wakeup, data = lockindex */
45 RTTEST_LOCKINT, /* 5 Lock interruptible, data = lockindex */
46 RTTEST_LOCKINTNOWAIT, /* 6 Lock interruptible no wait in wakeup, data = lockindex */
47 RTTEST_LOCKCONT, /* 7 Continue locking after the wakeup delay */
48 RTTEST_UNLOCK, /* 8 Unlock, data = lockindex */
49 /* 9, 10 - reserved for BKL commemoration */
50 RTTEST_SIGNAL = 11, /* 11 Signal other test thread, data = thread id */
51 RTTEST_RESETEVENT = 98, /* 98 Reset event counter */
52 RTTEST_RESET = 99, /* 99 Reset all pending operations */
53};
54
55static int handle_op(struct test_thread_data *td, int lockwakeup)
56{
57 int i, id, ret = -EINVAL;
58
59 switch(td->opcode) {
60
61 case RTTEST_NOP:
62 return 0;
63
64 case RTTEST_LOCKCONT:
65 td->mutexes[td->opdata] = 1;
66 td->event = atomic_add_return(1, &rttest_event);
67 return 0;
68
69 case RTTEST_RESET:
70 for (i = 0; i < MAX_RT_TEST_MUTEXES; i++) {
71 if (td->mutexes[i] == 4) {
72 rt_mutex_unlock(&mutexes[i]);
73 td->mutexes[i] = 0;
74 }
75 }
76 return 0;
77
78 case RTTEST_RESETEVENT:
79 atomic_set(&rttest_event, 0);
80 return 0;
81
82 default:
83 if (lockwakeup)
84 return ret;
85 }
86
87 switch(td->opcode) {
88
89 case RTTEST_LOCK:
90 case RTTEST_LOCKNOWAIT:
91 id = td->opdata;
92 if (id < 0 || id >= MAX_RT_TEST_MUTEXES)
93 return ret;
94
95 td->mutexes[id] = 1;
96 td->event = atomic_add_return(1, &rttest_event);
97 rt_mutex_lock(&mutexes[id]);
98 td->event = atomic_add_return(1, &rttest_event);
99 td->mutexes[id] = 4;
100 return 0;
101
102 case RTTEST_LOCKINT:
103 case RTTEST_LOCKINTNOWAIT:
104 id = td->opdata;
105 if (id < 0 || id >= MAX_RT_TEST_MUTEXES)
106 return ret;
107
108 td->mutexes[id] = 1;
109 td->event = atomic_add_return(1, &rttest_event);
110 ret = rt_mutex_lock_interruptible(&mutexes[id], 0);
111 td->event = atomic_add_return(1, &rttest_event);
112 td->mutexes[id] = ret ? 0 : 4;
113 return ret ? -EINTR : 0;
114
115 case RTTEST_UNLOCK:
116 id = td->opdata;
117 if (id < 0 || id >= MAX_RT_TEST_MUTEXES || td->mutexes[id] != 4)
118 return ret;
119
120 td->event = atomic_add_return(1, &rttest_event);
121 rt_mutex_unlock(&mutexes[id]);
122 td->event = atomic_add_return(1, &rttest_event);
123 td->mutexes[id] = 0;
124 return 0;
125
126 default:
127 break;
128 }
129 return ret;
130}
131
132/*
133 * Schedule replacement for rtsem_down(). Only called for threads with
134 * PF_MUTEX_TESTER set.
135 *
136 * This allows us to have finegrained control over the event flow.
137 *
138 */
139void schedule_rt_mutex_test(struct rt_mutex *mutex)
140{
141 int tid, op, dat;
142 struct test_thread_data *td;
143
144 /* We have to lookup the task */
145 for (tid = 0; tid < MAX_RT_TEST_THREADS; tid++) {
146 if (threads[tid] == current)
147 break;
148 }
149
150 BUG_ON(tid == MAX_RT_TEST_THREADS);
151
152 td = &thread_data[tid];
153
154 op = td->opcode;
155 dat = td->opdata;
156
157 switch (op) {
158 case RTTEST_LOCK:
159 case RTTEST_LOCKINT:
160 case RTTEST_LOCKNOWAIT:
161 case RTTEST_LOCKINTNOWAIT:
162 if (mutex != &mutexes[dat])
163 break;
164
165 if (td->mutexes[dat] != 1)
166 break;
167
168 td->mutexes[dat] = 2;
169 td->event = atomic_add_return(1, &rttest_event);
170 break;
171
172 default:
173 break;
174 }
175
176 schedule();
177
178
179 switch (op) {
180 case RTTEST_LOCK:
181 case RTTEST_LOCKINT:
182 if (mutex != &mutexes[dat])
183 return;
184
185 if (td->mutexes[dat] != 2)
186 return;
187
188 td->mutexes[dat] = 3;
189 td->event = atomic_add_return(1, &rttest_event);
190 break;
191
192 case RTTEST_LOCKNOWAIT:
193 case RTTEST_LOCKINTNOWAIT:
194 if (mutex != &mutexes[dat])
195 return;
196
197 if (td->mutexes[dat] != 2)
198 return;
199
200 td->mutexes[dat] = 1;
201 td->event = atomic_add_return(1, &rttest_event);
202 return;
203
204 default:
205 return;
206 }
207
208 td->opcode = 0;
209
210 for (;;) {
211 set_current_state(TASK_INTERRUPTIBLE);
212
213 if (td->opcode > 0) {
214 int ret;
215
216 set_current_state(TASK_RUNNING);
217 ret = handle_op(td, 1);
218 set_current_state(TASK_INTERRUPTIBLE);
219 if (td->opcode == RTTEST_LOCKCONT)
220 break;
221 td->opcode = ret;
222 }
223
224 /* Wait for the next command to be executed */
225 schedule();
226 }
227
228 /* Restore previous command and data */
229 td->opcode = op;
230 td->opdata = dat;
231}
232
233static int test_func(void *data)
234{
235 struct test_thread_data *td = data;
236 int ret;
237
238 current->flags |= PF_MUTEX_TESTER;
239 set_freezable();
240 allow_signal(SIGHUP);
241
242 for(;;) {
243
244 set_current_state(TASK_INTERRUPTIBLE);
245
246 if (td->opcode > 0) {
247 set_current_state(TASK_RUNNING);
248 ret = handle_op(td, 0);
249 set_current_state(TASK_INTERRUPTIBLE);
250 td->opcode = ret;
251 }
252
253 /* Wait for the next command to be executed */
254 schedule();
255 try_to_freeze();
256
257 if (signal_pending(current))
258 flush_signals(current);
259
260 if(kthread_should_stop())
261 break;
262 }
263 return 0;
264}
265
266/**
267 * sysfs_test_command - interface for test commands
268 * @dev: thread reference
269 * @buf: command for actual step
270 * @count: length of buffer
271 *
272 * command syntax:
273 *
274 * opcode:data
275 */
276static ssize_t sysfs_test_command(struct device *dev, struct device_attribute *attr,
277 const char *buf, size_t count)
278{
279 struct sched_param schedpar;
280 struct test_thread_data *td;
281 char cmdbuf[32];
282 int op, dat, tid, ret;
283
284 td = container_of(dev, struct test_thread_data, dev);
285 tid = td->dev.id;
286
287 /* strings from sysfs write are not 0 terminated! */
288 if (count >= sizeof(cmdbuf))
289 return -EINVAL;
290
291 /* strip of \n: */
292 if (buf[count-1] == '\n')
293 count--;
294 if (count < 1)
295 return -EINVAL;
296
297 memcpy(cmdbuf, buf, count);
298 cmdbuf[count] = 0;
299
300 if (sscanf(cmdbuf, "%d:%d", &op, &dat) != 2)
301 return -EINVAL;
302
303 switch (op) {
304 case RTTEST_SCHEDOT:
305 schedpar.sched_priority = 0;
306 ret = sched_setscheduler(threads[tid], SCHED_NORMAL, &schedpar);
307 if (ret)
308 return ret;
309 set_user_nice(current, 0);
310 break;
311
312 case RTTEST_SCHEDRT:
313 schedpar.sched_priority = dat;
314 ret = sched_setscheduler(threads[tid], SCHED_FIFO, &schedpar);
315 if (ret)
316 return ret;
317 break;
318
319 case RTTEST_SIGNAL:
320 send_sig(SIGHUP, threads[tid], 0);
321 break;
322
323 default:
324 if (td->opcode > 0)
325 return -EBUSY;
326 td->opdata = dat;
327 td->opcode = op;
328 wake_up_process(threads[tid]);
329 }
330
331 return count;
332}
333
334/**
335 * sysfs_test_status - sysfs interface for rt tester
336 * @dev: thread to query
337 * @buf: char buffer to be filled with thread status info
338 */
339static ssize_t sysfs_test_status(struct device *dev, struct device_attribute *attr,
340 char *buf)
341{
342 struct test_thread_data *td;
343 struct task_struct *tsk;
344 char *curr = buf;
345 int i;
346
347 td = container_of(dev, struct test_thread_data, dev);
348 tsk = threads[td->dev.id];
349
350 spin_lock(&rttest_lock);
351
352 curr += sprintf(curr,
353 "O: %4d, E:%8d, S: 0x%08lx, P: %4d, N: %4d, B: %p, M:",
354 td->opcode, td->event, tsk->state,
355 (MAX_RT_PRIO - 1) - tsk->prio,
356 (MAX_RT_PRIO - 1) - tsk->normal_prio,
357 tsk->pi_blocked_on);
358
359 for (i = MAX_RT_TEST_MUTEXES - 1; i >=0 ; i--)
360 curr += sprintf(curr, "%d", td->mutexes[i]);
361
362 spin_unlock(&rttest_lock);
363
364 curr += sprintf(curr, ", T: %p, R: %p\n", tsk,
365 mutexes[td->dev.id].owner);
366
367 return curr - buf;
368}
369
370static DEVICE_ATTR(status, S_IRUSR, sysfs_test_status, NULL);
371static DEVICE_ATTR(command, S_IWUSR, NULL, sysfs_test_command);
372
373static struct bus_type rttest_subsys = {
374 .name = "rttest",
375 .dev_name = "rttest",
376};
377
378static int init_test_thread(int id)
379{
380 thread_data[id].dev.bus = &rttest_subsys;
381 thread_data[id].dev.id = id;
382
383 threads[id] = kthread_run(test_func, &thread_data[id], "rt-test-%d", id);
384 if (IS_ERR(threads[id]))
385 return PTR_ERR(threads[id]);
386
387 return device_register(&thread_data[id].dev);
388}
389
390static int init_rttest(void)
391{
392 int ret, i;
393
394 spin_lock_init(&rttest_lock);
395
396 for (i = 0; i < MAX_RT_TEST_MUTEXES; i++)
397 rt_mutex_init(&mutexes[i]);
398
399 ret = subsys_system_register(&rttest_subsys, NULL);
400 if (ret)
401 return ret;
402
403 for (i = 0; i < MAX_RT_TEST_THREADS; i++) {
404 ret = init_test_thread(i);
405 if (ret)
406 break;
407 ret = device_create_file(&thread_data[i].dev, &dev_attr_status);
408 if (ret)
409 break;
410 ret = device_create_file(&thread_data[i].dev, &dev_attr_command);
411 if (ret)
412 break;
413 }
414
415 printk("Initializing RT-Tester: %s\n", ret ? "Failed" : "OK" );
416
417 return ret;
418}
419
420device_initcall(init_rttest);
diff --git a/kernel/locking/rtmutex.c b/kernel/locking/rtmutex.c
index 5674b073473c..7781d801212f 100644
--- a/kernel/locking/rtmutex.c
+++ b/kernel/locking/rtmutex.c
@@ -1120,7 +1120,7 @@ __rt_mutex_slowlock(struct rt_mutex *lock, int state,
1120 1120
1121 debug_rt_mutex_print_deadlock(waiter); 1121 debug_rt_mutex_print_deadlock(waiter);
1122 1122
1123 schedule_rt_mutex(lock); 1123 schedule();
1124 1124
1125 raw_spin_lock(&lock->wait_lock); 1125 raw_spin_lock(&lock->wait_lock);
1126 set_current_state(state); 1126 set_current_state(state);
diff --git a/kernel/locking/rtmutex_common.h b/kernel/locking/rtmutex_common.h
index 7844f8f0e639..4f5f83c7d2d3 100644
--- a/kernel/locking/rtmutex_common.h
+++ b/kernel/locking/rtmutex_common.h
@@ -15,28 +15,6 @@
15#include <linux/rtmutex.h> 15#include <linux/rtmutex.h>
16 16
17/* 17/*
18 * The rtmutex in kernel tester is independent of rtmutex debugging. We
19 * call schedule_rt_mutex_test() instead of schedule() for the tasks which
20 * belong to the tester. That way we can delay the wakeup path of those
21 * threads to provoke lock stealing and testing of complex boosting scenarios.
22 */
23#ifdef CONFIG_RT_MUTEX_TESTER
24
25extern void schedule_rt_mutex_test(struct rt_mutex *lock);
26
27#define schedule_rt_mutex(_lock) \
28 do { \
29 if (!(current->flags & PF_MUTEX_TESTER)) \
30 schedule(); \
31 else \
32 schedule_rt_mutex_test(_lock); \
33 } while (0)
34
35#else
36# define schedule_rt_mutex(_lock) schedule()
37#endif
38
39/*
40 * This is the control structure for tasks blocked on a rt_mutex, 18 * This is the control structure for tasks blocked on a rt_mutex,
41 * which is allocated on the kernel stack on of the blocked task. 19 * which is allocated on the kernel stack on of the blocked task.
42 * 20 *
diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug
index 22554d6f720f..e7b5b654ed8d 100644
--- a/lib/Kconfig.debug
+++ b/lib/Kconfig.debug
@@ -916,12 +916,6 @@ config DEBUG_RT_MUTEXES
916 This allows rt mutex semantics violations and rt mutex related 916 This allows rt mutex semantics violations and rt mutex related
917 deadlocks (lockups) to be detected and reported automatically. 917 deadlocks (lockups) to be detected and reported automatically.
918 918
919config RT_MUTEX_TESTER
920 bool "Built-in scriptable tester for rt-mutexes"
921 depends on DEBUG_KERNEL && RT_MUTEXES && BROKEN
922 help
923 This option enables a rt-mutex tester.
924
925config DEBUG_SPINLOCK 919config DEBUG_SPINLOCK
926 bool "Spinlock and rw-lock debugging: basic checks" 920 bool "Spinlock and rw-lock debugging: basic checks"
927 depends on DEBUG_KERNEL 921 depends on DEBUG_KERNEL
diff --git a/scripts/rt-tester/check-all.sh b/scripts/rt-tester/check-all.sh
deleted file mode 100644
index 6b5c83baf148..000000000000
--- a/scripts/rt-tester/check-all.sh
+++ /dev/null
@@ -1,21 +0,0 @@
1
2
3function testit ()
4{
5 printf "%-30s: " $1
6 ./rt-tester.py $1 | grep Pass
7}
8
9testit t2-l1-2rt-sameprio.tst
10testit t2-l1-pi.tst
11testit t2-l1-signal.tst
12#testit t2-l2-2rt-deadlock.tst
13testit t3-l1-pi-1rt.tst
14testit t3-l1-pi-2rt.tst
15testit t3-l1-pi-3rt.tst
16testit t3-l1-pi-signal.tst
17testit t3-l1-pi-steal.tst
18testit t3-l2-pi.tst
19testit t4-l2-pi-deboost.tst
20testit t5-l4-pi-boost-deboost.tst
21testit t5-l4-pi-boost-deboost-setsched.tst
diff --git a/scripts/rt-tester/rt-tester.py b/scripts/rt-tester/rt-tester.py
deleted file mode 100755
index 6d916c2a45a5..000000000000
--- a/scripts/rt-tester/rt-tester.py
+++ /dev/null
@@ -1,218 +0,0 @@
1#!/usr/bin/python
2#
3# rt-mutex tester
4#
5# (C) 2006 Thomas Gleixner <tglx@linutronix.de>
6#
7# This program is free software; you can redistribute it and/or modify
8# it under the terms of the GNU General Public License version 2 as
9# published by the Free Software Foundation.
10#
11import os
12import sys
13import getopt
14import shutil
15import string
16
17# Globals
18quiet = 0
19test = 0
20comments = 0
21
22sysfsprefix = "/sys/devices/system/rttest/rttest"
23statusfile = "/status"
24commandfile = "/command"
25
26# Command opcodes
27cmd_opcodes = {
28 "schedother" : "1",
29 "schedfifo" : "2",
30 "lock" : "3",
31 "locknowait" : "4",
32 "lockint" : "5",
33 "lockintnowait" : "6",
34 "lockcont" : "7",
35 "unlock" : "8",
36 "signal" : "11",
37 "resetevent" : "98",
38 "reset" : "99",
39 }
40
41test_opcodes = {
42 "prioeq" : ["P" , "eq" , None],
43 "priolt" : ["P" , "lt" , None],
44 "priogt" : ["P" , "gt" , None],
45 "nprioeq" : ["N" , "eq" , None],
46 "npriolt" : ["N" , "lt" , None],
47 "npriogt" : ["N" , "gt" , None],
48 "unlocked" : ["M" , "eq" , 0],
49 "trylock" : ["M" , "eq" , 1],
50 "blocked" : ["M" , "eq" , 2],
51 "blockedwake" : ["M" , "eq" , 3],
52 "locked" : ["M" , "eq" , 4],
53 "opcodeeq" : ["O" , "eq" , None],
54 "opcodelt" : ["O" , "lt" , None],
55 "opcodegt" : ["O" , "gt" , None],
56 "eventeq" : ["E" , "eq" , None],
57 "eventlt" : ["E" , "lt" , None],
58 "eventgt" : ["E" , "gt" , None],
59 }
60
61# Print usage information
62def usage():
63 print "rt-tester.py <-c -h -q -t> <testfile>"
64 print " -c display comments after first command"
65 print " -h help"
66 print " -q quiet mode"
67 print " -t test mode (syntax check)"
68 print " testfile: read test specification from testfile"
69 print " otherwise from stdin"
70 return
71
72# Print progress when not in quiet mode
73def progress(str):
74 if not quiet:
75 print str
76
77# Analyse a status value
78def analyse(val, top, arg):
79
80 intval = int(val)
81
82 if top[0] == "M":
83 intval = intval / (10 ** int(arg))
84 intval = intval % 10
85 argval = top[2]
86 elif top[0] == "O":
87 argval = int(cmd_opcodes.get(arg, arg))
88 else:
89 argval = int(arg)
90
91 # progress("%d %s %d" %(intval, top[1], argval))
92
93 if top[1] == "eq" and intval == argval:
94 return 1
95 if top[1] == "lt" and intval < argval:
96 return 1
97 if top[1] == "gt" and intval > argval:
98 return 1
99 return 0
100
101# Parse the commandline
102try:
103 (options, arguments) = getopt.getopt(sys.argv[1:],'chqt')
104except getopt.GetoptError, ex:
105 usage()
106 sys.exit(1)
107
108# Parse commandline options
109for option, value in options:
110 if option == "-c":
111 comments = 1
112 elif option == "-q":
113 quiet = 1
114 elif option == "-t":
115 test = 1
116 elif option == '-h':
117 usage()
118 sys.exit(0)
119
120# Select the input source
121if arguments:
122 try:
123 fd = open(arguments[0])
124 except Exception,ex:
125 sys.stderr.write("File not found %s\n" %(arguments[0]))
126 sys.exit(1)
127else:
128 fd = sys.stdin
129
130linenr = 0
131
132# Read the test patterns
133while 1:
134
135 linenr = linenr + 1
136 line = fd.readline()
137 if not len(line):
138 break
139
140 line = line.strip()
141 parts = line.split(":")
142
143 if not parts or len(parts) < 1:
144 continue
145
146 if len(parts[0]) == 0:
147 continue
148
149 if parts[0].startswith("#"):
150 if comments > 1:
151 progress(line)
152 continue
153
154 if comments == 1:
155 comments = 2
156
157 progress(line)
158
159 cmd = parts[0].strip().lower()
160 opc = parts[1].strip().lower()
161 tid = parts[2].strip()
162 dat = parts[3].strip()
163
164 try:
165 # Test or wait for a status value
166 if cmd == "t" or cmd == "w":
167 testop = test_opcodes[opc]
168
169 fname = "%s%s%s" %(sysfsprefix, tid, statusfile)
170 if test:
171 print fname
172 continue
173
174 while 1:
175 query = 1
176 fsta = open(fname, 'r')
177 status = fsta.readline().strip()
178 fsta.close()
179 stat = status.split(",")
180 for s in stat:
181 s = s.strip()
182 if s.startswith(testop[0]):
183 # Separate status value
184 val = s[2:].strip()
185 query = analyse(val, testop, dat)
186 break
187 if query or cmd == "t":
188 break
189
190 progress(" " + status)
191
192 if not query:
193 sys.stderr.write("Test failed in line %d\n" %(linenr))
194 sys.exit(1)
195
196 # Issue a command to the tester
197 elif cmd == "c":
198 cmdnr = cmd_opcodes[opc]
199 # Build command string and sys filename
200 cmdstr = "%s:%s" %(cmdnr, dat)
201 fname = "%s%s%s" %(sysfsprefix, tid, commandfile)
202 if test:
203 print fname
204 continue
205 fcmd = open(fname, 'w')
206 fcmd.write(cmdstr)
207 fcmd.close()
208
209 except Exception,ex:
210 sys.stderr.write(str(ex))
211 sys.stderr.write("\nSyntax error in line %d\n" %(linenr))
212 if not test:
213 fd.close()
214 sys.exit(1)
215
216# Normal exit pass
217print "Pass"
218sys.exit(0)
diff --git a/scripts/rt-tester/t2-l1-2rt-sameprio.tst b/scripts/rt-tester/t2-l1-2rt-sameprio.tst
deleted file mode 100644
index 3710c8b2090d..000000000000
--- a/scripts/rt-tester/t2-l1-2rt-sameprio.tst
+++ /dev/null
@@ -1,94 +0,0 @@
1#
2# RT-Mutex test
3#
4# Op: C(ommand)/T(est)/W(ait)
5# | opcode
6# | | threadid: 0-7
7# | | | opcode argument
8# | | | |
9# C: lock: 0: 0
10#
11# Commands
12#
13# opcode opcode argument
14# schedother nice value
15# schedfifo priority
16# lock lock nr (0-7)
17# locknowait lock nr (0-7)
18# lockint lock nr (0-7)
19# lockintnowait lock nr (0-7)
20# lockcont lock nr (0-7)
21# unlock lock nr (0-7)
22# signal 0
23# reset 0
24# resetevent 0
25#
26# Tests / Wait
27#
28# opcode opcode argument
29#
30# prioeq priority
31# priolt priority
32# priogt priority
33# nprioeq normal priority
34# npriolt normal priority
35# npriogt normal priority
36# locked lock nr (0-7)
37# blocked lock nr (0-7)
38# blockedwake lock nr (0-7)
39# unlocked lock nr (0-7)
40# opcodeeq command opcode or number
41# opcodelt number
42# opcodegt number
43# eventeq number
44# eventgt number
45# eventlt number
46
47#
48# 2 threads 1 lock
49#
50C: resetevent: 0: 0
51W: opcodeeq: 0: 0
52
53# Set schedulers
54C: schedfifo: 0: 80
55C: schedfifo: 1: 80
56
57# T0 lock L0
58C: locknowait: 0: 0
59C: locknowait: 1: 0
60W: locked: 0: 0
61W: blocked: 1: 0
62T: prioeq: 0: 80
63
64# T0 unlock L0
65C: unlock: 0: 0
66W: locked: 1: 0
67
68# Verify T0
69W: unlocked: 0: 0
70T: prioeq: 0: 80
71
72# Unlock
73C: unlock: 1: 0
74W: unlocked: 1: 0
75
76# T1,T0 lock L0
77C: locknowait: 1: 0
78C: locknowait: 0: 0
79W: locked: 1: 0
80W: blocked: 0: 0
81T: prioeq: 1: 80
82
83# T1 unlock L0
84C: unlock: 1: 0
85W: locked: 0: 0
86
87# Verify T1
88W: unlocked: 1: 0
89T: prioeq: 1: 80
90
91# Unlock and exit
92C: unlock: 0: 0
93W: unlocked: 0: 0
94
diff --git a/scripts/rt-tester/t2-l1-pi.tst b/scripts/rt-tester/t2-l1-pi.tst
deleted file mode 100644
index b4cc95975adb..000000000000
--- a/scripts/rt-tester/t2-l1-pi.tst
+++ /dev/null
@@ -1,77 +0,0 @@
1#
2# RT-Mutex test
3#
4# Op: C(ommand)/T(est)/W(ait)
5# | opcode
6# | | threadid: 0-7
7# | | | opcode argument
8# | | | |
9# C: lock: 0: 0
10#
11# Commands
12#
13# opcode opcode argument
14# schedother nice value
15# schedfifo priority
16# lock lock nr (0-7)
17# locknowait lock nr (0-7)
18# lockint lock nr (0-7)
19# lockintnowait lock nr (0-7)
20# lockcont lock nr (0-7)
21# unlock lock nr (0-7)
22# signal 0
23# reset 0
24# resetevent 0
25#
26# Tests / Wait
27#
28# opcode opcode argument
29#
30# prioeq priority
31# priolt priority
32# priogt priority
33# nprioeq normal priority
34# npriolt normal priority
35# npriogt normal priority
36# locked lock nr (0-7)
37# blocked lock nr (0-7)
38# blockedwake lock nr (0-7)
39# unlocked lock nr (0-7)
40# opcodeeq command opcode or number
41# opcodelt number
42# opcodegt number
43# eventeq number
44# eventgt number
45# eventlt number
46
47#
48# 2 threads 1 lock with priority inversion
49#
50C: resetevent: 0: 0
51W: opcodeeq: 0: 0
52
53# Set schedulers
54C: schedother: 0: 0
55C: schedfifo: 1: 80
56
57# T0 lock L0
58C: locknowait: 0: 0
59W: locked: 0: 0
60
61# T1 lock L0
62C: locknowait: 1: 0
63W: blocked: 1: 0
64T: prioeq: 0: 80
65
66# T0 unlock L0
67C: unlock: 0: 0
68W: locked: 1: 0
69
70# Verify T1
71W: unlocked: 0: 0
72T: priolt: 0: 1
73
74# Unlock and exit
75C: unlock: 1: 0
76W: unlocked: 1: 0
77
diff --git a/scripts/rt-tester/t2-l1-signal.tst b/scripts/rt-tester/t2-l1-signal.tst
deleted file mode 100644
index 1b57376cc1f7..000000000000
--- a/scripts/rt-tester/t2-l1-signal.tst
+++ /dev/null
@@ -1,72 +0,0 @@
1#
2# RT-Mutex test
3#
4# Op: C(ommand)/T(est)/W(ait)
5# | opcode
6# | | threadid: 0-7
7# | | | opcode argument
8# | | | |
9# C: lock: 0: 0
10#
11# Commands
12#
13# opcode opcode argument
14# schedother nice value
15# schedfifo priority
16# lock lock nr (0-7)
17# locknowait lock nr (0-7)
18# lockint lock nr (0-7)
19# lockintnowait lock nr (0-7)
20# lockcont lock nr (0-7)
21# unlock lock nr (0-7)
22# signal 0
23# reset 0
24# resetevent 0
25#
26# Tests / Wait
27#
28# opcode opcode argument
29#
30# prioeq priority
31# priolt priority
32# priogt priority
33# nprioeq normal priority
34# npriolt normal priority
35# npriogt normal priority
36# locked lock nr (0-7)
37# blocked lock nr (0-7)
38# blockedwake lock nr (0-7)
39# unlocked lock nr (0-7)
40# opcodeeq command opcode or number
41# opcodelt number
42# opcodegt number
43# eventeq number
44# eventgt number
45# eventlt number
46
47#
48# 2 threads 1 lock with priority inversion
49#
50C: resetevent: 0: 0
51W: opcodeeq: 0: 0
52
53# Set schedulers
54C: schedother: 0: 0
55C: schedother: 1: 0
56
57# T0 lock L0
58C: locknowait: 0: 0
59W: locked: 0: 0
60
61# T1 lock L0
62C: lockintnowait: 1: 0
63W: blocked: 1: 0
64
65# Interrupt T1
66C: signal: 1: 0
67W: unlocked: 1: 0
68T: opcodeeq: 1: -4
69
70# Unlock and exit
71C: unlock: 0: 0
72W: unlocked: 0: 0
diff --git a/scripts/rt-tester/t2-l2-2rt-deadlock.tst b/scripts/rt-tester/t2-l2-2rt-deadlock.tst
deleted file mode 100644
index 68b10629b6f4..000000000000
--- a/scripts/rt-tester/t2-l2-2rt-deadlock.tst
+++ /dev/null
@@ -1,84 +0,0 @@
1#
2# RT-Mutex test
3#
4# Op: C(ommand)/T(est)/W(ait)
5# | opcode
6# | | threadid: 0-7
7# | | | opcode argument
8# | | | |
9# C: lock: 0: 0
10#
11# Commands
12#
13# opcode opcode argument
14# schedother nice value
15# schedfifo priority
16# lock lock nr (0-7)
17# locknowait lock nr (0-7)
18# lockint lock nr (0-7)
19# lockintnowait lock nr (0-7)
20# lockcont lock nr (0-7)
21# unlock lock nr (0-7)
22# signal 0
23# reset 0
24# resetevent 0
25#
26# Tests / Wait
27#
28# opcode opcode argument
29#
30# prioeq priority
31# priolt priority
32# priogt priority
33# nprioeq normal priority
34# npriolt normal priority
35# npriogt normal priority
36# locked lock nr (0-7)
37# blocked lock nr (0-7)
38# blockedwake lock nr (0-7)
39# unlocked lock nr (0-7)
40# opcodeeq command opcode or number
41# opcodelt number
42# opcodegt number
43# eventeq number
44# eventgt number
45# eventlt number
46
47#
48# 2 threads 2 lock
49#
50C: resetevent: 0: 0
51W: opcodeeq: 0: 0
52
53# Set schedulers
54C: schedfifo: 0: 80
55C: schedfifo: 1: 80
56
57# T0 lock L0
58C: locknowait: 0: 0
59W: locked: 0: 0
60
61# T1 lock L1
62C: locknowait: 1: 1
63W: locked: 1: 1
64
65# T0 lock L1
66C: lockintnowait: 0: 1
67W: blocked: 0: 1
68
69# T1 lock L0
70C: lockintnowait: 1: 0
71W: blocked: 1: 0
72
73# Make deadlock go away
74C: signal: 1: 0
75W: unlocked: 1: 0
76C: signal: 0: 0
77W: unlocked: 0: 1
78
79# Unlock and exit
80C: unlock: 0: 0
81W: unlocked: 0: 0
82C: unlock: 1: 1
83W: unlocked: 1: 1
84
diff --git a/scripts/rt-tester/t3-l1-pi-1rt.tst b/scripts/rt-tester/t3-l1-pi-1rt.tst
deleted file mode 100644
index 8e6c8b11ae56..000000000000
--- a/scripts/rt-tester/t3-l1-pi-1rt.tst
+++ /dev/null
@@ -1,87 +0,0 @@
1#
2# rt-mutex test
3#
4# Op: C(ommand)/T(est)/W(ait)
5# | opcode
6# | | threadid: 0-7
7# | | | opcode argument
8# | | | |
9# C: lock: 0: 0
10#
11# Commands
12#
13# opcode opcode argument
14# schedother nice value
15# schedfifo priority
16# lock lock nr (0-7)
17# locknowait lock nr (0-7)
18# lockint lock nr (0-7)
19# lockintnowait lock nr (0-7)
20# lockcont lock nr (0-7)
21# unlock lock nr (0-7)
22# signal thread to signal (0-7)
23# reset 0
24# resetevent 0
25#
26# Tests / Wait
27#
28# opcode opcode argument
29#
30# prioeq priority
31# priolt priority
32# priogt priority
33# nprioeq normal priority
34# npriolt normal priority
35# npriogt normal priority
36# locked lock nr (0-7)
37# blocked lock nr (0-7)
38# blockedwake lock nr (0-7)
39# unlocked lock nr (0-7)
40# opcodeeq command opcode or number
41# opcodelt number
42# opcodegt number
43# eventeq number
44# eventgt number
45# eventlt number
46
47#
48# 3 threads 1 lock PI
49#
50C: resetevent: 0: 0
51W: opcodeeq: 0: 0
52
53# Set schedulers
54C: schedother: 0: 0
55C: schedother: 1: 0
56C: schedfifo: 2: 82
57
58# T0 lock L0
59C: locknowait: 0: 0
60W: locked: 0: 0
61
62# T1 lock L0
63C: locknowait: 1: 0
64W: blocked: 1: 0
65T: priolt: 0: 1
66
67# T2 lock L0
68C: locknowait: 2: 0
69W: blocked: 2: 0
70T: prioeq: 0: 82
71
72# T0 unlock L0
73C: unlock: 0: 0
74
75# Wait until T2 got the lock
76W: locked: 2: 0
77W: unlocked: 0: 0
78T: priolt: 0: 1
79
80# T2 unlock L0
81C: unlock: 2: 0
82
83W: unlocked: 2: 0
84W: locked: 1: 0
85
86C: unlock: 1: 0
87W: unlocked: 1: 0
diff --git a/scripts/rt-tester/t3-l1-pi-2rt.tst b/scripts/rt-tester/t3-l1-pi-2rt.tst
deleted file mode 100644
index 69c2212fc520..000000000000
--- a/scripts/rt-tester/t3-l1-pi-2rt.tst
+++ /dev/null
@@ -1,88 +0,0 @@
1#
2# rt-mutex test
3#
4# Op: C(ommand)/T(est)/W(ait)
5# | opcode
6# | | threadid: 0-7
7# | | | opcode argument
8# | | | |
9# C: lock: 0: 0
10#
11# Commands
12#
13# opcode opcode argument
14# schedother nice value
15# schedfifo priority
16# lock lock nr (0-7)
17# locknowait lock nr (0-7)
18# lockint lock nr (0-7)
19# lockintnowait lock nr (0-7)
20# lockcont lock nr (0-7)
21# unlock lock nr (0-7)
22# signal thread to signal (0-7)
23# reset 0
24# resetevent 0
25#
26# Tests / Wait
27#
28# opcode opcode argument
29#
30# prioeq priority
31# priolt priority
32# priogt priority
33# nprioeq normal priority
34# npriolt normal priority
35# npriogt normal priority
36# locked lock nr (0-7)
37# blocked lock nr (0-7)
38# blockedwake lock nr (0-7)
39# unlocked lock nr (0-7)
40# opcodeeq command opcode or number
41# opcodelt number
42# opcodegt number
43# eventeq number
44# eventgt number
45# eventlt number
46
47#
48# 3 threads 1 lock PI
49#
50C: resetevent: 0: 0
51W: opcodeeq: 0: 0
52
53# Set schedulers
54C: schedother: 0: 0
55C: schedfifo: 1: 81
56C: schedfifo: 2: 82
57
58# T0 lock L0
59C: locknowait: 0: 0
60W: locked: 0: 0
61
62# T1 lock L0
63C: locknowait: 1: 0
64W: blocked: 1: 0
65T: prioeq: 0: 81
66
67# T2 lock L0
68C: locknowait: 2: 0
69W: blocked: 2: 0
70T: prioeq: 0: 82
71T: prioeq: 1: 81
72
73# T0 unlock L0
74C: unlock: 0: 0
75
76# Wait until T2 got the lock
77W: locked: 2: 0
78W: unlocked: 0: 0
79T: priolt: 0: 1
80
81# T2 unlock L0
82C: unlock: 2: 0
83
84W: unlocked: 2: 0
85W: locked: 1: 0
86
87C: unlock: 1: 0
88W: unlocked: 1: 0
diff --git a/scripts/rt-tester/t3-l1-pi-3rt.tst b/scripts/rt-tester/t3-l1-pi-3rt.tst
deleted file mode 100644
index 9b0f1eb26a88..000000000000
--- a/scripts/rt-tester/t3-l1-pi-3rt.tst
+++ /dev/null
@@ -1,87 +0,0 @@
1#
2# rt-mutex test
3#
4# Op: C(ommand)/T(est)/W(ait)
5# | opcode
6# | | threadid: 0-7
7# | | | opcode argument
8# | | | |
9# C: lock: 0: 0
10#
11# Commands
12#
13# opcode opcode argument
14# schedother nice value
15# schedfifo priority
16# lock lock nr (0-7)
17# locknowait lock nr (0-7)
18# lockint lock nr (0-7)
19# lockintnowait lock nr (0-7)
20# lockcont lock nr (0-7)
21# unlock lock nr (0-7)
22# signal thread to signal (0-7)
23# reset 0
24# resetevent 0
25#
26# Tests / Wait
27#
28# opcode opcode argument
29#
30# prioeq priority
31# priolt priority
32# priogt priority
33# nprioeq normal priority
34# npriolt normal priority
35# npriogt normal priority
36# locked lock nr (0-7)
37# blocked lock nr (0-7)
38# blockedwake lock nr (0-7)
39# unlocked lock nr (0-7)
40# opcodeeq command opcode or number
41# opcodelt number
42# opcodegt number
43# eventeq number
44# eventgt number
45# eventlt number
46
47#
48# 3 threads 1 lock PI
49#
50C: resetevent: 0: 0
51W: opcodeeq: 0: 0
52
53# Set schedulers
54C: schedfifo: 0: 80
55C: schedfifo: 1: 81
56C: schedfifo: 2: 82
57
58# T0 lock L0
59C: locknowait: 0: 0
60W: locked: 0: 0
61
62# T1 lock L0
63C: locknowait: 1: 0
64W: blocked: 1: 0
65T: prioeq: 0: 81
66
67# T2 lock L0
68C: locknowait: 2: 0
69W: blocked: 2: 0
70T: prioeq: 0: 82
71
72# T0 unlock L0
73C: unlock: 0: 0
74
75# Wait until T2 got the lock
76W: locked: 2: 0
77W: unlocked: 0: 0
78T: prioeq: 0: 80
79
80# T2 unlock L0
81C: unlock: 2: 0
82
83W: locked: 1: 0
84W: unlocked: 2: 0
85
86C: unlock: 1: 0
87W: unlocked: 1: 0
diff --git a/scripts/rt-tester/t3-l1-pi-signal.tst b/scripts/rt-tester/t3-l1-pi-signal.tst
deleted file mode 100644
index 39ec74ab06ee..000000000000
--- a/scripts/rt-tester/t3-l1-pi-signal.tst
+++ /dev/null
@@ -1,93 +0,0 @@
1#
2# rt-mutex test
3#
4# Op: C(ommand)/T(est)/W(ait)
5# | opcode
6# | | threadid: 0-7
7# | | | opcode argument
8# | | | |
9# C: lock: 0: 0
10#
11# Commands
12#
13# opcode opcode argument
14# schedother nice value
15# schedfifo priority
16# lock lock nr (0-7)
17# locknowait lock nr (0-7)
18# lockint lock nr (0-7)
19# lockintnowait lock nr (0-7)
20# lockcont lock nr (0-7)
21# unlock lock nr (0-7)
22# signal thread to signal (0-7)
23# reset 0
24# resetevent 0
25#
26# Tests / Wait
27#
28# opcode opcode argument
29#
30# prioeq priority
31# priolt priority
32# priogt priority
33# nprioeq normal priority
34# npriolt normal priority
35# npriogt normal priority
36# locked lock nr (0-7)
37# blocked lock nr (0-7)
38# blockedwake lock nr (0-7)
39# unlocked lock nr (0-7)
40# opcodeeq command opcode or number
41# opcodelt number
42# opcodegt number
43# eventeq number
44# eventgt number
45# eventlt number
46
47# Reset event counter
48C: resetevent: 0: 0
49W: opcodeeq: 0: 0
50
51# Set priorities
52C: schedother: 0: 0
53C: schedfifo: 1: 80
54C: schedfifo: 2: 81
55
56# T0 lock L0
57C: lock: 0: 0
58W: locked: 0: 0
59
60# T1 lock L0, no wait in the wakeup path
61C: locknowait: 1: 0
62W: blocked: 1: 0
63T: prioeq: 0: 80
64T: prioeq: 1: 80
65
66# T2 lock L0 interruptible, no wait in the wakeup path
67C: lockintnowait: 2: 0
68W: blocked: 2: 0
69T: prioeq: 0: 81
70T: prioeq: 1: 80
71
72# Interrupt T2
73C: signal: 2: 2
74W: unlocked: 2: 0
75T: prioeq: 1: 80
76T: prioeq: 0: 80
77
78T: locked: 0: 0
79T: blocked: 1: 0
80
81# T0 unlock L0
82C: unlock: 0: 0
83
84# Wait until T1 has locked L0 and exit
85W: locked: 1: 0
86W: unlocked: 0: 0
87T: priolt: 0: 1
88
89C: unlock: 1: 0
90W: unlocked: 1: 0
91
92
93
diff --git a/scripts/rt-tester/t3-l1-pi-steal.tst b/scripts/rt-tester/t3-l1-pi-steal.tst
deleted file mode 100644
index e03db7e010fa..000000000000
--- a/scripts/rt-tester/t3-l1-pi-steal.tst
+++ /dev/null
@@ -1,91 +0,0 @@
1#
2# rt-mutex test
3#
4# Op: C(ommand)/T(est)/W(ait)
5# | opcode
6# | | threadid: 0-7
7# | | | opcode argument
8# | | | |
9# C: lock: 0: 0
10#
11# Commands
12#
13# opcode opcode argument
14# schedother nice value
15# schedfifo priority
16# lock lock nr (0-7)
17# locknowait lock nr (0-7)
18# lockint lock nr (0-7)
19# lockintnowait lock nr (0-7)
20# lockcont lock nr (0-7)
21# unlock lock nr (0-7)
22# signal thread to signal (0-7)
23# reset 0
24# resetevent 0
25#
26# Tests / Wait
27#
28# opcode opcode argument
29#
30# prioeq priority
31# priolt priority
32# priogt priority
33# nprioeq normal priority
34# npriolt normal priority
35# npriogt normal priority
36# locked lock nr (0-7)
37# blocked lock nr (0-7)
38# blockedwake lock nr (0-7)
39# unlocked lock nr (0-7)
40# opcodeeq command opcode or number
41# opcodelt number
42# opcodegt number
43# eventeq number
44# eventgt number
45# eventlt number
46
47#
48# 3 threads 1 lock PI steal pending ownership
49#
50C: resetevent: 0: 0
51W: opcodeeq: 0: 0
52
53# Set schedulers
54C: schedother: 0: 0
55C: schedfifo: 1: 80
56C: schedfifo: 2: 81
57
58# T0 lock L0
59C: lock: 0: 0
60W: locked: 0: 0
61
62# T1 lock L0
63C: lock: 1: 0
64W: blocked: 1: 0
65T: prioeq: 0: 80
66
67# T0 unlock L0
68C: unlock: 0: 0
69
70# Wait until T1 is in the wakeup loop
71W: blockedwake: 1: 0
72T: priolt: 0: 1
73
74# T2 lock L0
75C: lock: 2: 0
76# T1 leave wakeup loop
77C: lockcont: 1: 0
78
79# T2 must have the lock and T1 must be blocked
80W: locked: 2: 0
81W: blocked: 1: 0
82
83# T2 unlock L0
84C: unlock: 2: 0
85
86# Wait until T1 is in the wakeup loop and let it run
87W: blockedwake: 1: 0
88C: lockcont: 1: 0
89W: locked: 1: 0
90C: unlock: 1: 0
91W: unlocked: 1: 0
diff --git a/scripts/rt-tester/t3-l2-pi.tst b/scripts/rt-tester/t3-l2-pi.tst
deleted file mode 100644
index 7b59100d3e48..000000000000
--- a/scripts/rt-tester/t3-l2-pi.tst
+++ /dev/null
@@ -1,87 +0,0 @@
1#
2# rt-mutex test
3#
4# Op: C(ommand)/T(est)/W(ait)
5# | opcode
6# | | threadid: 0-7
7# | | | opcode argument
8# | | | |
9# C: lock: 0: 0
10#
11# Commands
12#
13# opcode opcode argument
14# schedother nice value
15# schedfifo priority
16# lock lock nr (0-7)
17# locknowait lock nr (0-7)
18# lockint lock nr (0-7)
19# lockintnowait lock nr (0-7)
20# lockcont lock nr (0-7)
21# unlock lock nr (0-7)
22# signal thread to signal (0-7)
23# reset 0
24# resetevent 0
25#
26# Tests / Wait
27#
28# opcode opcode argument
29#
30# prioeq priority
31# priolt priority
32# priogt priority
33# nprioeq normal priority
34# npriolt normal priority
35# npriogt normal priority
36# locked lock nr (0-7)
37# blocked lock nr (0-7)
38# blockedwake lock nr (0-7)
39# unlocked lock nr (0-7)
40# opcodeeq command opcode or number
41# opcodelt number
42# opcodegt number
43# eventeq number
44# eventgt number
45# eventlt number
46
47#
48# 3 threads 2 lock PI
49#
50C: resetevent: 0: 0
51W: opcodeeq: 0: 0
52
53# Set schedulers
54C: schedother: 0: 0
55C: schedother: 1: 0
56C: schedfifo: 2: 82
57
58# T0 lock L0
59C: locknowait: 0: 0
60W: locked: 0: 0
61
62# T1 lock L0
63C: locknowait: 1: 0
64W: blocked: 1: 0
65T: priolt: 0: 1
66
67# T2 lock L0
68C: locknowait: 2: 0
69W: blocked: 2: 0
70T: prioeq: 0: 82
71
72# T0 unlock L0
73C: unlock: 0: 0
74
75# Wait until T2 got the lock
76W: locked: 2: 0
77W: unlocked: 0: 0
78T: priolt: 0: 1
79
80# T2 unlock L0
81C: unlock: 2: 0
82
83W: unlocked: 2: 0
84W: locked: 1: 0
85
86C: unlock: 1: 0
87W: unlocked: 1: 0
diff --git a/scripts/rt-tester/t4-l2-pi-deboost.tst b/scripts/rt-tester/t4-l2-pi-deboost.tst
deleted file mode 100644
index 2f0e049d6443..000000000000
--- a/scripts/rt-tester/t4-l2-pi-deboost.tst
+++ /dev/null
@@ -1,118 +0,0 @@
1#
2# rt-mutex test
3#
4# Op: C(ommand)/T(est)/W(ait)
5# | opcode
6# | | threadid: 0-7
7# | | | opcode argument
8# | | | |
9# C: lock: 0: 0
10#
11# Commands
12#
13# opcode opcode argument
14# schedother nice value
15# schedfifo priority
16# lock lock nr (0-7)
17# locknowait lock nr (0-7)
18# lockint lock nr (0-7)
19# lockintnowait lock nr (0-7)
20# lockcont lock nr (0-7)
21# unlock lock nr (0-7)
22# signal thread to signal (0-7)
23# reset 0
24# resetevent 0
25#
26# Tests / Wait
27#
28# opcode opcode argument
29#
30# prioeq priority
31# priolt priority
32# priogt priority
33# nprioeq normal priority
34# npriolt normal priority
35# npriogt normal priority
36# locked lock nr (0-7)
37# blocked lock nr (0-7)
38# blockedwake lock nr (0-7)
39# unlocked lock nr (0-7)
40# opcodeeq command opcode or number
41# opcodelt number
42# opcodegt number
43# eventeq number
44# eventgt number
45# eventlt number
46
47#
48# 4 threads 2 lock PI
49#
50C: resetevent: 0: 0
51W: opcodeeq: 0: 0
52
53# Set schedulers
54C: schedother: 0: 0
55C: schedother: 1: 0
56C: schedfifo: 2: 82
57C: schedfifo: 3: 83
58
59# T0 lock L0
60C: locknowait: 0: 0
61W: locked: 0: 0
62
63# T1 lock L1
64C: locknowait: 1: 1
65W: locked: 1: 1
66
67# T3 lock L0
68C: lockintnowait: 3: 0
69W: blocked: 3: 0
70T: prioeq: 0: 83
71
72# T0 lock L1
73C: lock: 0: 1
74W: blocked: 0: 1
75T: prioeq: 1: 83
76
77# T1 unlock L1
78C: unlock: 1: 1
79
80# Wait until T0 is in the wakeup code
81W: blockedwake: 0: 1
82
83# Verify that T1 is unboosted
84W: unlocked: 1: 1
85T: priolt: 1: 1
86
87# T2 lock L1 (T0 is boosted and pending owner !)
88C: locknowait: 2: 1
89W: blocked: 2: 1
90T: prioeq: 0: 83
91
92# Interrupt T3 and wait until T3 returned
93C: signal: 3: 0
94W: unlocked: 3: 0
95
96# Verify prio of T0 (still pending owner,
97# but T2 is enqueued due to the previous boost by T3
98T: prioeq: 0: 82
99
100# Let T0 continue
101C: lockcont: 0: 1
102W: locked: 0: 1
103
104# Unlock L1 and let T2 get L1
105C: unlock: 0: 1
106W: locked: 2: 1
107
108# Verify that T0 is unboosted
109W: unlocked: 0: 1
110T: priolt: 0: 1
111
112# Unlock everything and exit
113C: unlock: 2: 1
114W: unlocked: 2: 1
115
116C: unlock: 0: 0
117W: unlocked: 0: 0
118
diff --git a/scripts/rt-tester/t5-l4-pi-boost-deboost-setsched.tst b/scripts/rt-tester/t5-l4-pi-boost-deboost-setsched.tst
deleted file mode 100644
index 04f4034ff895..000000000000
--- a/scripts/rt-tester/t5-l4-pi-boost-deboost-setsched.tst
+++ /dev/null
@@ -1,178 +0,0 @@
1#
2# rt-mutex test
3#
4# Op: C(ommand)/T(est)/W(ait)
5# | opcode
6# | | threadid: 0-7
7# | | | opcode argument
8# | | | |
9# C: lock: 0: 0
10#
11# Commands
12#
13# opcode opcode argument
14# schedother nice value
15# schedfifo priority
16# lock lock nr (0-7)
17# locknowait lock nr (0-7)
18# lockint lock nr (0-7)
19# lockintnowait lock nr (0-7)
20# lockcont lock nr (0-7)
21# unlock lock nr (0-7)
22# signal thread to signal (0-7)
23# reset 0
24# resetevent 0
25#
26# Tests / Wait
27#
28# opcode opcode argument
29#
30# prioeq priority
31# priolt priority
32# priogt priority
33# nprioeq normal priority
34# npriolt normal priority
35# npriogt normal priority
36# locked lock nr (0-7)
37# blocked lock nr (0-7)
38# blockedwake lock nr (0-7)
39# unlocked lock nr (0-7)
40# opcodeeq command opcode or number
41# opcodelt number
42# opcodegt number
43# eventeq number
44# eventgt number
45# eventlt number
46
47#
48# 5 threads 4 lock PI - modify priority of blocked threads
49#
50C: resetevent: 0: 0
51W: opcodeeq: 0: 0
52
53# Set schedulers
54C: schedother: 0: 0
55C: schedfifo: 1: 81
56C: schedfifo: 2: 82
57C: schedfifo: 3: 83
58C: schedfifo: 4: 84
59
60# T0 lock L0
61C: locknowait: 0: 0
62W: locked: 0: 0
63
64# T1 lock L1
65C: locknowait: 1: 1
66W: locked: 1: 1
67
68# T1 lock L0
69C: lockintnowait: 1: 0
70W: blocked: 1: 0
71T: prioeq: 0: 81
72
73# T2 lock L2
74C: locknowait: 2: 2
75W: locked: 2: 2
76
77# T2 lock L1
78C: lockintnowait: 2: 1
79W: blocked: 2: 1
80T: prioeq: 0: 82
81T: prioeq: 1: 82
82
83# T3 lock L3
84C: locknowait: 3: 3
85W: locked: 3: 3
86
87# T3 lock L2
88C: lockintnowait: 3: 2
89W: blocked: 3: 2
90T: prioeq: 0: 83
91T: prioeq: 1: 83
92T: prioeq: 2: 83
93
94# T4 lock L3
95C: lockintnowait: 4: 3
96W: blocked: 4: 3
97T: prioeq: 0: 84
98T: prioeq: 1: 84
99T: prioeq: 2: 84
100T: prioeq: 3: 84
101
102# Reduce prio of T4
103C: schedfifo: 4: 80
104T: prioeq: 0: 83
105T: prioeq: 1: 83
106T: prioeq: 2: 83
107T: prioeq: 3: 83
108T: prioeq: 4: 80
109
110# Increase prio of T4
111C: schedfifo: 4: 84
112T: prioeq: 0: 84
113T: prioeq: 1: 84
114T: prioeq: 2: 84
115T: prioeq: 3: 84
116T: prioeq: 4: 84
117
118# Reduce prio of T3
119C: schedfifo: 3: 80
120T: prioeq: 0: 84
121T: prioeq: 1: 84
122T: prioeq: 2: 84
123T: prioeq: 3: 84
124T: prioeq: 4: 84
125
126# Increase prio of T3
127C: schedfifo: 3: 85
128T: prioeq: 0: 85
129T: prioeq: 1: 85
130T: prioeq: 2: 85
131T: prioeq: 3: 85
132T: prioeq: 4: 84
133
134# Reduce prio of T3
135C: schedfifo: 3: 83
136T: prioeq: 0: 84
137T: prioeq: 1: 84
138T: prioeq: 2: 84
139T: prioeq: 3: 84
140T: prioeq: 4: 84
141
142# Signal T4
143C: signal: 4: 0
144W: unlocked: 4: 3
145T: prioeq: 0: 83
146T: prioeq: 1: 83
147T: prioeq: 2: 83
148T: prioeq: 3: 83
149
150# Signal T3
151C: signal: 3: 0
152W: unlocked: 3: 2
153T: prioeq: 0: 82
154T: prioeq: 1: 82
155T: prioeq: 2: 82
156
157# Signal T2
158C: signal: 2: 0
159W: unlocked: 2: 1
160T: prioeq: 0: 81
161T: prioeq: 1: 81
162
163# Signal T1
164C: signal: 1: 0
165W: unlocked: 1: 0
166T: priolt: 0: 1
167
168# Unlock and exit
169C: unlock: 3: 3
170C: unlock: 2: 2
171C: unlock: 1: 1
172C: unlock: 0: 0
173
174W: unlocked: 3: 3
175W: unlocked: 2: 2
176W: unlocked: 1: 1
177W: unlocked: 0: 0
178
diff --git a/scripts/rt-tester/t5-l4-pi-boost-deboost.tst b/scripts/rt-tester/t5-l4-pi-boost-deboost.tst
deleted file mode 100644
index a48a6ee29ddc..000000000000
--- a/scripts/rt-tester/t5-l4-pi-boost-deboost.tst
+++ /dev/null
@@ -1,138 +0,0 @@
1#
2# rt-mutex test
3#
4# Op: C(ommand)/T(est)/W(ait)
5# | opcode
6# | | threadid: 0-7
7# | | | opcode argument
8# | | | |
9# C: lock: 0: 0
10#
11# Commands
12#
13# opcode opcode argument
14# schedother nice value
15# schedfifo priority
16# lock lock nr (0-7)
17# locknowait lock nr (0-7)
18# lockint lock nr (0-7)
19# lockintnowait lock nr (0-7)
20# lockcont lock nr (0-7)
21# unlock lock nr (0-7)
22# signal thread to signal (0-7)
23# reset 0
24# resetevent 0
25#
26# Tests / Wait
27#
28# opcode opcode argument
29#
30# prioeq priority
31# priolt priority
32# priogt priority
33# nprioeq normal priority
34# npriolt normal priority
35# npriogt normal priority
36# locked lock nr (0-7)
37# blocked lock nr (0-7)
38# blockedwake lock nr (0-7)
39# unlocked lock nr (0-7)
40# opcodeeq command opcode or number
41# opcodelt number
42# opcodegt number
43# eventeq number
44# eventgt number
45# eventlt number
46
47#
48# 5 threads 4 lock PI
49#
50C: resetevent: 0: 0
51W: opcodeeq: 0: 0
52
53# Set schedulers
54C: schedother: 0: 0
55C: schedfifo: 1: 81
56C: schedfifo: 2: 82
57C: schedfifo: 3: 83
58C: schedfifo: 4: 84
59
60# T0 lock L0
61C: locknowait: 0: 0
62W: locked: 0: 0
63
64# T1 lock L1
65C: locknowait: 1: 1
66W: locked: 1: 1
67
68# T1 lock L0
69C: lockintnowait: 1: 0
70W: blocked: 1: 0
71T: prioeq: 0: 81
72
73# T2 lock L2
74C: locknowait: 2: 2
75W: locked: 2: 2
76
77# T2 lock L1
78C: lockintnowait: 2: 1
79W: blocked: 2: 1
80T: prioeq: 0: 82
81T: prioeq: 1: 82
82
83# T3 lock L3
84C: locknowait: 3: 3
85W: locked: 3: 3
86
87# T3 lock L2
88C: lockintnowait: 3: 2
89W: blocked: 3: 2
90T: prioeq: 0: 83
91T: prioeq: 1: 83
92T: prioeq: 2: 83
93
94# T4 lock L3
95C: lockintnowait: 4: 3
96W: blocked: 4: 3
97T: prioeq: 0: 84
98T: prioeq: 1: 84
99T: prioeq: 2: 84
100T: prioeq: 3: 84
101
102# Signal T4
103C: signal: 4: 0
104W: unlocked: 4: 3
105T: prioeq: 0: 83
106T: prioeq: 1: 83
107T: prioeq: 2: 83
108T: prioeq: 3: 83
109
110# Signal T3
111C: signal: 3: 0
112W: unlocked: 3: 2
113T: prioeq: 0: 82
114T: prioeq: 1: 82
115T: prioeq: 2: 82
116
117# Signal T2
118C: signal: 2: 0
119W: unlocked: 2: 1
120T: prioeq: 0: 81
121T: prioeq: 1: 81
122
123# Signal T1
124C: signal: 1: 0
125W: unlocked: 1: 0
126T: priolt: 0: 1
127
128# Unlock and exit
129C: unlock: 3: 3
130C: unlock: 2: 2
131C: unlock: 1: 1
132C: unlock: 0: 0
133
134W: unlocked: 3: 3
135W: unlocked: 2: 2
136W: unlocked: 1: 1
137W: unlocked: 0: 0
138