diff options
author | Andrea Bastoni <bastoni@cs.unc.edu> | 2010-04-12 23:27:51 -0400 |
---|---|---|
committer | Andrea Bastoni <bastoni@cs.unc.edu> | 2010-04-12 23:27:51 -0400 |
commit | 269025c216e4245f2b10927630130db89fddf4c8 (patch) | |
tree | 49f513db666af952d38cdfda6d7ae2c6de6f4f82 | |
parent | 4538f7e4fcaa3bf199377b9b735562e53cd1c7d3 (diff) |
Add various test scripts
- also useful for normal debugging, not just PM
-rw-r--r-- | scripts/README | 24 | ||||
-rwxr-xr-x | scripts/pm_test_script | 79 | ||||
-rwxr-xr-x | scripts/pm_test_single_taskset | 12 | ||||
-rwxr-xr-x | scripts/pm_test_single_taskset_mtimes_long | 8 | ||||
-rwxr-xr-x | scripts/pm_test_single_taskset_mtimes_short | 8 | ||||
-rwxr-xr-x | scripts/test_find | 15 | ||||
-rw-r--r-- | scripts/test_get_arrays.py | 26 | ||||
-rw-r--r-- | scripts/uni1_050_0.ts | 50 | ||||
-rw-r--r-- | scripts/uni1_050_0.ts-psn-edf | 50 |
9 files changed, 272 insertions, 0 deletions
diff --git a/scripts/README b/scripts/README new file mode 100644 index 0000000..915df06 --- /dev/null +++ b/scripts/README | |||
@@ -0,0 +1,24 @@ | |||
1 | This directory contains some scripts used for bug hunting, general testing | ||
2 | of Litmus and LibLitmus, Preemption and Migration overhead measurements etc. | ||
3 | |||
4 | When you add a script, please also add a brief description of the script here. | ||
5 | |||
6 | pm_test_script: | ||
7 | main preemption and migration testing script; can iterate on | ||
8 | multiple WSS and multiple plugins. Some assumtion on filenames and | ||
9 | taskset filenames are made. More information direcly in the script. | ||
10 | |||
11 | pm_test_single_taskset*: | ||
12 | preemption and migration test scripts. Mainly for debugging / bug hunting | ||
13 | |||
14 | test_find: | ||
15 | test script which spawns "find" tasks (which suspend frequently). | ||
16 | Mainly for debugging / bug hunting | ||
17 | |||
18 | uni1_050_0.ts: | ||
19 | taskset used by pm_test_single_taskset* and test_find (this ts is one of the | ||
20 | smallest ts used by John and Bjoern for preemption and migration evaluation | ||
21 | on Niagara | ||
22 | |||
23 | test_get_arrays.py: | ||
24 | simple python test to verify C to Python PM interface | ||
diff --git a/scripts/pm_test_script b/scripts/pm_test_script new file mode 100755 index 0000000..c76947b --- /dev/null +++ b/scripts/pm_test_script | |||
@@ -0,0 +1,79 @@ | |||
1 | #!/bin/bash | ||
2 | # | ||
3 | # pm_test_script: | ||
4 | # Batch script for running (all?) pm benchmarking experiments. | ||
5 | # Run it as root! | ||
6 | # | ||
7 | # Original script by John Calandrino 2008 | ||
8 | # Changes by Andrea Bastoni 2010 | ||
9 | # | ||
10 | # Distribution A can be in "PFAIR" "GSN-EDF" "C-EDF" "PSN-EDF"; | ||
11 | |||
12 | launchpolluter() | ||
13 | { | ||
14 | NCPU=`cat /sys/devices/system/cpu/present | cut -d - -f 2` | ||
15 | |||
16 | for i in `seq 0 $NCPU`; | ||
17 | do | ||
18 | taskset -pc $i ./pm_polluter & | ||
19 | done | ||
20 | } | ||
21 | |||
22 | run_taskset() | ||
23 | { | ||
24 | rm -f curr_taskset | ||
25 | cat $1 | sed "s/task //" | sed "s/\#.*//" | sed "/^$/d" >> curr_taskset | ||
26 | # Read task set from some source and start all tasks. | ||
27 | TASK=0 | ||
28 | while read inputline; | ||
29 | do | ||
30 | e=`echo $inputline | awk -F' ' '{print $1}'` | ||
31 | p=`echo $inputline | awk -F' ' '{print $2}'` | ||
32 | ./rt_launch -w $e $p ./pm_task "./$2/res_plugin=`expr $A`_wss=`expr $W`_tss=`expr $X`_`expr $Y`_`expr $TASK`.raw" | ||
33 | TASK=`expr $TASK + 1` | ||
34 | done < ./curr_taskset | ||
35 | echo "($A, $W, $X, $Y)" | ||
36 | # try to see if this solves the problem of the task which is not released at every run | ||
37 | # speculation: not properly set up when release put it in the queue | ||
38 | sleep 5 | ||
39 | ./release_ts -d 3000 | ||
40 | # launchpolluter | ||
41 | # Sleep for 150 seconds. This includes ~60 seconds | ||
42 | # of run time followed by 90 seconds of "tear down" time. (to save files) | ||
43 | # NOTE: may need to sleep longer than this... | ||
44 | sleep 150 | ||
45 | sync | ||
46 | # killall pm_be_polluter | ||
47 | # sleep 2 | ||
48 | killall pm_task | ||
49 | sleep 1 | ||
50 | killall rt_launch | ||
51 | } | ||
52 | |||
53 | for A in "GSN-EDF"; | ||
54 | do | ||
55 | echo "Setting plugin $A..." | ||
56 | ./setsched $A | ||
57 | sleep 1 | ||
58 | |||
59 | for W in 1024; | ||
60 | do | ||
61 | echo "Experiments for WSS of `expr $W`KB" | ||
62 | scons ARCH=x86_64 WSS=$W | ||
63 | sleep 1 | ||
64 | |||
65 | SET1=$(echo `seq 10 10 40`) | ||
66 | SET2=$(echo `seq 50 25 125`) | ||
67 | SET3=$(echo `seq 150 50 250`) | ||
68 | for X in $SET1 $SET2 $SET3; # Number of tasks | ||
69 | do | ||
70 | for Y in `seq 0 9`; # Taskset number | ||
71 | do | ||
72 | run_taskset "`expr ../$A`-ts/ts-uni_light-`expr $X`-`expr $Y`.ts" "pm_raw_results" | ||
73 | done | ||
74 | done | ||
75 | done | ||
76 | DATE=`date +%Y%m%d-%H%M` | ||
77 | mkdir pm_raw_results/$DATE | ||
78 | mv pm_raw_results/*.raw pm_raw_results/$DATE | ||
79 | done | ||
diff --git a/scripts/pm_test_single_taskset b/scripts/pm_test_single_taskset new file mode 100755 index 0000000..232dc3b --- /dev/null +++ b/scripts/pm_test_single_taskset | |||
@@ -0,0 +1,12 @@ | |||
1 | #!/bin/bash | ||
2 | rm -f res-*.bin | ||
3 | TASK=0 | ||
4 | while read inputline; | ||
5 | do | ||
6 | e=`echo $inputline | awk -F' ' '{print $1}'` | ||
7 | p=`echo $inputline | awk -F' ' '{print $2}'` | ||
8 | c=`echo $inputline | awk -F' ' '{print $3}'` | ||
9 | ./rt_launch -w $e $p -p $c ./pm_task ./res-$TASK.bin | ||
10 | TASK=`expr $TASK + 1` | ||
11 | done < uni1_050_0.ts | ||
12 | ./release_ts -d 5000 | ||
diff --git a/scripts/pm_test_single_taskset_mtimes_long b/scripts/pm_test_single_taskset_mtimes_long new file mode 100755 index 0000000..1b8100d --- /dev/null +++ b/scripts/pm_test_single_taskset_mtimes_long | |||
@@ -0,0 +1,8 @@ | |||
1 | #!/bin/bash | ||
2 | for i in `seq 0 200` ; do | ||
3 | echo -n "$i) "; | ||
4 | ./test_single_taskset ; | ||
5 | sleep 100; | ||
6 | cat res-*.bin >> result-all-$i.bin | ||
7 | done | ||
8 | |||
diff --git a/scripts/pm_test_single_taskset_mtimes_short b/scripts/pm_test_single_taskset_mtimes_short new file mode 100755 index 0000000..0ae2093 --- /dev/null +++ b/scripts/pm_test_single_taskset_mtimes_short | |||
@@ -0,0 +1,8 @@ | |||
1 | #!/bin/bash | ||
2 | for i in `seq 0 100` ; do | ||
3 | echo -n "$i) "; | ||
4 | ./test_single_taskset ; | ||
5 | sleep 20; | ||
6 | cat res-*.bin >> result-all-$i.bin | ||
7 | done | ||
8 | |||
diff --git a/scripts/test_find b/scripts/test_find new file mode 100755 index 0000000..003cbb4 --- /dev/null +++ b/scripts/test_find | |||
@@ -0,0 +1,15 @@ | |||
1 | #!/bin/bash | ||
2 | # | ||
3 | # test_find: stress test with lot of suspending tasks | ||
4 | # main purpose: bug hunting | ||
5 | |||
6 | TASK=0 | ||
7 | while read inputline; | ||
8 | do | ||
9 | e=`echo $inputline | awk -F' ' '{print $1}'` | ||
10 | p=`echo $inputline | awk -F' ' '{print $2}'` | ||
11 | c=`echo $inputline | awk -F' ' '{print $3}'` | ||
12 | ./rt_launch -w $e $p -p $c find / | ||
13 | TASK=`expr $TASK + 1` | ||
14 | done < uni1_050_0.ts-psn-edf | ||
15 | ./release_ts -d 5000 | ||
diff --git a/scripts/test_get_arrays.py b/scripts/test_get_arrays.py new file mode 100644 index 0000000..cfe9fa7 --- /dev/null +++ b/scripts/test_get_arrays.py | |||
@@ -0,0 +1,26 @@ | |||
1 | #!/usr/bin/python | ||
2 | # | ||
3 | # test_get_arrays: test program to verify and test C to Python pm interface | ||
4 | # | ||
5 | # recall: PYTHONPATH=".." python test_get_arrays.py :) | ||
6 | # | ||
7 | import sys, pm | ||
8 | |||
9 | args = sys.argv[1:] | ||
10 | if len(args) != 1: | ||
11 | print "Filename required" | ||
12 | sys.exit(-1) | ||
13 | |||
14 | pm.load(args[0],0,4) | ||
15 | x = pm.getPreemption() | ||
16 | y = pm.getOnChipMigration() | ||
17 | z = pm.getL2Migration() | ||
18 | w = pm.getOffChipMigration() | ||
19 | print "preemption: " | ||
20 | print x | ||
21 | print "samechip:" | ||
22 | print y | ||
23 | print "l2:" | ||
24 | print z | ||
25 | print "offchip" | ||
26 | print w | ||
diff --git a/scripts/uni1_050_0.ts b/scripts/uni1_050_0.ts new file mode 100644 index 0000000..b6768d8 --- /dev/null +++ b/scripts/uni1_050_0.ts | |||
@@ -0,0 +1,50 @@ | |||
1 | 7 75 0 | ||
2 | 2 34 0 | ||
3 | 1 78 0 | ||
4 | 7 86 0 | ||
5 | 1 22 0 | ||
6 | 1 12 0 | ||
7 | 3 63 0 | ||
8 | 4 37 0 | ||
9 | 8 89 0 | ||
10 | 4 58 0 | ||
11 | 1 50 0 | ||
12 | 6 52 0 | ||
13 | 4 68 0 | ||
14 | 3 80 0 | ||
15 | 4 49 0 | ||
16 | 1 30 0 | ||
17 | 2 63 0 | ||
18 | 1 14 0 | ||
19 | 1 12 0 | ||
20 | 2 61 0 | ||
21 | 4 58 0 | ||
22 | 1 41 0 | ||
23 | 6 53 0 | ||
24 | 4 37 0 | ||
25 | 8 99 0 | ||
26 | 1 33 0 | ||
27 | 1 79 0 | ||
28 | 7 75 0 | ||
29 | 1 27 0 | ||
30 | 3 38 0 | ||
31 | 3 54 0 | ||
32 | 2 24 0 | ||
33 | 1 32 0 | ||
34 | 1 82 0 | ||
35 | 6 79 0 | ||
36 | 4 48 0 | ||
37 | 3 65 0 | ||
38 | 7 83 0 | ||
39 | 2 95 0 | ||
40 | 2 13 0 | ||
41 | 1 21 0 | ||
42 | 4 78 0 | ||
43 | 3 65 0 | ||
44 | 6 97 0 | ||
45 | 2 92 0 | ||
46 | 4 37 0 | ||
47 | 1 67 0 | ||
48 | 7 93 0 | ||
49 | 3 57 0 | ||
50 | 2 71 0 | ||
diff --git a/scripts/uni1_050_0.ts-psn-edf b/scripts/uni1_050_0.ts-psn-edf new file mode 100644 index 0000000..d4bd8e0 --- /dev/null +++ b/scripts/uni1_050_0.ts-psn-edf | |||
@@ -0,0 +1,50 @@ | |||
1 | 7 75 0 | ||
2 | 2 34 1 | ||
3 | 1 78 2 | ||
4 | 7 86 3 | ||
5 | 1 22 4 | ||
6 | 1 12 5 | ||
7 | 3 63 6 | ||
8 | 4 37 7 | ||
9 | 8 89 0 | ||
10 | 4 58 1 | ||
11 | 1 50 2 | ||
12 | 6 52 3 | ||
13 | 4 68 4 | ||
14 | 3 80 5 | ||
15 | 4 49 6 | ||
16 | 1 30 7 | ||
17 | 2 63 0 | ||
18 | 1 14 1 | ||
19 | 1 12 2 | ||
20 | 2 61 3 | ||
21 | 4 58 4 | ||
22 | 1 41 5 | ||
23 | 6 53 6 | ||
24 | 4 37 7 | ||
25 | 8 99 0 | ||
26 | 1 33 1 | ||
27 | 1 79 2 | ||
28 | 7 75 3 | ||
29 | 1 27 4 | ||
30 | 3 38 5 | ||
31 | 3 54 6 | ||
32 | 2 24 7 | ||
33 | 1 32 0 | ||
34 | 1 82 1 | ||
35 | 6 79 2 | ||
36 | 4 48 3 | ||
37 | 3 65 4 | ||
38 | 7 83 5 | ||
39 | 2 95 6 | ||
40 | 2 13 7 | ||
41 | 1 21 0 | ||
42 | 4 78 1 | ||
43 | 3 65 2 | ||
44 | 6 97 3 | ||
45 | 2 92 4 | ||
46 | 4 37 5 | ||
47 | 1 67 6 | ||
48 | 7 93 7 | ||
49 | 3 57 0 | ||
50 | 2 71 1 | ||