From 0862f7185bec63bfb780bd0c9c2e95c62eb5e28e Mon Sep 17 00:00:00 2001 From: Jens Axboe Date: Mon, 13 Sep 2021 13:18:26 -0600 Subject: [PATCH] t/io_uring: add -N option for do_nop Makes it easier than asking people to edit and compile. Signed-off-by: Jens Axboe --- t/io_uring.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/t/io_uring.c b/t/io_uring.c index ff0dc609..aed6fdbd 100644 --- a/t/io_uring.c +++ b/t/io_uring.c @@ -553,9 +553,10 @@ 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" + " -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, do_nop); exit(status); } @@ -568,12 +569,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:h?")) != -1) { switch (opt) { case 'd': depth = atoi(optarg); @@ -603,6 +602,9 @@ int main(int argc, char *argv[]) usage(argv[0], 1); } break; + case 'N': + do_nop = !!atoi(optarg); + break; case 'h': case '?': default: -- 2.25.1