diff options
| author | Bjoern Brandenburg <bbb@Serenity.local> | 2009-01-11 21:42:14 -0500 |
|---|---|---|
| committer | Bjoern Brandenburg <bbb@Serenity.local> | 2009-01-11 21:42:14 -0500 |
| commit | 9944aa4f8f25b7f262b68331875b49e9f5e384cd (patch) | |
| tree | 2837f56200b10270b0b7eaa39d1b05eb66703385 | |
| parent | 6ccfe134d4bff05f457fc97d03f9f3692ab99adb (diff) | |
the ecrts plotter works
| -rw-r--r-- | .gitignore | 8 | ||||
| -rwxr-xr-x | plot_ecrts | 84 | ||||
| -rwxr-xr-x | plot_scatter | 42 |
3 files changed, 130 insertions, 4 deletions
diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..b107b95 --- /dev/null +++ b/.gitignore | |||
| @@ -0,0 +1,8 @@ | |||
| 1 | .DS_Store | ||
| 2 | *.pyc | ||
| 3 | *.pyo | ||
| 4 | ts | ||
| 5 | \#* | ||
| 6 | .\#* | ||
| 7 | *.zapped | ||
| 8 | *.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 @@ | |||
| 1 | #!/bin/bash | ||
| 2 | |||
| 3 | |||
| 4 | EPS_FLAG= | ||
| 5 | |||
| 6 | while true; do | ||
| 7 | case $1 in | ||
| 8 | --eps) | ||
| 9 | shift | ||
| 10 | EPS_FLAG="--eps" | ||
| 11 | ;; | ||
| 12 | *) | ||
| 13 | break | ||
| 14 | ;; | ||
| 15 | esac | ||
| 16 | done | ||
| 17 | |||
| 18 | PLOTTER="plot_scatter $EPS_FLAG --lines --xrange 0.5 32.5 --yrange -0.05 1.05 --xticks 0 2 --yticks 0 0.1" | ||
| 19 | |||
| 20 | function get_tmp_file { | ||
| 21 | OS=`uname` | ||
| 22 | if [ $OS == "Linux" ] | ||
| 23 | then | ||
| 24 | mktemp | ||
| 25 | else # Darwin | ||
| 26 | mktemp -t ecrts | ||
| 27 | fi | ||
| 28 | } | ||
| 29 | |||
| 30 | function get_val { | ||
| 31 | echo "$1" | sed 's/.*=//g' | ||
| 32 | } | ||
| 33 | |||
| 34 | function plot_file { | ||
| 35 | SCHED="G-EDF" | ||
| 36 | FILE=$1 | ||
| 37 | NAME=`basename $FILE | sed -e 's/.csv//g'` | ||
| 38 | STRIPPED=`get_tmp_file` | ||
| 39 | # remove comments for Gnuplot | ||
| 40 | egrep -v '^#' $FILE > $STRIPPED | ||
| 41 | # decode file name | ||
| 42 | PARAMS= | ||
| 43 | for KV in `echo $NAME | sed -e 's/_/ /g'` | ||
| 44 | do | ||
| 45 | case $KV in | ||
| 46 | pedf) | ||
| 47 | SCHED="P-EDF" | ||
| 48 | ;; | ||
| 49 | gedf) | ||
| 50 | SCHED="G-EDF" | ||
| 51 | ;; | ||
| 52 | hard) | ||
| 53 | TEST="hard" | ||
| 54 | ;; | ||
| 55 | soft) | ||
| 56 | TEST="soft" | ||
| 57 | ;; | ||
| 58 | axis*) | ||
| 59 | AXIS=`get_val $KV` | ||
| 60 | ;; | ||
| 61 | rmax*|rmin*|wmax*|wmin*) | ||
| 62 | # ignored, not shown | ||
| 63 | ;; | ||
| 64 | *) | ||
| 65 | PARAMS="$PARAMS $KV" | ||
| 66 | ;; | ||
| 67 | esac | ||
| 68 | done | ||
| 69 | TITLE="$TEST schedulability under $SCHED with$PARAMS" | ||
| 70 | echo $TITLE | ||
| 71 | $PLOTTER "$NAME" "$AXIS" "Schedulability" "$TITLE" \ | ||
| 72 | $STRIPPED 1 2 "fair mutex" \ | ||
| 73 | $STRIPPED 1 3 "task-fair RW" \ | ||
| 74 | $STRIPPED 1 4 "phase-fair RW" | ||
| 75 | rm $STRIPPED | ||
| 76 | } | ||
| 77 | |||
| 78 | |||
| 79 | while [ ! -z "$1" ] | ||
| 80 | do | ||
| 81 | echo "Plotting $1..." | ||
| 82 | plot_file $1 | ||
| 83 | shift | ||
| 84 | done | ||
diff --git a/plot_scatter b/plot_scatter index 1a455c5..6ebb436 100755 --- a/plot_scatter +++ b/plot_scatter | |||
| @@ -6,10 +6,10 @@ | |||
| 6 | NICE="blacktext linewidth 1.0 \"Helvetica\" 16 " | 6 | NICE="blacktext linewidth 1.0 \"Helvetica\" 16 " |
| 7 | 7 | ||
| 8 | EXT="png" | 8 | EXT="png" |
| 9 | TERMINAL="png picsize 1024 768" | 9 | TERMINAL="png size 1024,768 large" |
| 10 | 10 | ||
| 11 | GRAPH=points | 11 | GRAPH=points |
| 12 | 12 | XTRA= | |
| 13 | while true; do | 13 | while true; do |
| 14 | case $1 in | 14 | case $1 in |
| 15 | --eps) | 15 | --eps) |
| @@ -21,12 +21,44 @@ while true; do | |||
| 21 | shift | 21 | shift |
| 22 | GRAPH=lines | 22 | GRAPH=lines |
| 23 | ;; | 23 | ;; |
| 24 | --xrange) | ||
| 25 | shift | ||
| 26 | XRANGE="set xrange [$1:$2]" | ||
| 27 | shift | ||
| 28 | shift | ||
| 29 | ;; | ||
| 30 | --xticks) | ||
| 31 | shift | ||
| 32 | XTICKS="set xtics $1, $2" | ||
| 33 | shift | ||
| 34 | shift | ||
| 35 | ;; | ||
| 36 | --yrange) | ||
| 37 | shift | ||
| 38 | YRANGE="set yrange [$1:$2]" | ||
| 39 | shift | ||
| 40 | shift | ||
| 41 | ;; | ||
| 42 | --yticks) | ||
| 43 | shift | ||
| 44 | YTICKS="set ytics $1, $2" | ||
| 45 | shift | ||
| 46 | shift | ||
| 47 | ;; | ||
| 48 | --extra) | ||
| 49 | shift | ||
| 50 | XTRA="$1" | ||
| 51 | ;; | ||
| 24 | --linespoints) | 52 | --linespoints) |
| 25 | shift | 53 | shift |
| 26 | GRAPH=linespoints | 54 | GRAPH=linespoints |
| 27 | ;; | 55 | ;; |
| 28 | *) | 56 | --*) |
| 29 | break | 57 | echo "unrecognized option: $1" |
| 58 | exit 1 | ||
| 59 | ;; | ||
| 60 | *) | ||
| 61 | break | ||
| 30 | ;; | 62 | ;; |
| 31 | esac | 63 | esac |
| 32 | done | 64 | done |
| @@ -73,7 +105,9 @@ gnuplot <<EOM | |||
| 73 | set terminal $TERMINAL | 105 | set terminal $TERMINAL |
| 74 | set out '/dev/null' | 106 | set out '/dev/null' |
| 75 | $YRANGE | 107 | $YRANGE |
| 108 | $YTICKS | ||
| 76 | $XRANGE | 109 | $XRANGE |
| 110 | $XTICKS | ||
| 77 | $PLOT | 111 | $PLOT |
| 78 | set ylabel '$YLABEL' | 112 | set ylabel '$YLABEL' |
| 79 | set xlabel '$XLABEL' | 113 | set xlabel '$XLABEL' |
