tool: add the config for interval of real time perf display

There used to be a fixed 1 second of real time performance
display with the "-S" parameter. Make it as a configurable
parameter, the minimum interval is still 1 second while user
can configure a larger value.

Change-Id: I159d867f2b6019b095d0291c436f01b110ff69d8
Signed-off-by: GangCao <gang.cao@intel.com>
Reviewed-on: https://review.gerrithub.io/393306
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
This commit is contained in:
GangCao 2017-12-30 05:15:30 -05:00 committed by Jim Harris
parent fc03485b9d
commit 3166267411

View File

@ -556,7 +556,7 @@ static void usage(char *program_name)
printf("\t\t(read, write, randread, randwrite, rw, randrw, verify, reset)]\n");
printf("\t[-M rwmixread (100 for reads, 0 for writes)]\n");
printf("\t[-t time in seconds]\n");
printf("\t[-S Show performance result in real time]\n");
printf("\t[-S Show performance result in real time in seconds]\n");
}
static void
@ -746,6 +746,7 @@ main(int argc, char **argv)
bool mix_specified;
struct spdk_app_opts opts = {};
int time_in_sec;
uint64_t show_performance_period_in_usec = 0;
/* default value */
config_file = NULL;
@ -756,7 +757,7 @@ main(int argc, char **argv)
mix_specified = false;
core_mask = NULL;
while ((op = getopt(argc, argv, "c:d:m:q:s:t:w:M:S")) != -1) {
while ((op = getopt(argc, argv, "c:d:m:q:s:t:w:M:S:")) != -1) {
switch (op) {
case 'c':
config_file = optarg;
@ -785,6 +786,9 @@ main(int argc, char **argv)
break;
case 'S':
g_show_performance_real_time = 1;
show_performance_period_in_usec = atoi(optarg) * 1000000;
g_show_performance_period_in_usec = spdk_max(g_show_performance_period_in_usec,
show_performance_period_in_usec);
break;
default:
usage(argv[0]);