t/io_uring: make submits/reaps per-second reflected with sq thread poll
authorJens Axboe <axboe@kernel.dk>
Fri, 11 Jan 2019 04:38:35 +0000 (21:38 -0700)
committerJens Axboe <axboe@kernel.dk>
Fri, 11 Jan 2019 04:40:34 +0000 (21:40 -0700)
If we use polling, the numbers currently read as 0. Make them -1 to
reflect that we're actually doing zero calls per IO.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
t/io_uring.c

index 58a1c458b866537c0302a7f15bb854474aebac81..976d4046bedd8349f1cb8eee9028dc3110c4589e 100644 (file)
@@ -514,8 +514,9 @@ int main(int argc, char *argv[])
                if (this_call - calls) {
                        rpc = (this_done - done) / (this_call - calls);
                        ipc = (this_reap - reap) / (this_call - calls);
-               }
-               printf("IOPS=%lu, IOS/call=%lu/%lu, inflight=%u (head=%u tail=%u), Cachehit=%0.2f%%\n",
+               } else
+                       rpc = ipc = -1;
+               printf("IOPS=%lu, IOS/call=%ld/%ld, inflight=%u (head=%u tail=%u), Cachehit=%0.2f%%\n",
                                this_done - done, rpc, ipc, s->inflight,
                                *s->cq_ring.head, *s->cq_ring.tail, hit);
                done = this_done;