More fio.h cleanups
[fio.git] / fio_generate_plots
CommitLineData
ebac4655
JA
1#!/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
1618495b
JA
10GNUPLOT=$(which gnuplot)
11if [ ! -x $GNUPLOT ]; then
12 echo You need gnuplot installed to generate graphs
13 exit 1
14fi
15
ebac4655
JA
16TITLE=$1
17
18PLOT_LINE=""
19for i in *bw.log; do
20 if [ ! -r $i ]; then
21 continue
22 fi
84f83179 23 PT=$(echo $i | sed s/_bw.log//g)
ebac4655
JA
24 if [ "$PLOT_LINE"x != "x" ]; then
25 PLOT_LINE=$PLOT_LINE", "
26 fi
27
84f83179 28 PLOT_LINE=$PLOT_LINE"'$i' title '$PT' with lines"
ebac4655
JA
29done
30
31if [ "$PLOT_LINE"x != "x" ]; then
32 echo Making bw logs
1618495b 33 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 -
ebac4655
JA
34fi
35
36PLOT_LINE=""
37for i in *slat.log; do
38 if [ ! -r $i ]; then
39 continue
40 fi
84f83179 41 PT=$(echo $i | sed s/_slat.log//g)
ebac4655
JA
42 if [ "$PLOT_LINE"x != "x" ]; then
43 PLOT_LINE=$PLOT_LINE", "
44 fi
45
84f83179 46 PLOT_LINE=$PLOT_LINE"'$i' title '$PT' with lines"
ebac4655
JA
47done
48
49if [ "$PLOT_LINE"x != "x" ]; then
50 echo Making slat logs $PLOT_LINE
1618495b 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 -
ebac4655
JA
52fi
53
54PLOT_LINE=""
55for i in *clat.log; do
56 if [ ! -r $i ]; then
57 continue
58 fi
84f83179 59 PT=$(echo $i | sed s/_clat.log//g)
ebac4655
JA
60 if [ "$PLOT_LINE"x != "x" ]; then
61 PLOT_LINE=$PLOT_LINE", "
62 fi
63
84f83179 64 PLOT_LINE=$PLOT_LINE"'$i' title '$PT' with lines"
ebac4655
JA
65done
66
67if [ "$PLOT_LINE"x != "x" ]; then
68 echo Making clat logs $PLOT_LINE
1618495b 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 -
ebac4655 70fi