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

spdk_top: fix app crashing on tab selection with TAB key



Fixes spdk_top crashing problem upon selecting a row in one tab,
then switching with TAB key to a different tab with fewer rows
and calling pop-up details window with ENTER key.

Signed-off-by: default avatarKrzysztof Karas <krzysztof.karas@intel.com>
Change-Id: I52c5729eca0ce0eaad88767ff3add471a780140a
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6367


Reviewed-by: default avatarTomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
Community-CI: Mellanox Build Bot
Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
parent 97ef8701
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -2035,6 +2035,7 @@ show_thread(uint8_t current_page)

	get_data();

	assert(thread_number < g_threads_stats.threads.threads_count);
	for (i = 0; i < g_threads_stats.threads.threads_count; i++) {
		thread_info[i] = &g_threads_stats.threads.thread_info[i];
	}
@@ -2075,6 +2076,7 @@ show_core(uint8_t current_page)

	get_data();

	assert(core_number < g_cores_stats.cores.cores_count);
	for (i = 0; i < g_cores_stats.cores.cores_count; i++) {
		core_info[i] = &g_cores_stats.cores.core[i];
	}
@@ -2187,6 +2189,7 @@ show_poller(uint8_t current_page)
	get_data();

	prepare_poller_data(current_page, pollers, &count, current_page);
	assert(poller_number < count);

	poller_win = newwin(POLLER_WIN_HEIGHT, POLLER_WIN_WIDTH,
			    get_position_for_window(POLLER_WIN_HEIGHT, g_max_row),
@@ -2309,6 +2312,7 @@ show_stats(void)
			} else {
				active_tab = THREADS_TAB;
			}
			g_selected_row = 0;
			current_page = 0;
			switch_tab(active_tab);
			break;