#!/bin/bash NICE="blacktext linewidth 4.0 \"Helvetica\" 16 " if [ "$1" == "--eps" ]; then EXT="eps" TERMINAL="postscript color eps $NICE" shift else EXT="png" TERMINAL="png picsize 1024 768" fi CSV1=$1 TITLE=$2 OUT=$3 if [ ! -f "$CSV1" ]; then echo "Usage: plot_sched [] [<out.png>]" exit 1 fi KIND=`basename $CSV1 | sed -e 's/^\([^_]*\).*/\1/'` case "$KIND" in util) XLABEL="utilization cap" ;; freq) XLABEL="K" ;; mcsl) XLABEL="L (in us)" ;; cpus) XLABEL="processor count" ;; *) XLABEL=""; ;; esac 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` echo $BASE if [ "$OUT" == "" ]; then OUT="${BASE}.${EXT}" fi if [ "$TITLE" == "" ]; then TITLE=`echo -n $BASE | tr '_' ' ' | sed -e 's/^\(util\|freq\|mcsl\|cpus\) //g' -e s/freq=/K=/g -e s/mcsl=/L=/g ` fi gnuplot <<EOM set terminal $TERMINAL set out '/dev/null' set yrange [-0.1:1.1] plot '$CSV1' using 1:2 title 'FMLP (short)' with linespoints replot '$CSV1' using 1:3 title 'FMLP (long)' with linespoints replot '$CSV1' using 1:4 title 'M-PCP' with linespoints replot '$CSV1' using 1:5 title 'D-PCP' with linespoints set ylabel 'schedulability' set xlabel '$XLABEL' set title '$TITLE' set key below set data style linespoints set out '$OUT' replot set out EOM if [ "$EXT" == "eps" ]; then ps2pdf -dEPSCrop $OUT fi