fio2gnuplot: Keep original filename in temp. files
authorErwan Velu <erwan@enovance.com>
Mon, 22 Jul 2013 10:54:39 +0000 (12:54 +0200)
committerErwan Velu <erwan@enovance.com>
Mon, 22 Jul 2013 17:39:24 +0000 (19:39 +0200)
It was pretty hard to understand what trace file was linked to which fio
output file. This simple commit add a simpler header to inform the
debugger which fio outputfile got used.

tools/plot/fio2gnuplot.py

index ef32ee0b156dac047cef5ee0cd71fd60214b35fa..5e32045dde1bcc0440dd5d83f1bcb059838a1ee5 100755 (executable)
@@ -91,7 +91,9 @@ def compute_temp_file(fio_data_file,disk_perf):
                files.append(open(file))
                pos = len(files) - 1
                tmp_filename = "gnuplot_temp_file.%d" % pos
-               temp_outfile.append(open(tmp_filename,'w'))
+               gnuplot_file=open(tmp_filename,'w')
+               temp_outfile.append(gnuplot_file)
+               gnuplot_file.write("#Temporary file based on file %s\n" % file)
                disk_perf.append([])
 
        shall_break = False