summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMac Mollison <mollison@cs.unc.edu>2009-03-19 01:41:39 -0400
committerMac Mollison <mollison@cs.unc.edu>2009-03-19 01:41:39 -0400
commit42174e7384ef799d8473074eedffdb8108a145c7 (patch)
treee7d1ed968d824b1fe8d96a518c736ad3af26c267
parent8e45212798dd3797c08850a613690e586afe8ae6 (diff)
More very basic work on test driver
-rw-r--r--test_driver/make_devices18
-rw-r--r--test_driver/test.py27
2 files changed, 43 insertions, 2 deletions
diff --git a/test_driver/make_devices b/test_driver/make_devices
new file mode 100644
index 0000000..4d4554b
--- /dev/null
+++ b/test_driver/make_devices
@@ -0,0 +1,18 @@
1#!/bin/bash
2
3#Creates device drivers for traces (litmus_log, ft_trace and sched_trace)
4#Taken from http://www.cs.unc.edu/~anderson/litmus-rt/doc/tracing.html
5
6LITMUS_LOG_MAJOR=`grep litmus_log /proc/devices | awk '{print $1}'`
7FT_TRACE_MAJOR=`grep ft_trace /proc/devices | awk '{print $1}'`
8SCHED_TRACE_MAJOR=`grep sched_trace /proc/devices | awk '{print $1}'`
9
10mknod litmus_log c $LITMUS_LOG_MAJOR 0
11mknod ft_trace c $FT_TRACE_MAJOR 0
12
13NUM_PROCS=$((`grep 'processor' /proc/cpuinfo | wc -l` - 1))
14
15for P in `seq 0 $NUM_PROCS`
16do
17 mknod "sched_trace$P" c $SCHED_TRACE_MAJOR $P
18done
diff --git a/test_driver/test.py b/test_driver/test.py
index edd55ee..236f52e 100644
--- a/test_driver/test.py
+++ b/test_driver/test.py
@@ -3,10 +3,14 @@
3########## 3##########
4 4
5#liblitmus directory 5#liblitmus directory
6liblitmus_dir = '/root/liblitmus' 6liblitmus_dir = '/root/liblitmus/'
7 7
8#ft_trace directory 8#ft_trace directory
9ft_trace_dir = '/root/ft_trace' 9ft_trace_dir = '/root/ft_trace/'
10
11#device files directory
12#You should put the make_devices program into this directory, and chmod +x it.
13device_dir = '/root/device_files/'
10 14
11#desired scheduling policy 15#desired scheduling policy
12#options listed in /proc/litmus/plugins 16#options listed in /proc/litmus/plugins
@@ -29,6 +33,25 @@ def main():
29 #Set scheduling policy 33 #Set scheduling policy
30 os.system('cat ' + policy + ' > ' + '/proc/litmus/active_policy') 34 os.system('cat ' + policy + ' > ' + '/proc/litmus/active_policy')
31 35
36 #Setup the device files for the traces
37 os.system(device_dir + 'make_devices')
38
39 #Set up environment variables needed for st_trace script
40 os.system('FTCAT=' + ft_trace_dir + 'ftcat')
41 os.system('FTDEV=' + device_dir)
42 os.system('export FTCAT')
43 os.system('export FTDEV')
44
45 #Current steps...
46 #Run st_trace
47 #Let it get set up, then suspend
48 #let it run in background with bg <job>
49 #Run rtspin 10 100 1000 twice; suspend, run in background
50 #Bring rtspins to foreground and stop them.
51 #Bring st_trace to foreground, hit enter to complete it.
52
53 #Need to try to do the above with rt_launch and then release_ts
54
32 55
33 56
34############## 57##############