From: Erwan Velu Date: Thu, 1 Aug 2013 11:41:02 +0000 (+0200) Subject: fio2gnuplot: Print line if int() conversion fails X-Git-Tag: fio-2.1.2~7 X-Git-Url: https://git.kernel.dk/?p=fio.git;a=commitdiff_plain;h=32deaac975b42586e329c1d280c2afedd095b153 fio2gnuplot: Print line if int() conversion fails When data aren't properly formated the int() conversion could fails but doesn't print the impacted line which is pretty difficult to estimate where the bug is. This patch simply reports the line that cause the trouble. --- diff --git a/tools/plot/fio2gnuplot.py b/tools/plot/fio2gnuplot.py index 4be011d2..c0579917 100755 --- a/tools/plot/fio2gnuplot.py +++ b/tools/plot/fio2gnuplot.py @@ -179,7 +179,12 @@ def compute_temp_file(fio_data_file,disk_perf,gnuplot_output_dir): for line in current_line: time, perf, x, block_size = line if (blk_size == 0): - blk_size=int(block_size) + try: + blk_size=int(block_size) + except: + print "Error while reading the following line :" + print line + sys.exit(1); # We ignore the first 500msec as it doesn't seems to be part of the real benchmark # Time < 500 usually reports BW=0 breaking the min computing