From d42045b2af1082ee7bc3582108c4bd77619c8c34 Mon Sep 17 00:00:00 2001 From: Denis Nagorny Date: Thu, 23 Sep 2021 21:00:29 +0300 Subject: [PATCH] bdevperf: test time wrong time fix spdk_bdevperf_shutdown_cb computed total time after the bdevperf_test_done call. It's wrong. Let's get g_shutdown_tsc delta when it is really needed. Signed-off-by: Denis Nagorny Change-Id: Ic4421305b16277af874008e293da8cb121c0244a Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9598 Community-CI: Mellanox Build Bot Community-CI: Broadcom CI Tested-by: SPDK CI Jenkins Reviewed-by: Aleksey Marchuk Reviewed-by: Tomasz Zawadzki --- test/bdev/bdevperf/bdevperf.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/test/bdev/bdevperf/bdevperf.c b/test/bdev/bdevperf/bdevperf.c index 1794cda296..ccc859b6d2 100644 --- a/test/bdev/bdevperf/bdevperf.c +++ b/test/bdev/bdevperf/bdevperf.c @@ -389,6 +389,7 @@ bdevperf_test_done(void *ctx) } if (g_shutdown) { + g_shutdown_tsc = spdk_get_ticks() - g_shutdown_tsc; g_time_in_usec = g_shutdown_tsc * 1000000 / spdk_get_ticks_hz(); printf("Received shutdown signal, test time was about %.6f seconds\n", (double)g_time_in_usec / 1000000); @@ -1925,8 +1926,6 @@ spdk_bdevperf_shutdown_cb(void) return; } - g_shutdown_tsc = spdk_get_ticks() - g_shutdown_tsc; - /* Iterate jobs to stop all I/O */ TAILQ_FOREACH_SAFE(job, &g_bdevperf.jobs, link, tmp) { spdk_thread_send_msg(job->thread, _bdevperf_job_drain, job);