Jens Axboe | ebac465 | 2005-12-08 15:25:21 +0100 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | |
| 3 | # Use gnuplot to generate plots from fio run with -l and/or -w |
| 4 | |
| 5 | if [ "$1"x == "x" ]; then |
| 6 | echo Need title as arg |
| 7 | exit 1 |
| 8 | fi |
| 9 | |
Jens Axboe | 1618495 | 2006-06-12 10:28:06 +0200 | [diff] [blame] | 10 | GNUPLOT=$(which gnuplot) |
| 11 | if [ ! -x $GNUPLOT ]; then |
| 12 | echo You need gnuplot installed to generate graphs |
| 13 | exit 1 |
| 14 | fi |
| 15 | |
Jens Axboe | ebac465 | 2005-12-08 15:25:21 +0100 | [diff] [blame] | 16 | TITLE=$1 |
| 17 | |
| 18 | PLOT_LINE="" |
| 19 | for i in *bw.log; do |
| 20 | if [ ! -r $i ]; then |
| 21 | continue |
| 22 | fi |
| 23 | if [ "$PLOT_LINE"x != "x" ]; then |
| 24 | PLOT_LINE=$PLOT_LINE", " |
| 25 | fi |
| 26 | |
| 27 | PLOT_LINE=$PLOT_LINE"'$i' with lines" |
| 28 | done |
| 29 | |
| 30 | if [ "$PLOT_LINE"x != "x" ]; then |
| 31 | echo Making bw logs |
Jens Axboe | 1618495 | 2006-06-12 10:28:06 +0200 | [diff] [blame] | 32 | echo "set title 'Bandwidth - $TITLE'; set xlabel 'time (msec)'; set ylabel 'KiB/sec'; set terminal png; set output '$TITLE-bw.png'; plot " $PLOT_LINE | $GNUPLOT - |
Jens Axboe | ebac465 | 2005-12-08 15:25:21 +0100 | [diff] [blame] | 33 | fi |
| 34 | |
| 35 | PLOT_LINE="" |
| 36 | for i in *slat.log; do |
| 37 | if [ ! -r $i ]; then |
| 38 | continue |
| 39 | fi |
| 40 | if [ "$PLOT_LINE"x != "x" ]; then |
| 41 | PLOT_LINE=$PLOT_LINE", " |
| 42 | fi |
| 43 | |
| 44 | PLOT_LINE=$PLOT_LINE"'$i' with lines" |
| 45 | done |
| 46 | |
| 47 | if [ "$PLOT_LINE"x != "x" ]; then |
| 48 | echo Making slat logs $PLOT_LINE |
Jens Axboe | 1618495 | 2006-06-12 10:28:06 +0200 | [diff] [blame] | 49 | echo "set title 'Submission latency - $TITLE'; set xlabel 'time (msec)'; set ylabel 'latency (msec)'; set terminal png; set output '$TITLE-slat.png'; plot " $PLOT_LINE | $GNUPLOT - |
Jens Axboe | ebac465 | 2005-12-08 15:25:21 +0100 | [diff] [blame] | 50 | fi |
| 51 | |
| 52 | PLOT_LINE="" |
| 53 | for i in *clat.log; do |
| 54 | if [ ! -r $i ]; then |
| 55 | continue |
| 56 | fi |
| 57 | if [ "$PLOT_LINE"x != "x" ]; then |
| 58 | PLOT_LINE=$PLOT_LINE", " |
| 59 | fi |
| 60 | |
| 61 | PLOT_LINE=$PLOT_LINE"'$i' with lines" |
| 62 | done |
| 63 | |
| 64 | if [ "$PLOT_LINE"x != "x" ]; then |
| 65 | echo Making clat logs $PLOT_LINE |
Jens Axboe | 1618495 | 2006-06-12 10:28:06 +0200 | [diff] [blame] | 66 | echo "set title 'Completion latency - $TITLE'; set xlabel 'time (msec)'; set ylabel 'latency (msec)'; set terminal png; set output '$TITLE-clat.png'; plot " $PLOT_LINE | $GNUPLOT - |
Jens Axboe | ebac465 | 2005-12-08 15:25:21 +0100 | [diff] [blame] | 67 | fi |