bdevperf: move printing results to end of test

Previously particular tests results were printed out
after stopping the app framework.
Since RPC will allow to start/end tests without ending
the app, showing results is moved for the very end of tests.

This is series for adding RPC to bdevperf app.

Change-Id: Iae330af9f3e53e9e045248be399ee420e57f7f73
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/460446
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
This commit is contained in:
Tomasz Zawadzki 2019-07-03 11:36:15 -04:00 committed by Darek Stojaczyk
parent 11fc56b863
commit d1d82757d2

View File

@ -83,6 +83,7 @@ static const char *g_target_bdev_name;
static struct spdk_poller *g_perf_timer = NULL;
static void bdevperf_submit_single(struct io_target *target, struct bdevperf_task *task);
static void performance_dump(uint64_t io_time_in_usec, uint64_t ema_period);
struct io_target {
char *name;
@ -401,6 +402,20 @@ end_run(void *arg1, void *arg2)
if (g_show_performance_real_time) {
spdk_poller_unregister(&g_perf_timer);
}
if (g_shutdown) {
g_time_in_usec = g_shutdown_tsc * 1000000 / spdk_get_ticks_hz();
printf("Received shutdown signal, test time is about %.6f seconds\n",
(double)g_time_in_usec / 1000000);
}
if (g_time_in_usec) {
if (!g_run_failed) {
performance_dump(g_time_in_usec, 0);
}
} else {
printf("Test time less than one microsecond, no performance data will be shown\n");
}
if (g_run_failed) {
spdk_app_stop(1);
} else {
@ -1306,20 +1321,6 @@ main(int argc, char **argv)
g_run_failed = true;
}
if (g_shutdown) {
g_time_in_usec = g_shutdown_tsc * 1000000 / spdk_get_ticks_hz();
printf("Received shutdown signal, test time is about %.6f seconds\n",
(double)g_time_in_usec / 1000000);
}
if (g_time_in_usec) {
if (!g_run_failed) {
performance_dump(g_time_in_usec, 0);
}
} else {
printf("Test time less than one microsecond, no performance data will be shown\n");
}
blockdev_heads_destroy();
spdk_app_fini();
return g_run_failed;