From: Jens Axboe Date: Thu, 16 Sep 2021 17:41:06 +0000 (-0600) Subject: t/io_uring: fix bandwidth calculation X-Git-Tag: fio-3.29~98 X-Git-Url: https://git.kernel.dk/?p=fio.git;a=commitdiff_plain;h=f3057d268d98aeb638b659a284d087fb0c2f654c t/io_uring: fix bandwidth calculation Fixes: 22fd35012cea ("t/io_uring: Reporting bandwidth") Signed-off-by: Jens Axboe --- diff --git a/t/io_uring.c b/t/io_uring.c index cf59fe37..1adb8789 100644 --- a/t/io_uring.c +++ b/t/io_uring.c @@ -727,7 +727,7 @@ int main(int argc, char *argv[]) unsigned long this_reap = 0; unsigned long this_call = 0; unsigned long rpc = 0, ipc = 0; - unsigned long iops; + unsigned long iops, bw; sleep(1); for (j = 0; j < nthreads; j++) { @@ -742,8 +742,12 @@ int main(int argc, char *argv[]) rpc = ipc = -1; file_depths(fdepths); iops = this_done - done; + if (bs > 1048576) + bw = iops * (bs / 1048576); + else + bw = iops / (1048576 / bs); printf("IOPS=%lu, BW=%luMiB/s, IOS/call=%ld/%ld, inflight=(%s)\n", - iops, iops * (1048576 / bs), rpc, ipc, fdepths); + iops, bw, rpc, ipc, fdepths); done = this_done; calls = this_call; reap = this_reap;