X-Git-Url: https://git.kernel.dk/?a=blobdiff_plain;f=tools%2Ffio_generate_plots;h=8872206e5b5b87d4e5b4b062669da54a21f94aee;hb=b4f5e72f1383499439c45acee627c022f06b6825;hp=51c0643aaca3fb8b8d85a74926d46767daf46403;hpb=bd33a2f5f6b20e6e7eddc6e1e896c4f12daec9bb;p=fio.git diff --git a/tools/fio_generate_plots b/tools/fio_generate_plots index 51c0643a..8872206e 100755 --- a/tools/fio_generate_plots +++ b/tools/fio_generate_plots @@ -7,7 +7,7 @@ # # The script uses the files generated by FIO to create nice graphs in the # SVG format. This output format is supported by most modern browsers and -# allows resolution independant graphs to be generated. +# allows resolution independent graphs to be generated. # # This script supports GNUPLOT 4.4 and higher. # @@ -93,20 +93,26 @@ plot () { i=0 - for x in *_"$FILETYPE".log + for x in *_"$FILETYPE".log *_"$FILETYPE".*.log do - i=$((i+1)) - PT=$(echo $x | sed s/_"$FILETYPE".log//g) - if [ ! -z "$PLOT_LINE" ] - then - PLOT_LINE=$PLOT_LINE", " + if [ -e "$x" ]; then + i=$((i+1)) + PT=$(echo $x | sed 's/\(.*\)_'$FILETYPE'\(.*\).log$/\1\2/') + if [ ! -z "$PLOT_LINE" ] + then + PLOT_LINE=$PLOT_LINE", " + fi + + DEPTH=$(echo $PT | cut -d "-" -f 4) + PLOT_LINE=$PLOT_LINE"'$x' using (\$1/1000):(\$2/$SCALE) title \"Queue depth $DEPTH\" with lines ls $i" fi - - DEPTH=$(echo $PT | cut -d "-" -f 4) - PLOT_LINE=$PLOT_LINE"'$x' using (\$1/1000):(\$2/$SCALE) title \"Queue depth $DEPTH\" with lines ls $i" - done + if [ $i -eq 0 ]; then + echo "No log files found" + exit 1 + fi + OUTPUT="set output \"$TITLE-$FILETYPE.svg\" " echo " $PLOT_TITLE ; $YAXIS ; $DEFAULT_OPTS ; show style lines ; $OUTPUT ; plot " $PLOT_LINE | $GNUPLOT -