Bdevperf: add a new g_start_tsc for starting the test

Change-Id: Ie88fbf24d5e6559a4add3a34be368efb1b20f803
Signed-off-by: GangCao <gang.cao@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/13556
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Dong Yi <dongx.yi@intel.com>
Reviewed-by: Xiaodong Liu <xiaodong.liu@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
This commit is contained in:
GangCao 2022-07-06 02:16:43 -04:00 committed by Tomasz Zawadzki
parent 474da9ea4f
commit 57f867162e

View File

@ -52,6 +52,7 @@ static uint64_t g_show_performance_period_num = 0;
static uint64_t g_show_performance_ema_period = 0; static uint64_t g_show_performance_ema_period = 0;
static int g_run_rc = 0; static int g_run_rc = 0;
static bool g_shutdown = false; static bool g_shutdown = false;
static uint64_t g_start_tsc;
static uint64_t g_shutdown_tsc; static uint64_t g_shutdown_tsc;
static bool g_zcopy = false; static bool g_zcopy = false;
static struct spdk_thread *g_main_thread; static struct spdk_thread *g_main_thread;
@ -361,7 +362,7 @@ bdevperf_test_done(void *ctx)
} }
if (g_shutdown) { if (g_shutdown) {
g_shutdown_tsc = spdk_get_ticks() - g_shutdown_tsc; g_shutdown_tsc = spdk_get_ticks() - g_start_tsc;
g_time_in_usec = g_shutdown_tsc * 1000000 / spdk_get_ticks_hz(); g_time_in_usec = g_shutdown_tsc * 1000000 / spdk_get_ticks_hz();
printf("Received shutdown signal, test time was about %.6f seconds\n", printf("Received shutdown signal, test time was about %.6f seconds\n",
(double)g_time_in_usec / 1000000); (double)g_time_in_usec / 1000000);
@ -1049,7 +1050,7 @@ bdevperf_test(void)
fflush(stdout); fflush(stdout);
/* Start a timer to dump performance numbers */ /* Start a timer to dump performance numbers */
g_shutdown_tsc = spdk_get_ticks(); g_start_tsc = spdk_get_ticks();
if (g_show_performance_real_time && !g_perf_timer) { if (g_show_performance_real_time && !g_perf_timer) {
g_perf_timer = SPDK_POLLER_REGISTER(performance_statistics_thread, NULL, g_perf_timer = SPDK_POLLER_REGISTER(performance_statistics_thread, NULL,
g_show_performance_period_in_usec); g_show_performance_period_in_usec);