From: Sitsofe Wheeler Date: Mon, 26 Jun 2017 23:04:40 +0000 (+0100) Subject: stat: fix group percentage X-Git-Tag: fio-2.99~26 X-Git-Url: https://git.kernel.dk/?p=fio.git;a=commitdiff_plain;h=db84b73bd7b0c3b718596fbeb6a5f940b05a6735;hp=29eb371b1d2b436e252c6e3e20981d88f7b1cd3f;ds=inline stat: fix group percentage When af7f87cb59fb3fc29a7d9f56f03f7b42680a45f2 converted group stats to bytes it broke the group percentage calculation because the mean is in kilobytes but the aggregate bandwidth is in kilobytes. Fix this by converting aggregate bandwidth to kilobytes when calculating the thread's group percentage. Signed-off-by: Sitsofe Wheeler --- diff --git a/stat.c b/stat.c index d496e8f9..beec574d 100644 --- a/stat.c +++ b/stat.c @@ -483,7 +483,7 @@ static void show_ddir_status(struct group_run_stats *rs, struct thread_stat *ts, } if (rs->agg[ddir]) { - p_of_agg = mean * 100 / (double) rs->agg[ddir]; + p_of_agg = mean * 100 / (double) (rs->agg[ddir] / 1024); if (p_of_agg > 100.0) p_of_agg = 100.0; }