blob: 4ae1d0affe6cb52260bbe0706939112aeab70aa9 [file] [log] [blame]
Jens Axboeebac4652005-12-08 15:25:21 +01001#!/bin/bash
2
3# Use gnuplot to generate plots from fio run with -l and/or -w
4
5if [ "$1"x == "x" ]; then
6 echo Need title as arg
7 exit 1
8fi
9
Jens Axboe16184952006-06-12 10:28:06 +020010GNUPLOT=$(which gnuplot)
11if [ ! -x $GNUPLOT ]; then
12 echo You need gnuplot installed to generate graphs
13 exit 1
14fi
15
Jens Axboeebac4652005-12-08 15:25:21 +010016TITLE=$1
17
18PLOT_LINE=""
19for 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"
28done
29
30if [ "$PLOT_LINE"x != "x" ]; then
31 echo Making bw logs
Jens Axboe16184952006-06-12 10:28:06 +020032 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 Axboeebac4652005-12-08 15:25:21 +010033fi
34
35PLOT_LINE=""
36for 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"
45done
46
47if [ "$PLOT_LINE"x != "x" ]; then
48 echo Making slat logs $PLOT_LINE
Jens Axboe16184952006-06-12 10:28:06 +020049 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 Axboeebac4652005-12-08 15:25:21 +010050fi
51
52PLOT_LINE=""
53for 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"
62done
63
64if [ "$PLOT_LINE"x != "x" ]; then
65 echo Making clat logs $PLOT_LINE
Jens Axboe16184952006-06-12 10:28:06 +020066 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 Axboeebac4652005-12-08 15:25:21 +010067fi