diff options
Diffstat (limited to 'plot_sched')
| -rwxr-xr-x | plot_sched | 76 |
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 | |||
| 3 | NICE="blacktext linewidth 4.0 \"Helvetica\" 16 " | ||
| 4 | |||
| 5 | if [ "$1" == "--eps" ]; then | ||
| 6 | EXT="eps" | ||
| 7 | TERMINAL="postscript color eps $NICE" | ||
| 8 | shift | ||
| 9 | else | ||
| 10 | EXT="png" | ||
| 11 | TERMINAL="png picsize 1024 768" | ||
| 12 | fi | ||
| 13 | |||
| 14 | CSV1=$1 | ||
| 15 | TITLE=$2 | ||
| 16 | OUT=$3 | ||
| 17 | |||
| 18 | if [ ! -f "$CSV1" ]; then | ||
| 19 | echo "Usage: plot_sched <data.csv> [<title>] [<out.png>]" | ||
| 20 | exit 1 | ||
| 21 | fi | ||
| 22 | |||
| 23 | KIND=`basename $CSV1 | sed -e 's/^\([^_]*\).*/\1/'` | ||
| 24 | |||
| 25 | case "$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 | ;; | ||
| 41 | esac | ||
| 42 | |||
| 43 | |||
| 44 | BASE=`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 | |||
| 46 | echo $BASE | ||
| 47 | |||
| 48 | if [ "$OUT" == "" ]; then | ||
| 49 | OUT="${BASE}.${EXT}" | ||
| 50 | fi | ||
| 51 | |||
| 52 | if [ "$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 ` | ||
| 54 | fi | ||
| 55 | |||
| 56 | gnuplot <<EOM | ||
| 57 | set terminal $TERMINAL | ||
| 58 | set out '/dev/null' | ||
| 59 | set yrange [-0.1:1.1] | ||
| 60 | plot '$CSV1' using 1:2 title 'FMLP (short)' with linespoints | ||
| 61 | replot '$CSV1' using 1:3 title 'FMLP (long)' with linespoints | ||
| 62 | replot '$CSV1' using 1:4 title 'M-PCP' with linespoints | ||
| 63 | replot '$CSV1' using 1:5 title 'D-PCP' with linespoints | ||
| 64 | set ylabel 'schedulability' | ||
| 65 | set xlabel '$XLABEL' | ||
| 66 | set title '$TITLE' | ||
| 67 | set key below | ||
| 68 | set data style linespoints | ||
| 69 | set out '$OUT' | ||
| 70 | replot | ||
| 71 | set out | ||
| 72 | EOM | ||
| 73 | |||
| 74 | if [ "$EXT" == "eps" ]; then | ||
| 75 | ps2pdf -dEPSCrop $OUT | ||
| 76 | fi \ No newline at end of file | ||
