From c857cfebb50209b950cbc88b4f74714fdf5be75f Mon Sep 17 00:00:00 2001 From: Jens Axboe Date: Thu, 5 Apr 2012 08:42:11 -0600 Subject: [PATCH] group reporting: fix bad values of min/max If you look at the fio output, the group reporting min and max bandwidth don't match what the actual job reports. This is due to an error in calculating the min and max values. The aggregate value is correct, and matches what the job reports. This did not affect the values that are usually used for reporting, it's only affecting the group run status output. Signed-off-by: Jens Axboe --- stat.c | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/stat.c b/stat.c index 26f45f4d..2ab5f1ad 100644 --- a/stat.c +++ b/stat.c @@ -1045,10 +1045,11 @@ void show_run_stats(void) bw = 0; if (ts->runtime[j]) { - unsigned long runt; + unsigned long runt = ts->runtime[j]; + unsigned long long kb; - runt = ts->runtime[j]; - bw = ts->io_bytes[j] / runt; + kb = ts->io_bytes[j] / rs->kb_base; + bw = kb * 1000 / runt; } if (bw < rs->min_bw[j]) rs->min_bw[j] = bw; @@ -1060,16 +1061,12 @@ void show_run_stats(void) } for (i = 0; i < groupid + 1; i++) { - unsigned long max_run[2]; - rs = &runstats[i]; - max_run[0] = rs->max_run[0]; - max_run[1] = rs->max_run[1]; if (rs->max_run[0]) - rs->agg[0] = (rs->io_kb[0] * 1000) / max_run[0]; + rs->agg[0] = (rs->io_kb[0] * 1000) / rs->max_run[0]; if (rs->max_run[1]) - rs->agg[1] = (rs->io_kb[1] * 1000) / max_run[1]; + rs->agg[1] = (rs->io_kb[1] * 1000) / rs->max_run[1]; } /* -- 2.25.1