From 48354b21ae13e4a653dba9c0435249ada6997659 Mon Sep 17 00:00:00 2001 From: Bjoern Brandenburg Date: Sun, 25 May 2008 00:47:48 -0400 Subject: make'em pretty! --- plot_sched | 110 ++++++++++++++++++++++++++++++++++++++++++++++++++----------- 1 file changed, 91 insertions(+), 19 deletions(-) (limited to 'plot_sched') diff --git a/plot_sched b/plot_sched index ee378e5..b955c85 100755 --- a/plot_sched +++ b/plot_sched @@ -20,28 +20,99 @@ if [ ! -f "$CSV1" ]; then exit 1 fi -KIND=`basename $CSV1 | sed -e 's/^\([^_]*\).*/\1/'` +HARDSOFT=`basename $CSV1 | sed -e 's/^\([^_]*\).*/\1/'` +KIND=`basename $CSV1 | sed -e 's/^[^_]*_\([^_]*\).*/\1/'` +DIST=`basename $CSV1 | sed -e 's/^[^_]*_[^_]*_dist=\(.*\).csv/\1/'` + +case "$DIST" in + uni_light) + DIST="uniformly distributed in [0.001, 0.1]" + ;; + uni_medium) + DIST="uniformly distributed in [0.1, 0.4]" + ;; + uni_heavy) + DIST="uniformly distributed in [0.5, 0.9]" + ;; + bimo_light) + DIST="bimodally distributed in [0.001, 0.5] (8/9) and [0.5, 0.9] (1/9)" + ;; + bimo_medium) + DIST="bimodally distributed in [0.001, 0.5] (6/9) and [0.5, 0.9] (3/9)" + ;; + bimo_heavy) + DIST="bimodally distributed in [0.001, 0.5] (4/9) and [0.5, 0.9] (5/9)" + ;; + *) + ;; +esac + +echo "Hard/Soft : $HARDSOFT" +echo "Study : $KIND" +echo "Distribution: $DIST" case "$KIND" in - util) - XLABEL="utilization cap" + sched) + YLABEL="schedulability" + YRANGE="set yrange [-0.1:1.1]" + case "$HARDSOFT" in + soft) + PLOT="plot '$CSV1' using 1:2 title 'P-EDF' with linespoints, \ + '$CSV1' using 1:3 title 'C-EDF' with linespoints, \ + '$CSV1' using 1:4 title 'G-EDF' with linespoints, \ + '$CSV1' using 1:5 title 'PFAIR' with linespoints, \ + '$CSV1' using 1:6 title 'G-NP-EDF' with linespoints + " + ;; + hard) + PLOT="plot '$CSV1' using 1:2 title 'P-EDF' with linespoints, \ + '$CSV1' using 1:3 title 'C-EDF' with linespoints, \ + '$CSV1' using 1:4 title 'G-EDF' with linespoints, \ + '$CSV1' using 1:5 title 'PFAIR' with linespoints \ + " + ;; + esac ;; - freq) - XLABEL="K" + tard) + YLABEL="tardiness (in ms)" + YRANGE= + PLOT="plot '$CSV1' using 1:2 title 'C-EDF' with linespoints, \ + '$CSV1' using 1:3 title 'G-EDF' with linespoints, \ + '$CSV1' using 1:4 title 'G-NP-EDF' with linespoints + " ;; - mcsl) - XLABEL="L (in us)" - ;; - cpus) - XLABEL="processor count" + util) + YLABEL="utilization (incl. overheads)" + YRANGE= + case "$HARDSOFT" in + soft) + PLOT="plot '$CSV1' using 1:2 title 'P-EDF' with linespoints, \ + '$CSV1' using 1:3 title 'C-EDF' with linespoints, \ + '$CSV1' using 1:4 title 'G-EDF' with linespoints, \ + '$CSV1' using 1:5 title 'PFAIR' with linespoints, \ + '$CSV1' using 1:6 title 'G-NP-EDF' with linespoints + " + ;; + hard) + PLOT="plot '$CSV1' using 1:2 title 'P-EDF' with linespoints, \ + '$CSV1' using 1:3 title 'C-EDF' with linespoints, \ + '$CSV1' using 1:4 title 'G-EDF' with linespoints, \ + '$CSV1' using 1:5 title 'PFAIR' with linespoints \ + " + ;; + esac ;; *) - XLABEL=""; + YLABEL="" + YRANGE="" ;; 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` +XLABEL="utilization cap" +XRANGE="set xrange [0.5:32.5]; set xtics 0, 2" + +BASE=`basename $CSV1 | sed -e s/.csv//g -e s/dist=//g ` echo $BASE @@ -50,18 +121,19 @@ if [ "$OUT" == "" ]; then 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 ` + TITLE="$DIST" fi +# fixup csv file, gnuplot is picky +sed -i -e 's/,\([^ ]\)/, \1/g' $CSV1 + gnuplot <