From: Jens Axboe Date: Thu, 5 Apr 2012 14:42:11 +0000 (-0600) Subject: group reporting: fix bad values of min/max X-Git-Tag: fio-2.0.7~2 X-Git-Url: https://git.kernel.dk/?p=fio.git;a=commitdiff_plain;h=c857cfebb50209b950cbc88b4f74714fdf5be75f;hp=885ac623a4f154007efa49266bb381bcbc60f1e6 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 --- 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]; } /*