X-Git-Url: https://git.kernel.dk/?p=fio.git;a=blobdiff_plain;f=t%2Fio_uring.c;h=d563638019ad87edff09d3d7944a553bd145add8;hp=ff0dc609d45597999af4a962c1902ed9d25eb88f;hb=6c5d3a1c08bda1bbf22187c7b80573400e1c1053;hpb=2ac0058528e83b5a6be515c1b1772cedab12a6de diff --git a/t/io_uring.c b/t/io_uring.c index ff0dc609..d5636380 100644 --- a/t/io_uring.c +++ b/t/io_uring.c @@ -553,9 +553,11 @@ static void usage(char *argv, int status) " -p : Polled IO, default %d\n" " -B : Fixed buffers, default %d\n" " -F : Register files, default %d\n" - " -n : Number of threads, default %d\n", + " -n : Number of threads, default %d\n" + " -O : Use O_DIRECT, default %d\n" + " -N : Perform just no-op requests, default %d\n", argv, DEPTH, BATCH_SUBMIT, BATCH_COMPLETE, BS, polled, - fixedbufs, register_files, nthreads); + fixedbufs, register_files, nthreads, !buffered, do_nop); exit(status); } @@ -568,12 +570,10 @@ int main(int argc, char *argv[]) char *fdepths; void *ret; - if (!do_nop && argc < 2) { - printf("%s: filename [options]\n", argv[0]); - return 1; - } + if (!do_nop && argc < 2) + usage(argv[0], 1); - while ((opt = getopt(argc, argv, "d:s:c:b:p:B:F:n:h?")) != -1) { + while ((opt = getopt(argc, argv, "d:s:c:b:p:B:F:n:N:O:h?")) != -1) { switch (opt) { case 'd': depth = atoi(optarg); @@ -603,6 +603,12 @@ int main(int argc, char *argv[]) usage(argv[0], 1); } break; + case 'N': + do_nop = !!atoi(optarg); + break; + case 'O': + buffered = !atoi(optarg); + break; case 'h': case '?': default: @@ -611,6 +617,11 @@ int main(int argc, char *argv[]) } } + if (batch_complete > depth) + batch_complete = depth; + if (batch_submit > depth) + batch_submit = depth; + submitter = calloc(nthreads, sizeof(*submitter) + depth * sizeof(struct iovec)); for (j = 0; j < nthreads; j++) { @@ -721,6 +732,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, bw; sleep(1); for (j = 0; j < nthreads; j++) { @@ -734,8 +746,15 @@ int main(int argc, char *argv[]) } else rpc = ipc = -1; file_depths(fdepths); - printf("IOPS=%lu, IOS/call=%ld/%ld, inflight=(%s)\n", - this_done - done, rpc, ipc, fdepths); + iops = this_done - done; + if (bs > 1048576) + bw = iops * (bs / 1048576); + else + bw = iops / (1048576 / bs); + printf("IOPS=%lu, ", iops); + if (!do_nop) + printf("BW=%luMiB/s, ", bw); + printf("IOS/call=%ld/%ld, inflight=(%s)\n", rpc, ipc, fdepths); done = this_done; calls = this_call; reap = this_reap;