From d270b8bca769c27b8c7d9635f1d301e69e4fa33a Mon Sep 17 00:00:00 2001 From: Erwan Velu Date: Fri, 12 Jul 2013 14:24:26 +0200 Subject: [PATCH] fio2gnuplot: Don't graph 3D if not enough data If the matching pattern doesn't get more than a single file, 3D plotting doesn't have any meaning and confuse gnuplot. So let's disable the 3D plotting if a single file matched the pattern. --- tools/plot/fio2gnuplot.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/plot/fio2gnuplot.py b/tools/plot/fio2gnuplot.py index c1a5cfb0..ef32ee0b 100755 --- a/tools/plot/fio2gnuplot.py +++ b/tools/plot/fio2gnuplot.py @@ -39,7 +39,8 @@ def find_file(path, pattern): def generate_gnuplot_script(fio_data_file,title,gnuplot_output_filename,mode,disk_perf): f=open("mygraph",'w') - f.write("call \'graph3D.gpm\' \'%s' \'%s\' \'\' \'%s\' \'%s\'\n" % (title,gnuplot_output_filename,gnuplot_output_filename,mode)) + if len(fio_data_file) > 1: + f.write("call \'graph3D.gpm\' \'%s' \'%s\' \'\' \'%s\' \'%s\'\n" % (title,gnuplot_output_filename,gnuplot_output_filename,mode)) pos=0 # Let's create a temporary file for each selected fio file -- 2.25.1