From 32deaac975b42586e329c1d280c2afedd095b153 Mon Sep 17 00:00:00 2001 From: Erwan Velu Date: Thu, 1 Aug 2013 13:41:02 +0200 Subject: [PATCH 1/1] 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. --- tools/plot/fio2gnuplot.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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 -- 2.25.1