diff --git a/examples/bdev/bdevperf/bdevperf.c b/examples/bdev/bdevperf/bdevperf.c index 925e02a17..f368d4ea2 100644 --- a/examples/bdev/bdevperf/bdevperf.c +++ b/examples/bdev/bdevperf/bdevperf.c @@ -2209,6 +2209,19 @@ bdevperf_run(void *arg1) bdevperf_construct_job_configs(); } +static void +rpc_perform_tests_reset(void) +{ + /* Reset g_run_rc to 0 for the next test run. */ + g_run_rc = 0; + + /* Reset g_stats to 0 for the next test run. */ + memset(&g_stats, 0, sizeof(g_stats)); + + /* Reset g_show_performance_period_num to 0 for the next test run. */ + g_show_performance_period_num = 0; +} + static void rpc_perform_tests_cb(void) { @@ -2226,11 +2239,7 @@ rpc_perform_tests_cb(void) "bdevperf failed with error %s", spdk_strerror(-g_run_rc)); } - /* Reset g_run_rc to 0 for the next test run. */ - g_run_rc = 0; - - /* Reset g_stats to 0 for the next test run. */ - memset(&g_stats, 0, sizeof(g_stats)); + rpc_perform_tests_reset(); } static void