Index: makeplots.sh |
diff --git a/makeplots.sh b/makeplots.sh |
new file mode 100755 |
index 0000000000000000000000000000000000000000..14f779a1e6b98cdc3d130fbdf4f8d8c1fb84971a |
--- /dev/null |
+++ b/makeplots.sh |
@@ -0,0 +1,80 @@ |
+#!/bin/bash -x |
+MAX_INDEX=2 |
+MAX_INDEX=0 |
+KEY=( "throbber" "idle" "cursor" ) |
+TITLE=( "Throbber" "Idle" "Cursor" ) |
+ |
+COCOA=( 1 2 3 ) |
+VIEWS=( 1 2 1 ) |
+ |
+TRUNK_KEY=cocoa |
+TRUNK_KEY=slowtab |
+COMP_KEY=views |
+ |
+TRUNK_TITLE=Cocoa |
+TRUNK_TITLE=master |
+COMP_TITLE=Views |
+COMP_TITLE=crrev/1393193002 |
+ |
+TYPE=eps # svg #or png |
+TERM_PARAMS="$TYPE" # works for svg and png |
+TERM_PARAMS="postscript eps color enhanced size 6in,4.2in" |
+ |
+function eps2png() { |
+ gs -dSAFER -dBATCH -dNOPAUSE -r600 -sDEVICE=pngalpha -dEPSCrop -sOutputFile="${1/%.eps/.png}" "${1}" |
+} |
+ |
+for i in `seq 0 $MAX_INDEX` ; do |
+ output="${KEY[i]}-timeline.$TYPE" |
+ title="${TITLE[i]} Timeline" |
+ cocoa="${TRUNK_KEY}-${KEY[i]}-${COCOA[i]}.txt" |
+ views="${COMP_KEY}-${KEY[i]}-${VIEWS[i]}.txt" |
+ |
+ gnuplot <<EOF |
+set terminal $TERM_PARAMS |
+set key autotitle columnhead |
+set datafile separator ',' |
+set output "$output" |
+set ylabel "Watts" |
+set xlabel "RDTSC" |
+set title "$title" |
+plot \ |
+"$views" using 1:2 with lines title "Processor Watts $COMP_TITLE", \ |
+"$cocoa" using 1:2 with lines title "Processor Watts $TRUNK_TITLE", \ |
+"$views" using 1:3 with lines title "IA Watts $COMP_TITLE", \ |
+"$cocoa" using 1:3 with lines title "IA Watts $TRUNK_TITLE" |
+EOF |
+ |
+ [ $TYPE = eps ] && eps2png "${output}" |
+ |
+ # Runs plot |
+ output="${KEY[i]}-runs.$TYPE" |
+ title="${TITLE[i]} Runs" |
+ cocoa="${TRUNK_KEY}-${KEY[i]}-log.txt" |
+ views="${COMP_KEY}-${KEY[i]}-log.txt" |
+ |
+ gnuplot <<EOF |
+set terminal $TERM_PARAMS |
+set key autotitle columnhead |
+set datafile separator ',' |
+set output "$output" |
+set title "$title" |
+set timefmt "%Y-%m-%d %H:%M:%S" |
+set xdata time |
+set ylabel "Watts" |
+set xlabel "Wall Clock" |
+plot \ |
+"$views" using 1:2:3 with yerrorbars linetype 1 title '', \ |
+'' using 1:2 with lines linetype 1 title "$COMP_TITLE $title Processor Watts", \ |
+"$cocoa" using 1:2:3 with yerrorbars linetype 2 title '', \ |
+'' using 1:2 with lines linetype 2 title "$TRUNK_TITLE $title Processor Watts", \ |
+"$views" using 1:4:5 with yerrorbars linetype 3 title '', \ |
+'' using 1:4 with lines linetype 3 title "$COMP_TITLE $title IA Watts", \ |
+"$cocoa" using 1:4:5 with yerrorbars linetype 4 title '', \ |
+'' using 1:4 with lines linetype 4 title "$TRUNK_TITLE $title IA Watts" |
+EOF |
+ |
+ [ $TYPE = eps ] && eps2png "${output}" |
+ |
+done |
+ |