Commit de7493e6 authored by Krzysztof Karas's avatar Krzysztof Karas Committed by Tomasz Zawadzki
Browse files

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: default avatarKrzysztof Karas <krzysztof.karas@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/10016


Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
Reviewed-by: default avatarBen Walker <benjamin.walker@intel.com>
parent 86167363
Loading
Loading
Loading
Loading
+9 −4
Original line number Diff line number Diff line
@@ -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);