aboutsummaryrefslogtreecommitdiffstats
path: root/plot_sched
diff options
context:
space:
mode:
Diffstat (limited to 'plot_sched')
-rwxr-xr-xplot_sched76
1 files changed, 76 insertions, 0 deletions
diff --git a/plot_sched b/plot_sched
new file mode 100755
index 0000000..41ab38b
--- /dev/null
+++ b/plot_sched
@@ -0,0 +1,76 @@
1#!/bin/bash
2
3NICE="blacktext linewidth 4.0 \"Helvetica\" 16 "
4
5if [ "$1" == "--eps" ]; then
6 EXT="eps"
7 TERMINAL="postscript color eps $NICE"
8 shift
9else
10 EXT="png"
11 TERMINAL="png picsize 1024 768"
12fi
13
14CSV1=$1
15TITLE=$2
16OUT=$3
17
18if [ ! -f "$CSV1" ]; then
19 echo "Usage: plot_sched <data.csv> [<title>] [<out.png>]"
20 exit 1
21fi
22
23KIND=`basename $CSV1 | sed -e 's/^\([^_]*\).*/\1/'`
24
25case "$KIND" in
26 util)
27 XLABEL="utilization cap"
28 ;;
29 freq)
30 XLABEL="K"
31 ;;
32 mcsl)
33 XLABEL="L (in us)"
34 ;;
35 cpus)
36 XLABEL="processor count"
37 ;;
38 *)
39 XLABEL="";
40 ;;
41esac
42
43
44BASE=`basename $CSV1 | sed -e s/.csv//g -e s/_[a-z]*=0.123000//g -e 's/\([0-9]*\.[^0]\+\)0*\([_c]\)/\1_\2/g' -e 's/\([0-9]\)\.0*\([_c]\)/\1_\2/g' -e s/_cpus=16//g -e s/_freq=0//g`
45
46echo $BASE
47
48if [ "$OUT" == "" ]; then
49 OUT="${BASE}.${EXT}"
50fi
51
52if [ "$TITLE" == "" ]; then
53 TITLE=`echo -n $BASE | tr '_' ' ' | sed -e 's/^\(util\|freq\|mcsl\|cpus\) //g' -e s/freq=/K=/g -e s/mcsl=/L=/g `
54fi
55
56gnuplot <<EOM
57set terminal $TERMINAL
58set out '/dev/null'
59set yrange [-0.1:1.1]
60plot '$CSV1' using 1:2 title 'FMLP (short)' with linespoints
61replot '$CSV1' using 1:3 title 'FMLP (long)' with linespoints
62replot '$CSV1' using 1:4 title 'M-PCP' with linespoints
63replot '$CSV1' using 1:5 title 'D-PCP' with linespoints
64set ylabel 'schedulability'
65set xlabel '$XLABEL'
66set title '$TITLE'
67set key below
68set data style linespoints
69set out '$OUT'
70replot
71set out
72EOM
73
74if [ "$EXT" == "eps" ]; then
75 ps2pdf -dEPSCrop $OUT
76fi \ No newline at end of file