blob: 4e2cb08e1045a75a83a8d5a88c7113a2a3153136 [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
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