From 39592d7b20a31e74b29e44ab1c2992074e49e4b4 Mon Sep 17 00:00:00 2001 From: Dariusz Stojaczyk Date: Thu, 9 Aug 2018 13:54:39 +0200 Subject: [PATCH] bdevperf: parse all available cmdline options '-s' option (io size) had to be changed to '-o' as it conflicts with mem-size. Change-Id: I7486f30ce7d836a6e465e07f723877facb4f8536 Signed-off-by: Dariusz Stojaczyk Reviewed-on: https://review.gerrithub.io/421736 Chandler-Test-Pool: SPDK Automated Test System Tested-by: SPDK CI Jenkins Reviewed-by: Jim Harris Reviewed-by: Ben Walker --- test/bdev/bdevperf/bdevperf.c | 250 +++++++++++--------------- test/bdev/blockdev.sh | 4 +- test/bdev/common.c | 49 ----- test/iscsi_tgt/initiator/initiator.sh | 8 +- test/nvmf/host/bdevperf.sh | 2 +- 5 files changed, 111 insertions(+), 202 deletions(-) delete mode 100644 test/bdev/common.c diff --git a/test/bdev/bdevperf/bdevperf.c b/test/bdev/bdevperf/bdevperf.c index a1b250c91..f090cdcd8 100644 --- a/test/bdev/bdevperf/bdevperf.c +++ b/test/bdev/bdevperf/bdevperf.c @@ -53,6 +53,7 @@ struct bdevperf_task { struct spdk_bdev_io_wait_entry bdev_io_wait; }; +static const char *g_workload_type; static int g_io_size = 0; /* initialize to invalid value so we can detect if user overrides it. */ static int g_rw_percentage = -1; @@ -71,15 +72,14 @@ static bool g_run_failed = false; static bool g_shutdown = false; static uint64_t g_shutdown_tsc; static bool g_zcopy = true; -static int g_mem_size = 0; static unsigned g_master_core; +static int g_time_in_sec; +static bool g_mix_specified; static struct spdk_poller *g_perf_timer = NULL; static void bdevperf_submit_single(struct io_target *target, struct bdevperf_task *task); -#include "../common.c" - struct io_target { char *name; struct spdk_bdev *bdev; @@ -582,25 +582,19 @@ bdevperf_submit_on_core(void *arg1, void *arg2) } } -static void usage(char *program_name) +static void +bdevperf_usage(void) { - printf("%s options\n", program_name); - printf("\t[-c configuration file]\n"); - printf("\t[-d memory size in MB]\n"); - printf("\t[-m core mask for distributing I/O submission/completion work\n"); - printf("\t\t(default: 0x1 - use core 0 only)]\n"); - printf("\t[-q io depth]\n"); - printf("\t[-s io size in bytes]\n"); - printf("\t[-w io pattern type, must be one of\n"); - printf("\t\t(read, write, randread, randwrite, rw, randrw, verify, reset, unmap, flush)]\n"); - printf("\t[-M rwmixread (100 for reads, 0 for writes)]\n"); - printf("\t[-t time in seconds]\n"); - printf("\t[-P Number of moving average period]\n"); + printf(" -q io depth\n"); + printf(" -o io size in bytes\n"); + printf(" -w io pattern type, must be one of (read, write, randread, randwrite, rw, randrw, verify, reset, unmap, flush)\n"); + printf(" -t