Some more bits of blktrace support
[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
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
1618495b 32 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
33fi
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
1618495b 49 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
50fi
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
1618495b 66 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 67fi