From de7493e69722c13205a43d098b904390dd3342d2 Mon Sep 17 00:00:00 2001 From: Krzysztof Karas Date: Wed, 27 Oct 2021 05:36:43 +0000 Subject: [PATCH] spdk_top: rename print_bottom_error_message Rename print_bottom_error_message() to pint_bottom_message(). This is to avoid confusion, beacuse in the next patch this funciton is used to print messages unrelated to errors. Additionally added clearing bottom before printing given message. Change-Id: Ibaeea03bb92124098fee51f78a6ac773eb288897 Signed-off-by: Krzysztof Karas Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/10016 Tested-by: SPDK CI Jenkins Reviewed-by: Jim Harris Reviewed-by: Ben Walker --- app/spdk_top/spdk_top.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/app/spdk_top/spdk_top.c b/app/spdk_top/spdk_top.c index 780f86daf..5fd696383 100644 --- a/app/spdk_top/spdk_top.c +++ b/app/spdk_top/spdk_top.c @@ -2200,8 +2200,13 @@ get_position_for_window(uint64_t window_size, uint64_t max_size) } static void -print_bottom_error_message(char *msg) +print_bottom_message(char *msg) { + uint64_t i; + + for (i = 1; i < (uint64_t)g_max_col - 1; i++) { + mvprintw(g_max_row - 1, i, " "); + } mvprintw(g_max_row - 1, g_max_col - strlen(msg) - 2, "%s", msg); } @@ -2616,16 +2621,16 @@ data_thread_routine(void *arg) * Start with cores since their number should not change. */ rc = get_cores_data(); if (rc) { - print_bottom_error_message("ERROR occurred while getting cores data"); + print_bottom_message("ERROR occurred while getting cores data"); } rc = get_thread_data(); if (rc) { - print_bottom_error_message("ERROR occurred while getting threads data"); + print_bottom_message("ERROR occurred while getting threads data"); } rc = get_pollers_data(); if (rc) { - print_bottom_error_message("ERROR occurred while getting pollers data"); + print_bottom_message("ERROR occurred while getting pollers data"); } usleep(g_sleep_time * SPDK_SEC_TO_USEC);