From 2ebc9c2eeaeb03df85f21f6c593e64d3b8218658 Mon Sep 17 00:00:00 2001 From: "Bjoern B. Brandenburg" Date: Sat, 24 May 2008 22:22:46 -0400 Subject: extracted the plotting tools from csvtools --- plot_sched | 76 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 76 insertions(+) create mode 100755 plot_sched (limited to 'plot_sched') diff --git a/plot_sched b/plot_sched new file mode 100755 index 0000000..41ab38b --- /dev/null +++ b/plot_sched @@ -0,0 +1,76 @@ +#!/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 \ No newline at end of file -- cgit v1.2.2