diff options
author | Bjoern B. Brandenburg <bbb@cs.unc.edu> | 2009-02-22 00:41:36 -0500 |
---|---|---|
committer | Bjoern B. Brandenburg <bbb@cs.unc.edu> | 2009-02-22 00:41:36 -0500 |
commit | be610af3ec405f0dbaa4eec3bf94905268b8b392 (patch) | |
tree | a1cbe6dc1fe12cfce68254d1a969e4ff5df8cc36 | |
parent | 65fa321d63cfd3a38309b7ec8907df5c4a8d26b6 (diff) |
remove old bash cruft
-rwxr-xr-x | plot_ecrts | 121 | ||||
-rwxr-xr-x | plot_scatter | 125 | ||||
-rwxr-xr-x | plot_sched | 178 |
3 files changed, 0 insertions, 424 deletions
diff --git a/plot_ecrts b/plot_ecrts deleted file mode 100755 index fd76b22..0000000 --- a/plot_ecrts +++ /dev/null | |||
@@ -1,121 +0,0 @@ | |||
1 | #!/bin/bash | ||
2 | |||
3 | |||
4 | EPS_FLAG= | ||
5 | |||
6 | while true; do | ||
7 | case $1 in | ||
8 | --eps) | ||
9 | shift | ||
10 | EPS_FLAG="--eps" | ||
11 | ;; | ||
12 | *) | ||
13 | break | ||
14 | ;; | ||
15 | esac | ||
16 | done | ||
17 | |||
18 | PLOTTER="plot_scatter $EPS_FLAG --lines " | ||
19 | |||
20 | function get_tmp_file { | ||
21 | OS=`uname` | ||
22 | if [ $OS == "Linux" ] | ||
23 | then | ||
24 | mktemp | ||
25 | else # Darwin | ||
26 | mktemp -t ecrts | ||
27 | fi | ||
28 | } | ||
29 | |||
30 | function get_val { | ||
31 | echo "$1" | sed 's/.*=//g' | ||
32 | } | ||
33 | |||
34 | function plot_file { | ||
35 | SCHED="G-EDF" | ||
36 | FILE=$1 | ||
37 | NAME=`basename $FILE | sed -e 's/.csv//g'` | ||
38 | STRIPPED=`get_tmp_file` | ||
39 | # remove comments for Gnuplot | ||
40 | egrep -v '^#' $FILE > $STRIPPED | ||
41 | if [ ! -s $STRIPPED ] | ||
42 | then | ||
43 | echo "Skipping $FILE since there wasn't any data to be found. " | ||
44 | return | ||
45 | fi | ||
46 | # decode file name | ||
47 | PARAMS= | ||
48 | for KV in `echo $NAME | sed -e 's/_/ /g'` | ||
49 | do | ||
50 | case $KV in | ||
51 | pedf) | ||
52 | SCHED="P-EDF" | ||
53 | ;; | ||
54 | gedf) | ||
55 | SCHED="G-EDF" | ||
56 | ;; | ||
57 | hard) | ||
58 | TEST="hard" | ||
59 | ;; | ||
60 | soft) | ||
61 | TEST="soft" | ||
62 | ;; | ||
63 | axis*) | ||
64 | AXIS=`get_val $KV` | ||
65 | ;; | ||
66 | rmax*|rmin*|wmax*|wmin*) | ||
67 | # ignored, not shown | ||
68 | ;; | ||
69 | *) | ||
70 | PARAMS="$PARAMS $KV" | ||
71 | ;; | ||
72 | esac | ||
73 | done | ||
74 | YRANGE=" --yrange -0.05 1.05 --yticks 0 0.1" | ||
75 | case $AXIS in | ||
76 | ucap) | ||
77 | XRANGE="--xrange 0.5 32.5 --xticks 0 2" | ||
78 | XRANGE="--xrange 0.5 22.5 --xticks 0 2" | ||
79 | if [ "$SCHED" == "G-EDF" ] && [ "$TEST" == "hard" ] | ||
80 | then | ||
81 | XRANGE="--xrange 0.5 14.5 --xticks 0 1" | ||
82 | fi | ||
83 | AXIS_LABEL="task set utilization (prior to inflation)" | ||
84 | ;; | ||
85 | res) | ||
86 | XRANGE="--xrange 0 5.05 --xticks 0 1" | ||
87 | AXIS_LABEL="average number of resources per task" | ||
88 | ;; | ||
89 | nest) | ||
90 | XRANGE="--xrange 0 0.505 --xticks 0 0.1" | ||
91 | AXIS_LABEL="probability of nested requests" | ||
92 | ;; | ||
93 | contention) | ||
94 | XRANGE="--xrange 45 555 --xticks 0 50" | ||
95 | AXIS_LABEL="requests per resource per second" | ||
96 | ;; | ||
97 | wratio) | ||
98 | XRANGE="--xrange 0 0.505 --xticks 0 0.1" | ||
99 | AXIS_LABEL="ratio of write requests" | ||
100 | ;; | ||
101 | *) | ||
102 | echo "Unkown axis: $AXIS." | ||
103 | AXIS_LABEL="$AXIS" | ||
104 | ;; | ||
105 | esac | ||
106 | TITLE="$TEST schedulability under $SCHED with$PARAMS" | ||
107 | RANGE="$XRANGE $YRANGE" | ||
108 | $PLOTTER $RANGE "$NAME" "$AXIS_LABEL" "ratio of schedulable task sets" "$TITLE" \ | ||
109 | $STRIPPED 1 2 "task-fair mutex" \ | ||
110 | $STRIPPED 1 3 "task-fair RW" \ | ||
111 | $STRIPPED 1 4 "phase-fair RW" | ||
112 | rm $STRIPPED | ||
113 | } | ||
114 | |||
115 | |||
116 | while [ ! -z "$1" ] | ||
117 | do | ||
118 | echo "Plotting $1..." | ||
119 | plot_file $1 | ||
120 | shift | ||
121 | done | ||
diff --git a/plot_scatter b/plot_scatter deleted file mode 100755 index de709f3..0000000 --- a/plot_scatter +++ /dev/null | |||
@@ -1,125 +0,0 @@ | |||
1 | #!/bin/bash | ||
2 | |||
3 | #NICE="blacktext linewidth 4.0 \"Helvetica\" 16 " | ||
4 | |||
5 | # try thinner lines | ||
6 | NICE="color blacktext solid linewidth 1.0 \"Helvetica\" 20 size 16cm,7cm" | ||
7 | |||
8 | EXT="png" | ||
9 | TERMINAL="png size 1024,768 large" | ||
10 | |||
11 | GRAPH=points | ||
12 | XTRA= | ||
13 | while true; do | ||
14 | case $1 in | ||
15 | --eps) | ||
16 | shift | ||
17 | EXT="eps" | ||
18 | TERMINAL="postscript eps $NICE" | ||
19 | ;; | ||
20 | --lines) | ||
21 | shift | ||
22 | GRAPH=lines | ||
23 | ;; | ||
24 | --xrange) | ||
25 | shift | ||
26 | XRANGE="set xrange [$1:$2]" | ||
27 | shift | ||
28 | shift | ||
29 | ;; | ||
30 | --xticks) | ||
31 | shift | ||
32 | XTICKS="set xtics $1, $2" | ||
33 | shift | ||
34 | shift | ||
35 | ;; | ||
36 | --yrange) | ||
37 | shift | ||
38 | YRANGE="set yrange [$1:$2]" | ||
39 | shift | ||
40 | shift | ||
41 | ;; | ||
42 | --yticks) | ||
43 | shift | ||
44 | YTICKS="set ytics $1, $2" | ||
45 | shift | ||
46 | shift | ||
47 | ;; | ||
48 | --extra) | ||
49 | shift | ||
50 | XTRA="$1" | ||
51 | ;; | ||
52 | --linespoints) | ||
53 | shift | ||
54 | GRAPH=linespoints | ||
55 | ;; | ||
56 | --*) | ||
57 | echo "unrecognized option: $1" | ||
58 | exit 1 | ||
59 | ;; | ||
60 | *) | ||
61 | break | ||
62 | ;; | ||
63 | esac | ||
64 | done | ||
65 | |||
66 | |||
67 | OUT=$1 | ||
68 | XLABEL=$2 | ||
69 | YLABEL=$3 | ||
70 | TITLE=$4 | ||
71 | shift 4 | ||
72 | |||
73 | PLOT="plot " | ||
74 | |||
75 | |||
76 | while [ ! -z "$1" ] && [ ! -z "$2" ] && [ ! -z "$3" ] && [ ! -z "$4" ]; do | ||
77 | CSV=$1 | ||
78 | COL1=$2 | ||
79 | COL2=$3 | ||
80 | NAME=$4 | ||
81 | PLOT="$PLOT '${CSV}' using ${COL1}:${COL2} title '${NAME}' with $GRAPH" | ||
82 | shift 4 | ||
83 | if [ ! -z "$1" ]; then | ||
84 | PLOT="$PLOT, " | ||
85 | fi | ||
86 | # fixup csv file, gnuplot is picky | ||
87 | sed -i -e 's/,\([^ ]\)/, \1/g' "$CSV" | ||
88 | done | ||
89 | |||
90 | #echo $OUT | ||
91 | #echo $XLABEL | ||
92 | #echo $YLABEL | ||
93 | #echo $TITLE | ||
94 | #echo $PLOT | ||
95 | |||
96 | if [ "$PLOT" = "plot " ]; then | ||
97 | echo "Usage: $0 [--eps] <outfile> <X label> <Y label> <title> "\ | ||
98 | "(<csv file> <column1> <column2> <label>)+" | ||
99 | exit 1 | ||
100 | fi | ||
101 | |||
102 | OUT="${OUT}.${EXT}" | ||
103 | KEY="set key below" | ||
104 | KEY="set key off" | ||
105 | gnuplot <<EOM | ||
106 | set terminal $TERMINAL | ||
107 | set out '/dev/null' | ||
108 | $YRANGE | ||
109 | $YTICKS | ||
110 | $XRANGE | ||
111 | $XTICKS | ||
112 | $PLOT | ||
113 | set ylabel '$YLABEL' | ||
114 | set xlabel '$XLABEL' | ||
115 | set title '$TITLE' | ||
116 | $KEY | ||
117 | set data style $GRAPH | ||
118 | set out '$OUT' | ||
119 | replot | ||
120 | set out | ||
121 | EOM | ||
122 | |||
123 | if [ "$EXT" == "eps" ]; then | ||
124 | ps2pdf -dEPSCrop $OUT | ||
125 | fi | ||
diff --git a/plot_sched b/plot_sched deleted file mode 100755 index 1d1614c..0000000 --- a/plot_sched +++ /dev/null | |||
@@ -1,178 +0,0 @@ | |||
1 | #!/bin/bash | ||
2 | |||
3 | #NICE="blacktext linewidth 4.0 \"Helvetica\" 16 " | ||
4 | |||
5 | # try thinner lines | ||
6 | NICE="blacktext linewidth 1.0 \"Helvetica\" 16 " | ||
7 | |||
8 | if [ "$1" == "--eps" ]; then | ||
9 | EXT="eps" | ||
10 | # TERMINAL="postscript eps color $NICE" | ||
11 | TERMINAL="postscript eps $NICE" | ||
12 | shift | ||
13 | else | ||
14 | EXT="png" | ||
15 | TERMINAL="png picsize 1024 768" | ||
16 | fi | ||
17 | |||
18 | CSV1=$1 | ||
19 | TITLE=$2 | ||
20 | OUT=$3 | ||
21 | |||
22 | if [ ! -f "$CSV1" ]; then | ||
23 | echo "Usage: plot_sched <data.csv> [<title>] [<out.png>]" | ||
24 | exit 1 | ||
25 | fi | ||
26 | |||
27 | HARDSOFT=`basename $CSV1 | sed -e 's/^\([^_]*\).*/\1/'` | ||
28 | KIND=`basename $CSV1 | sed -e 's/^[^_]*_\([^_]*\).*/\1/'` | ||
29 | FDIST=`basename $CSV1 | sed -e 's/^[^_]*_[^_]*_dist=\(.*\).csv/\1/'` | ||
30 | |||
31 | case "$FDIST" in | ||
32 | uni_light) | ||
33 | DIST="uniformly distributed in [0.001, 0.1]" | ||
34 | ;; | ||
35 | uni_medium) | ||
36 | DIST="uniformly distributed in [0.1, 0.4]" | ||
37 | ;; | ||
38 | uni_heavy) | ||
39 | DIST="uniformly distributed in [0.5, 0.9]" | ||
40 | ;; | ||
41 | bimo_light) | ||
42 | DIST="bimodally distributed in [0.001, 0.5] (8/9) and [0.5, 0.9] (1/9)" | ||
43 | ;; | ||
44 | bimo_medium) | ||
45 | DIST="bimodally distributed in [0.001, 0.5] (6/9) and [0.5, 0.9] (3/9)" | ||
46 | ;; | ||
47 | bimo_heavy) | ||
48 | DIST="bimodally distributed in [0.001, 0.5] (4/9) and [0.5, 0.9] (5/9)" | ||
49 | ;; | ||
50 | *) | ||
51 | ;; | ||
52 | esac | ||
53 | |||
54 | echo "Hard/Soft : $HARDSOFT" | ||
55 | echo "Study : $KIND" | ||
56 | echo "Distribution: $DIST" | ||
57 | |||
58 | XLABEL="utilization cap" | ||
59 | XRANGE="set xrange [0.5:32.5]; set xtics 0, 2" | ||
60 | |||
61 | STYLE="lines lw 3" | ||
62 | #STYLE=linespoints | ||
63 | |||
64 | |||
65 | LINESTYLE=" \ | ||
66 | set style line 1 lt rgb 'blue'; \ | ||
67 | set style line 2 lt rgb 'orange-red'; \ | ||
68 | " | ||
69 | |||
70 | case "$KIND" in | ||
71 | sched) | ||
72 | YLABEL="schedulability" | ||
73 | YRANGE="set yrange [-0.1:1.1]" | ||
74 | case "$HARDSOFT" in | ||
75 | soft) | ||
76 | PLOT="plot '$CSV1' using 1:2 title 'P-EDF' with $STYLE, \ | ||
77 | '$CSV1' using 1:3 title 'C-EDF' with $STYLE, \ | ||
78 | '$CSV1' using 1:4 title 'G-EDF' with $STYLE, \ | ||
79 | '$CSV1' using 1:5 title 'PFAIR' with $STYLE, \ | ||
80 | '$CSV1' using 1:6 title 'S-PFAIR' with $STYLE, \ | ||
81 | '$CSV1' using 1:7 title 'G-NP-EDF' with $STYLE | ||
82 | " | ||
83 | if [ "$FDIST" != "uni_light" ]; then | ||
84 | XRANGE="set xrange [21.5:32.5]; set xtics 0, 2" | ||
85 | fi | ||
86 | ;; | ||
87 | hard) | ||
88 | PLOT="plot '$CSV1' using 1:2 title 'P-EDF' with $STYLE, \ | ||
89 | '$CSV1' using 1:3 title 'C-EDF' with $STYLE, \ | ||
90 | '$CSV1' using 1:4 title 'G-EDF' with $STYLE, \ | ||
91 | '$CSV1' using 1:5 title 'PFAIR' with $STYLE, \ | ||
92 | '$CSV1' using 1:6 title 'S-PFAIR' with $STYLE | ||
93 | " | ||
94 | ;; | ||
95 | esac | ||
96 | ;; | ||
97 | tard) | ||
98 | YLABEL="tardiness (in ms)" | ||
99 | YRANGE= | ||
100 | PLOT="plot '$CSV1' using 1:2 title 'C-EDF' with $STYLE, \ | ||
101 | '$CSV1' using 1:3 title 'G-EDF' with $STYLE, \ | ||
102 | '$CSV1' using 1:4 title 'G-NP-EDF' with $STYLE | ||
103 | " | ||
104 | ;; | ||
105 | util) | ||
106 | YLABEL="utilization (incl. overheads)" | ||
107 | YRANGE= | ||
108 | case "$HARDSOFT" in | ||
109 | soft) | ||
110 | PLOT="plot '$CSV1' using 1:2 title 'P-EDF' with $STYLE, \ | ||
111 | '$CSV1' using 1:3 title 'C-EDF' with $STYLE, \ | ||
112 | '$CSV1' using 1:4 title 'G-EDF' with $STYLE, \ | ||
113 | '$CSV1' using 1:5 title 'PFAIR' with $STYLE, \ | ||
114 | '$CSV1' using 1:6 title 'G-NP-EDF' with $STYLE | ||
115 | " | ||
116 | ;; | ||
117 | hard) | ||
118 | PLOT="plot '$CSV1' using 1:2 title 'P-EDF' with $STYLE, \ | ||
119 | '$CSV1' using 1:3 title 'C-EDF' with $STYLE, \ | ||
120 | '$CSV1' using 1:4 title 'G-EDF' with $STYLE, \ | ||
121 | '$CSV1' using 1:5 title 'PFAIR' with $STYLE \ | ||
122 | " | ||
123 | ;; | ||
124 | esac | ||
125 | ;; | ||
126 | gedf) | ||
127 | YLABEL="schedulability" | ||
128 | YRANGE="set yrange [-0.1:1.1]" | ||
129 | PLOT="plot '$CSV1' using 1:2 title 'P-EDF' with $STYLE, \ | ||
130 | '$CSV1' using 1:8 title 'G-EDF (all)' with $STYLE, \ | ||
131 | '$CSV1' using 1:3 title 'G-EDF [GFB03]' with $STYLE, \ | ||
132 | '$CSV1' using 1:4 title 'G-EDF [BAK03]' with $STYLE, \ | ||
133 | '$CSV1' using 1:5 title 'G-EDF [BCL05]' with $STYLE, \ | ||
134 | '$CSV1' using 1:6 title 'G-EDF [BCL08]' with $STYLE, \ | ||
135 | '$CSV1' using 1:7 title 'G-EDF [SKB07]' with $STYLE \ | ||
136 | " | ||
137 | ;; | ||
138 | *) | ||
139 | YLABEL="" | ||
140 | YRANGE="" | ||
141 | ;; | ||
142 | esac | ||
143 | |||
144 | BASE=`basename $CSV1 | sed -e s/.csv//g -e s/dist=//g ` | ||
145 | |||
146 | #echo $BASE | ||
147 | |||
148 | if [ "$OUT" == "" ]; then | ||
149 | OUT="${BASE}.${EXT}" | ||
150 | fi | ||
151 | |||
152 | if [ "$TITLE" == "" ]; then | ||
153 | TITLE="$DIST" | ||
154 | fi | ||
155 | |||
156 | # fixup csv file, gnuplot is picky | ||
157 | sed -i -e 's/,\([^ ]\)/, \1/g' $CSV1 | ||
158 | |||
159 | gnuplot <<EOM | ||
160 | set terminal $TERMINAL | ||
161 | set out '/dev/null' | ||
162 | $YRANGE | ||
163 | $XRANGE | ||
164 | $PLOT | ||
165 | set ylabel '$YLABEL' | ||
166 | set xlabel '$XLABEL' | ||
167 | set title '$TITLE' | ||
168 | set key below | ||
169 | #set data style $STYLE | ||
170 | set out '$OUT' | ||
171 | set palette defined ( 0 "blue", 3 "green", 6 "yellow", 10 "red" ) | ||
172 | replot | ||
173 | set out | ||
174 | EOM | ||
175 | |||
176 | if [ "$EXT" == "eps" ]; then | ||
177 | ps2pdf -dEPSCrop $OUT | ||
178 | fi | ||