blob: 21d7c6a9a2fd77f8731146b2434f0a1947dc1382 [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
Martin Steigerwald4d1577b2011-08-05 19:47:51 +02006 echo "Usage: fio_generate_plots title [xres yres]"
Jens Axboeebac4652005-12-08 15:25:21 +01007 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
Martin Steigerwald4d1577b2011-08-05 19:47:51 +020018# set resolution
19if [ "$2"x != "x" -a "$3"x != "x" ]; then
20 XRES="$2"
21 YRES="$3"
22else
23 XRES=1024
24 YRES=768
25fi
26
Jens Axboeebac4652005-12-08 15:25:21 +010027PLOT_LINE=""
28for i in *bw.log; do
29 if [ ! -r $i ]; then
30 continue
31 fi
Jens Axboe84f83172008-04-04 23:15:19 +020032 PT=$(echo $i | sed s/_bw.log//g)
Jens Axboeebac4652005-12-08 15:25:21 +010033 if [ "$PLOT_LINE"x != "x" ]; then
34 PLOT_LINE=$PLOT_LINE", "
35 fi
36
Jens Axboe84f83172008-04-04 23:15:19 +020037 PLOT_LINE=$PLOT_LINE"'$i' title '$PT' with lines"
Jens Axboeebac4652005-12-08 15:25:21 +010038done
39
40if [ "$PLOT_LINE"x != "x" ]; then
41 echo Making bw logs
Martin Steigerwald4d1577b2011-08-05 19:47:51 +020042 echo "set title 'Bandwidth - $TITLE'; set xlabel 'time (msec)'; set ylabel 'KB/sec'; set terminal png size $XRES,$YRES; set output '$TITLE-bw.png'; plot " $PLOT_LINE | $GNUPLOT -
Jens Axboeebac4652005-12-08 15:25:21 +010043fi
44
45PLOT_LINE=""
46for i in *slat.log; do
47 if [ ! -r $i ]; then
48 continue
49 fi
Jens Axboe84f83172008-04-04 23:15:19 +020050 PT=$(echo $i | sed s/_slat.log//g)
Jens Axboeebac4652005-12-08 15:25:21 +010051 if [ "$PLOT_LINE"x != "x" ]; then
52 PLOT_LINE=$PLOT_LINE", "
53 fi
54
Jens Axboe84f83172008-04-04 23:15:19 +020055 PLOT_LINE=$PLOT_LINE"'$i' title '$PT' with lines"
Jens Axboeebac4652005-12-08 15:25:21 +010056done
57
58if [ "$PLOT_LINE"x != "x" ]; then
59 echo Making slat logs $PLOT_LINE
Martin Steigerwald4d1577b2011-08-05 19:47:51 +020060 echo "set title 'Submission latency - $TITLE'; set xlabel 'time (msec)'; set ylabel 'latency (msec)'; set terminal png size $XRES,$YRES; set output '$TITLE-slat.png'; plot " $PLOT_LINE | $GNUPLOT -
Jens Axboeebac4652005-12-08 15:25:21 +010061fi
62
63PLOT_LINE=""
64for i in *clat.log; do
65 if [ ! -r $i ]; then
66 continue
67 fi
Jens Axboe84f83172008-04-04 23:15:19 +020068 PT=$(echo $i | sed s/_clat.log//g)
Jens Axboeebac4652005-12-08 15:25:21 +010069 if [ "$PLOT_LINE"x != "x" ]; then
70 PLOT_LINE=$PLOT_LINE", "
71 fi
72
Jens Axboe84f83172008-04-04 23:15:19 +020073 PLOT_LINE=$PLOT_LINE"'$i' title '$PT' with lines"
Jens Axboeebac4652005-12-08 15:25:21 +010074done
75
76if [ "$PLOT_LINE"x != "x" ]; then
77 echo Making clat logs $PLOT_LINE
Martin Steigerwald4d1577b2011-08-05 19:47:51 +020078 echo "set title 'Completion latency - $TITLE'; set xlabel 'time (msec)'; set ylabel 'latency (msec)'; set terminal png size $XRES,$YRES; set output '$TITLE-clat.png'; plot " $PLOT_LINE | $GNUPLOT -
Jens Axboeebac4652005-12-08 15:25:21 +010079fi
Jens Axboe02af0982010-06-24 09:59:34 +020080
81PLOT_LINE=""
82for i in *_lat.log; do
83 if [ ! -r $i ]; then
84 continue
85 fi
86 PT=$(echo $i | sed s/_lat.log//g)
87 if [ "$PLOT_LINE"x != "x" ]; then
88 PLOT_LINE=$PLOT_LINE", "
89 fi
90
91 PLOT_LINE=$PLOT_LINE"'$i' title '$PT' with lines"
92done
93
94if [ "$PLOT_LINE"x != "x" ]; then
95 echo Making lat logs $PLOT_LINE
Martin Steigerwald4d1577b2011-08-05 19:47:51 +020096 echo "set title 'Latency - $TITLE'; set xlabel 'time (msec)'; set ylabel 'latency (msec)'; set terminal png size $XRES,$YRES; set output '$TITLE-lat.png'; plot " $PLOT_LINE | $GNUPLOT -
Jens Axboe02af0982010-06-24 09:59:34 +020097fi