X-Git-Url: https://git.kernel.dk/?p=fio.git;a=blobdiff_plain;f=tools%2Fplot%2Ffio2gnuplot.py;h=5e4feed354be750cb69b9af694287ae584719f53;hp=64b41c184897bf387bc3a6133abc04602a971445;hb=2fa23380f66add1ca85ff37f41de51cfbd0fc7b1;hpb=b68e5f80e8804a689ad438a17d8e87fe5089cee1 diff --git a/tools/plot/fio2gnuplot.py b/tools/plot/fio2gnuplot.py index 64b41c18..5e4feed3 100755 --- a/tools/plot/fio2gnuplot.py +++ b/tools/plot/fio2gnuplot.py @@ -39,8 +39,9 @@ def find_file(path, pattern): return fio_data_file def generate_gnuplot_script(fio_data_file,title,gnuplot_output_filename,gnuplot_output_dir,mode,disk_perf,gpm_dir): - print "Generating rendering scripts" + if verbose: print "Generating rendering scripts" filename=gnuplot_output_dir+'mygraph' + temporary_files.append(filename) f=open(filename,'w') # Plotting 3D or comparing graphs doesn't have a meaning unless if there is at least 2 traces @@ -64,9 +65,13 @@ set style line 1 lt 1 lw 3 pt 3 linecolor rgb "green" compare_raw_filename="compare-%s-2Draw" % (gnuplot_output_filename) compare_smooth_filename="compare-%s-2Dsmooth" % (gnuplot_output_filename) compare_trend_filename="compare-%s-2Dtrend" % (gnuplot_output_filename) + shutil.copy(gnuplot_output_dir+'compare.gnuplot',gnuplot_output_dir+compare_raw_filename+".gnuplot") shutil.copy(gnuplot_output_dir+'compare.gnuplot',gnuplot_output_dir+compare_smooth_filename+".gnuplot") shutil.copy(gnuplot_output_dir+'compare.gnuplot',gnuplot_output_dir+compare_trend_filename+".gnuplot") + temporary_files.append(gnuplot_output_dir+compare_raw_filename+".gnuplot") + temporary_files.append(gnuplot_output_dir+compare_smooth_filename+".gnuplot") + temporary_files.append(gnuplot_output_dir+compare_trend_filename+".gnuplot") #Setting up a different output filename for each kind of graph compare_raw=open(gnuplot_output_dir+compare_raw_filename + ".gnuplot",'a') @@ -113,12 +118,13 @@ set style line 1 lt 1 lw 3 pt 3 linecolor rgb "green" def generate_gnuplot_math_script(title,gnuplot_output_filename,mode,average,gnuplot_output_dir,gpm_dir): filename=gnuplot_output_dir+'mymath'; + temporary_files.append(filename) f=open(filename,'a') f.write("call \'%s/math.gpm\' \'%s' \'%s\' \'\' \'%s\' \'%s\' %s\n" % (gpm_dir,title,gnuplot_output_filename,gnuplot_output_filename,mode,average)) f.close() def compute_aggregated_file(fio_data_file, gnuplot_output_filename, gnuplot_output_dir): - print "Processing data file 2/2" + if verbose: print "Processing data file 2/2" temp_files=[] pos=0 @@ -129,6 +135,7 @@ def compute_aggregated_file(fio_data_file, gnuplot_output_filename, gnuplot_outp pos = pos +1 f = open(gnuplot_output_dir+gnuplot_output_filename, "w") + temporary_files.append(gnuplot_output_dir+gnuplot_output_filename) index=0 # Let's add some information for tempfile in temp_files: @@ -145,7 +152,7 @@ def compute_temp_file(fio_data_file,disk_perf,gnuplot_output_dir, min_time, max_ end_time=max_time if end_time == -1: end_time="infinite" - print "Processing data file 1/2 with %s 1: - print " |-> Rendering comparing traces" + if verbose: print " |-> Rendering comparing traces" os.system("cd %s; for i in *.gnuplot; do gnuplot $i; done" % gnuplot_output_dir) - print " |-> Rendering math traces" + if verbose: print " |-> Rendering math traces" os.system("cd %s; gnuplot mymath" % gnuplot_output_dir) - print " |-> Rendering 2D & 3D traces" + if verbose: print " |-> Rendering 2D & 3D traces" os.system("cd %s; gnuplot mygraph" % gnuplot_output_dir) name_of_directory="the current" if gnuplot_output_dir != "./": name_of_directory=gnuplot_output_dir print "\nRendering traces are available in %s directory" % name_of_directory + global keep_temp_files + keep_temp_files=False except: print "Could not run gnuplot on mymath or mygraph !\n" sys.exit(1); @@ -360,6 +375,7 @@ def print_help(): print ' - The .global extension is added automatically to the pattern' print '-m or --min_time