X-Git-Url: https://git.kernel.dk/?p=fio.git;a=blobdiff_plain;f=fio_generate_plots;h=4285415eac2879da04850369a6aab7a067c5518f;hp=4ae1d0affe6cb52260bbe0706939112aeab70aa9;hb=8c43656071208e1a14801b1ecfd0e4b0eadd6a4e;hpb=1618495b30517fb10f6e47c052689dc57ff78df7 diff --git a/fio_generate_plots b/fio_generate_plots index 4ae1d0af..4285415e 100755 --- a/fio_generate_plots +++ b/fio_generate_plots @@ -1,9 +1,9 @@ -#!/bin/bash +#! /bin/sh # Use gnuplot to generate plots from fio run with -l and/or -w -if [ "$1"x == "x" ]; then - echo Need title as arg +if [ "$1"x = "x" ]; then + echo "Usage: fio_generate_plots title [xres yres]" exit 1 fi @@ -15,21 +15,49 @@ fi TITLE=$1 +# set resolution +if [ "$2"x != "x" -a "$3"x != "x" ]; then + XRES="$2" + YRES="$3" +else + XRES=1024 + YRES=768 +fi + PLOT_LINE="" 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 size $XRES,$YRES; set output '$TITLE-bw.png'; plot " $PLOT_LINE | $GNUPLOT - +fi + +PLOT_LINE="" +for i in *iops.log; do + if [ ! -r $i ]; then + continue + fi + PT=$(echo $i | sed s/_iops.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 bw logs + echo "set title 'IOPS - $TITLE'; set xlabel 'time (msec)'; set ylabel 'IOPS'; set terminal png size $XRES,$YRES; set output '$TITLE-IOPS.png'; plot " $PLOT_LINE | $GNUPLOT - fi PLOT_LINE="" @@ -37,16 +65,17 @@ 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 echo Making slat logs $PLOT_LINE - 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 - + echo "set title 'Submission latency - $TITLE'; set xlabel 'time (msec)'; set ylabel 'latency (msec)'; set terminal png size $XRES,$YRES; set output '$TITLE-slat.png'; plot " $PLOT_LINE | $GNUPLOT - fi PLOT_LINE="" @@ -54,14 +83,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 - + echo "set title 'Completion latency - $TITLE'; set xlabel 'time (msec)'; set ylabel 'latency (msec)'; set terminal png size $XRES,$YRES; 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 size $XRES,$YRES; set output '$TITLE-lat.png'; plot " $PLOT_LINE | $GNUPLOT - fi