#!/bin/bash EPS_FLAG= while true; do case $1 in --eps) shift EPS_FLAG="--eps" ;; *) break ;; esac done PLOTTER="plot_scatter $EPS_FLAG --lines " 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 if [ ! -s $STRIPPED ] then echo "Skipping $FILE since there wasn't any data to be found. " return fi # 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 YRANGE=" --yrange -0.05 1.05 --yticks 0 0.1" case $AXIS in ucap) XRANGE="--xrange 0.5 32.5 --xticks 0 2" XRANGE="--xrange 0.5 22.5 --xticks 0 2" if [ "$SCHED" == "G-EDF" ] && [ "$TEST" == "hard" ] then XRANGE="--xrange 0.5 14.5 --xticks 0 1" fi AXIS_LABEL="task set utilization (prior to inflation)" ;; res) XRANGE="--xrange 0 5.05 --xticks 0 1" AXIS_LABEL="average number of resources per task" ;; nest) XRANGE="--xrange 0 0.505 --xticks 0 0.1" AXIS_LABEL="probability of nested requests" ;; contention) XRANGE="--xrange 45 555 --xticks 0 50" AXIS_LABEL="requests per resource per second" ;; wratio) XRANGE="--xrange 0 0.505 --xticks 0 0.1" AXIS_LABEL="ratio of write requests" ;; *) echo "Unkown axis: $AXIS." AXIS_LABEL="$AXIS" ;; esac TITLE="$TEST schedulability under $SCHED with$PARAMS" RANGE="$XRANGE $YRANGE" $PLOTTER $RANGE "$NAME" "$AXIS_LABEL" "ratio of schedulable task sets" "$TITLE" \ $STRIPPED 1 2 "task-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