YAMAMOTO Takashi | 40cfddb | 2010-06-02 08:24:03 +0200 | [diff] [blame] | 1 | #! /bin/sh |
Jens Axboe | ebac465 | 2005-12-08 15:25:21 +0100 | [diff] [blame] | 2 | |
| 3 | # Use gnuplot to generate plots from fio run with -l and/or -w |
| 4 | |
YAMAMOTO Takashi | 40cfddb | 2010-06-02 08:24:03 +0200 | [diff] [blame] | 5 | if [ "$1"x = "x" ]; then |
Jens Axboe | ebac465 | 2005-12-08 15:25:21 +0100 | [diff] [blame] | 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 |
Jens Axboe | 84f8317 | 2008-04-04 23:15:19 +0200 | [diff] [blame] | 23 | PT=$(echo $i | sed s/_bw.log//g) |
Jens Axboe | ebac465 | 2005-12-08 15:25:21 +0100 | [diff] [blame] | 24 | if [ "$PLOT_LINE"x != "x" ]; then |
| 25 | PLOT_LINE=$PLOT_LINE", " |
| 26 | fi |
| 27 | |
Jens Axboe | 84f8317 | 2008-04-04 23:15:19 +0200 | [diff] [blame] | 28 | PLOT_LINE=$PLOT_LINE"'$i' title '$PT' with lines" |
Jens Axboe | ebac465 | 2005-12-08 15:25:21 +0100 | [diff] [blame] | 29 | done |
| 30 | |
| 31 | if [ "$PLOT_LINE"x != "x" ]; then |
| 32 | echo Making bw logs |
Jens Axboe | b22989b | 2009-07-17 22:29:23 +0200 | [diff] [blame] | 33 | echo "set title 'Bandwidth - $TITLE'; set xlabel 'time (msec)'; set ylabel 'KB/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] | 34 | fi |
| 35 | |
| 36 | PLOT_LINE="" |
| 37 | for i in *slat.log; do |
| 38 | if [ ! -r $i ]; then |
| 39 | continue |
| 40 | fi |
Jens Axboe | 84f8317 | 2008-04-04 23:15:19 +0200 | [diff] [blame] | 41 | PT=$(echo $i | sed s/_slat.log//g) |
Jens Axboe | ebac465 | 2005-12-08 15:25:21 +0100 | [diff] [blame] | 42 | if [ "$PLOT_LINE"x != "x" ]; then |
| 43 | PLOT_LINE=$PLOT_LINE", " |
| 44 | fi |
| 45 | |
Jens Axboe | 84f8317 | 2008-04-04 23:15:19 +0200 | [diff] [blame] | 46 | PLOT_LINE=$PLOT_LINE"'$i' title '$PT' with lines" |
Jens Axboe | ebac465 | 2005-12-08 15:25:21 +0100 | [diff] [blame] | 47 | done |
| 48 | |
| 49 | if [ "$PLOT_LINE"x != "x" ]; then |
| 50 | echo Making slat logs $PLOT_LINE |
Jens Axboe | 1618495 | 2006-06-12 10:28:06 +0200 | [diff] [blame] | 51 | 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] | 52 | fi |
| 53 | |
| 54 | PLOT_LINE="" |
| 55 | for i in *clat.log; do |
| 56 | if [ ! -r $i ]; then |
| 57 | continue |
| 58 | fi |
Jens Axboe | 84f8317 | 2008-04-04 23:15:19 +0200 | [diff] [blame] | 59 | PT=$(echo $i | sed s/_clat.log//g) |
Jens Axboe | ebac465 | 2005-12-08 15:25:21 +0100 | [diff] [blame] | 60 | if [ "$PLOT_LINE"x != "x" ]; then |
| 61 | PLOT_LINE=$PLOT_LINE", " |
| 62 | fi |
| 63 | |
Jens Axboe | 84f8317 | 2008-04-04 23:15:19 +0200 | [diff] [blame] | 64 | PLOT_LINE=$PLOT_LINE"'$i' title '$PT' with lines" |
Jens Axboe | ebac465 | 2005-12-08 15:25:21 +0100 | [diff] [blame] | 65 | done |
| 66 | |
| 67 | if [ "$PLOT_LINE"x != "x" ]; then |
| 68 | echo Making clat logs $PLOT_LINE |
Jens Axboe | 1618495 | 2006-06-12 10:28:06 +0200 | [diff] [blame] | 69 | 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] | 70 | fi |
Jens Axboe | 02af098 | 2010-06-24 09:59:34 +0200 | [diff] [blame] | 71 | |
| 72 | PLOT_LINE="" |
| 73 | for i in *_lat.log; do |
| 74 | if [ ! -r $i ]; then |
| 75 | continue |
| 76 | fi |
| 77 | PT=$(echo $i | sed s/_lat.log//g) |
| 78 | if [ "$PLOT_LINE"x != "x" ]; then |
| 79 | PLOT_LINE=$PLOT_LINE", " |
| 80 | fi |
| 81 | |
| 82 | PLOT_LINE=$PLOT_LINE"'$i' title '$PT' with lines" |
| 83 | done |
| 84 | |
| 85 | if [ "$PLOT_LINE"x != "x" ]; then |
| 86 | echo Making lat logs $PLOT_LINE |
| 87 | echo "set title 'Latency - $TITLE'; set xlabel 'time (msec)'; set ylabel 'latency (msec)'; set terminal png; set output '$TITLE-lat.png'; plot " $PLOT_LINE | $GNUPLOT - |
| 88 | fi |