X-Git-Url: https://git.kernel.dk/?p=fio.git;a=blobdiff_plain;f=tools%2Ffio_generate_plots;h=8872206e5b5b87d4e5b4b062669da54a21f94aee;hp=f65a326c87f52e6647a90988ade23ea092850da0;hb=029e6147e9005ddb08774193aa8b3a01174007b1;hpb=0460eb92b25b65a9e99ce4fd61d1536bff255331;ds=sidebyside diff --git a/tools/fio_generate_plots b/tools/fio_generate_plots index f65a326c..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. # @@ -22,7 +22,7 @@ if [ -z "$1" ]; then fi GNUPLOT=$(which gnuplot) -if [ ! -x $GNUPLOT ] +if [ ! -x "$GNUPLOT" ] then echo You need gnuplot installed to generate graphs exit 1 @@ -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 -