From 9944aa4f8f25b7f262b68331875b49e9f5e384cd Mon Sep 17 00:00:00 2001 From: Bjoern Brandenburg Date: Sun, 11 Jan 2009 21:42:14 -0500 Subject: the ecrts plotter works --- plot_ecrts | 84 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 84 insertions(+) create mode 100755 plot_ecrts (limited to 'plot_ecrts') diff --git a/plot_ecrts b/plot_ecrts new file mode 100755 index 0000000..3bcd004 --- /dev/null +++ b/plot_ecrts @@ -0,0 +1,84 @@ +#!/bin/bash + + +EPS_FLAG= + +while true; do + case $1 in + --eps) + shift + EPS_FLAG="--eps" + ;; + *) + break + ;; + esac +done + +PLOTTER="plot_scatter $EPS_FLAG --lines --xrange 0.5 32.5 --yrange -0.05 1.05 --xticks 0 2 --yticks 0 0.1" + +function get_tmp_file { + OS=`uname` + if [ $OS == "Linux" ] + then + mktemp + else # Darwin + mktemp -t ecrts + fi +} + +function get_val { + echo "$1" | sed 's/.*=//g' +} + +function plot_file { + SCHED="G-EDF" + FILE=$1 + NAME=`basename $FILE | sed -e 's/.csv//g'` + STRIPPED=`get_tmp_file` + # remove comments for Gnuplot + egrep -v '^#' $FILE > $STRIPPED + # decode file name + PARAMS= + for KV in `echo $NAME | sed -e 's/_/ /g'` + do + case $KV in + pedf) + SCHED="P-EDF" + ;; + gedf) + SCHED="G-EDF" + ;; + hard) + TEST="hard" + ;; + soft) + TEST="soft" + ;; + axis*) + AXIS=`get_val $KV` + ;; + rmax*|rmin*|wmax*|wmin*) + # ignored, not shown + ;; + *) + PARAMS="$PARAMS $KV" + ;; + esac + done + TITLE="$TEST schedulability under $SCHED with$PARAMS" + echo $TITLE + $PLOTTER "$NAME" "$AXIS" "Schedulability" "$TITLE" \ + $STRIPPED 1 2 "fair mutex" \ + $STRIPPED 1 3 "task-fair RW" \ + $STRIPPED 1 4 "phase-fair RW" + rm $STRIPPED +} + + +while [ ! -z "$1" ] +do + echo "Plotting $1..." + plot_file $1 + shift +done -- cgit v1.2.2