Commit ed4b89aa authored by GangCao's avatar GangCao Committed by Tomasz Zawadzki
Browse files

examples/bdevperf: reset the performance period for next run



In the case of running by below commands:

./examples/bdev/bdevperf/bdevperf.py perform_tests

This value needs to be reset in each run, otherwise, it shows
wrong IOPS in the periodical way with -S parameter.

Change-Id: Ib8de7611aa06675d4a16fc3aa130d99b508b7605
Signed-off-by: default avatarGangCao <gang.cao@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/15960


Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
Reviewed-by: default avatarChangpeng Liu <changpeng.liu@intel.com>
parent b99b00e5
Loading
Loading
Loading
Loading
+14 −5
Original line number Diff line number Diff line
@@ -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