From 7098e2ed31c9305aef6f5fac99892cec06d6e270 Mon Sep 17 00:00:00 2001 From: Denis Nagorny Date: Fri, 24 Sep 2021 11:10:18 +0300 Subject: [PATCH] bdevperf: prevent multiple performance statistics poller registering Current implementation allows to run bdevperf with --wait-for-rpc and without -z option. As the result several statistics pollers will be registered. Let's add guardian to prevent this. In the case of multiple test running guardian also will be helpful. Signed-off-by: Denis Nagorny Change-Id: I885f9dba6fa324fe4fbaba104d3058bf9f686c19 Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9613 Community-CI: Broadcom CI Community-CI: Mellanox Build Bot Tested-by: SPDK CI Jenkins Reviewed-by: Aleksey Marchuk Reviewed-by: Tomasz Zawadzki --- test/bdev/bdevperf/bdevperf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/bdev/bdevperf/bdevperf.c b/test/bdev/bdevperf/bdevperf.c index 011de702a7..1794cda296 100644 --- a/test/bdev/bdevperf/bdevperf.c +++ b/test/bdev/bdevperf/bdevperf.c @@ -1077,7 +1077,7 @@ bdevperf_test(void) /* Start a timer to dump performance numbers */ g_shutdown_tsc = spdk_get_ticks(); - if (g_show_performance_real_time) { + if (g_show_performance_real_time && !g_perf_timer) { g_perf_timer = SPDK_POLLER_REGISTER(performance_statistics_thread, NULL, g_show_performance_period_in_usec); }