Merge branch 'master' of ssh://brick.kernel.dk/data/git/fio
[fio.git] / fio_generate_plots
index 4ae1d0affe6cb52260bbe0706939112aeab70aa9..611f49fc0eec2e812a4df79c181d595820986286 100755 (executable)
@@ -1,8 +1,8 @@
-#!/bin/bash
+#! /bin/sh
 
 # Use gnuplot to generate plots from fio run with -l and/or -w
 
-if [ "$1"x == "x" ]; then
+if [ "$1"x = "x" ]; then
        echo Need title as arg
        exit 1
 fi
@@ -20,16 +20,17 @@ for i in *bw.log; do
        if [ ! -r $i ]; then
                continue
        fi
+       PT=$(echo $i | sed s/_bw.log//g)
        if [ "$PLOT_LINE"x != "x" ]; then
                PLOT_LINE=$PLOT_LINE", "
        fi
 
-       PLOT_LINE=$PLOT_LINE"'$i' with lines"
+       PLOT_LINE=$PLOT_LINE"'$i' title '$PT' with lines"
 done
 
 if [ "$PLOT_LINE"x != "x" ]; then
        echo Making bw logs
-       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 -
+       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 -
 fi
 
 PLOT_LINE=""
@@ -37,11 +38,12 @@ for i in *slat.log; do
        if [ ! -r $i ]; then
                continue
        fi
+       PT=$(echo $i | sed s/_slat.log//g)
        if [ "$PLOT_LINE"x != "x" ]; then
                PLOT_LINE=$PLOT_LINE", "
        fi
 
-       PLOT_LINE=$PLOT_LINE"'$i' with lines"
+       PLOT_LINE=$PLOT_LINE"'$i' title '$PT' with lines"
 done
 
 if [ "$PLOT_LINE"x != "x" ]; then
@@ -54,14 +56,33 @@ for i in *clat.log; do
        if [ ! -r $i ]; then
                continue
        fi
+       PT=$(echo $i | sed s/_clat.log//g)
        if [ "$PLOT_LINE"x != "x" ]; then
                PLOT_LINE=$PLOT_LINE", "
        fi
 
-       PLOT_LINE=$PLOT_LINE"'$i' with lines"
+       PLOT_LINE=$PLOT_LINE"'$i' title '$PT' with lines"
 done
 
 if [ "$PLOT_LINE"x != "x" ]; then
        echo Making clat logs $PLOT_LINE
        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 -
 fi
+
+PLOT_LINE=""
+for i in *_lat.log; do
+       if [ ! -r $i ]; then
+               continue
+       fi
+       PT=$(echo $i | sed s/_lat.log//g)
+       if [ "$PLOT_LINE"x != "x" ]; then
+               PLOT_LINE=$PLOT_LINE", "
+       fi
+
+       PLOT_LINE=$PLOT_LINE"'$i' title '$PT' with lines"
+done
+
+if [ "$PLOT_LINE"x != "x" ]; then
+       echo Making lat logs $PLOT_LINE
+       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 -
+fi