From 3f1b35f970acb79a7037fb0cf02fd454e9b2e0c7 Mon Sep 17 00:00:00 2001 From: Ziye Yang Date: Wed, 13 Dec 2017 05:27:17 +0800 Subject: [PATCH] bdevperf: Fix the period performance print info data. This patch does the following things: 1 Set the time period 1 second into a global variable, then if we modify that value, we will make sure that we change it in the whole file. 2 Fix the period performance printing data . We should not pass the time period, but we should pass time period * times, since I/Os completed are caculated from the beginning. Change-Id: I1eaaf1655389cbccefdcc879a51fca94028afdcb Signed-off-by: Ziye Yang Reviewed-on: https://review.gerrithub.io/391421 Tested-by: SPDK Automated Test System Reviewed-by: Jim Harris Reviewed-by: Daniel Verkamp Reviewed-by: Ben Walker --- test/lib/bdev/bdevperf/bdevperf.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/test/lib/bdev/bdevperf/bdevperf.c b/test/lib/bdev/bdevperf/bdevperf.c index 5a6e2d5b0..7bf1131e6 100644 --- a/test/lib/bdev/bdevperf/bdevperf.c +++ b/test/lib/bdev/bdevperf/bdevperf.c @@ -62,6 +62,8 @@ static bool g_unmap = false; static int g_queue_depth; static uint64_t g_time_in_usec; static int g_show_performance_real_time = 0; +static uint64_t g_show_performance_period_in_usec = 1000000; +static uint64_t g_show_performance_period_num = 0; static bool g_run_failed = false; static bool g_shutdown = false; static uint64_t g_shutdown_tsc; @@ -581,7 +583,8 @@ performance_dump(int io_time_in_usec) static void performance_statistics_thread(void *arg) { - performance_dump(1); + g_show_performance_period_num++; + performance_dump(g_show_performance_period_num * g_show_performance_period_in_usec); } static int @@ -660,7 +663,8 @@ bdevperf_run(void *arg1, void *arg2) /* Start a timer to dump performance numbers */ g_shutdown_tsc = spdk_get_ticks(); if (g_show_performance_real_time) { - g_perf_timer = spdk_poller_register(performance_statistics_thread, NULL, 1000000); + g_perf_timer = spdk_poller_register(performance_statistics_thread, NULL, + g_show_performance_period_in_usec); } g_master_core = spdk_env_get_current_core();