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 --- .gitignore | 8 ++++++ plot_ecrts | 84 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ plot_scatter | 42 +++++++++++++++++++++++++++--- 3 files changed, 130 insertions(+), 4 deletions(-) create mode 100644 .gitignore create mode 100755 plot_ecrts diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..b107b95 --- /dev/null +++ b/.gitignore @@ -0,0 +1,8 @@ +.DS_Store +*.pyc +*.pyo +ts +\#* +.\#* +*.zapped +*.sedbak* \ No newline at end of file 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 diff --git a/plot_scatter b/plot_scatter index 1a455c5..6ebb436 100755 --- a/plot_scatter +++ b/plot_scatter @@ -6,10 +6,10 @@ NICE="blacktext linewidth 1.0 \"Helvetica\" 16 " EXT="png" -TERMINAL="png picsize 1024 768" +TERMINAL="png size 1024,768 large" GRAPH=points - +XTRA= while true; do case $1 in --eps) @@ -21,12 +21,44 @@ while true; do shift GRAPH=lines ;; + --xrange) + shift + XRANGE="set xrange [$1:$2]" + shift + shift + ;; + --xticks) + shift + XTICKS="set xtics $1, $2" + shift + shift + ;; + --yrange) + shift + YRANGE="set yrange [$1:$2]" + shift + shift + ;; + --yticks) + shift + YTICKS="set ytics $1, $2" + shift + shift + ;; + --extra) + shift + XTRA="$1" + ;; --linespoints) shift GRAPH=linespoints ;; - *) - break + --*) + echo "unrecognized option: $1" + exit 1 + ;; + *) + break ;; esac done @@ -73,7 +105,9 @@ gnuplot <