blob: 611f49fc0eec2e812a4df79c181d595820986286 [file] [log] [blame]
YAMAMOTO Takashi40cfddb2010-06-02 08:24:03 +02001#! /bin/sh
Jens Axboeebac4652005-12-08 15:25:21 +01002
3# Use gnuplot to generate plots from fio run with -l and/or -w
4
YAMAMOTO Takashi40cfddb2010-06-02 08:24:03 +02005if [ "$1"x = "x" ]; then
Jens Axboeebac4652005-12-08 15:25:21 +01006 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
Jens Axboe84f83172008-04-04 23:15:19 +020023 PT=$(echo $i | sed s/_bw.log//g)
Jens Axboeebac4652005-12-08 15:25:21 +010024 if [ "$PLOT_LINE"x != "x" ]; then
25 PLOT_LINE=$PLOT_LINE", "
26 fi
27
Jens Axboe84f83172008-04-04 23:15:19 +020028 PLOT_LINE=$PLOT_LINE"'$i' title '$PT' with lines"
Jens Axboeebac4652005-12-08 15:25:21 +010029done
30
31if [ "$PLOT_LINE"x != "x" ]; then
32 echo Making bw logs
Jens Axboeb22989b2009-07-17 22:29:23 +020033 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 Axboeebac4652005-12-08 15:25:21 +010034fi
35
36PLOT_LINE=""
37for i in *slat.log; do
38 if [ ! -r $i ]; then
39 continue
40 fi
Jens Axboe84f83172008-04-04 23:15:19 +020041 PT=$(echo $i | sed s/_slat.log//g)
Jens Axboeebac4652005-12-08 15:25:21 +010042 if [ "$PLOT_LINE"x != "x" ]; then
43 PLOT_LINE=$PLOT_LINE", "
44 fi
45
Jens Axboe84f83172008-04-04 23:15:19 +020046 PLOT_LINE=$PLOT_LINE"'$i' title '$PT' with lines"
Jens Axboeebac4652005-12-08 15:25:21 +010047done
48
49if [ "$PLOT_LINE"x != "x" ]; then
50 echo Making slat logs $PLOT_LINE
Jens Axboe16184952006-06-12 10:28:06 +020051 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 +010052fi
53
54PLOT_LINE=""
55for i in *clat.log; do
56 if [ ! -r $i ]; then
57 continue
58 fi
Jens Axboe84f83172008-04-04 23:15:19 +020059 PT=$(echo $i | sed s/_clat.log//g)
Jens Axboeebac4652005-12-08 15:25:21 +010060 if [ "$PLOT_LINE"x != "x" ]; then
61 PLOT_LINE=$PLOT_LINE", "
62 fi
63
Jens Axboe84f83172008-04-04 23:15:19 +020064 PLOT_LINE=$PLOT_LINE"'$i' title '$PT' with lines"
Jens Axboeebac4652005-12-08 15:25:21 +010065done
66
67if [ "$PLOT_LINE"x != "x" ]; then
68 echo Making clat logs $PLOT_LINE
Jens Axboe16184952006-06-12 10:28:06 +020069 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 +010070fi
Jens Axboe02af0982010-06-24 09:59:34 +020071
72PLOT_LINE=""
73for 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"
83done
84
85if [ "$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 -
88fi