spdk_top: make pollers tab refresh with pollers pop-up active

Changes refreshing of pollers tab to be done from within poller
pop-up display function. As mentioned before, NCURSES does not
behave predictably, when different parts of screen are refreshed
from within multiple functions at a time, so the "control" of
refreshing has to be passed to one function.

Adds refreshing of pollers pop-up.

Signed-off-by: Krzysztof Karas <krzysztof.karas@intel.com>
Change-Id: I37dcedc495c314462b252774d97410158e1b895d

Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7393
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
This commit is contained in:
Krzysztof Karas 2022-01-24 16:10:34 +00:00 committed by Tomasz Zawadzki
parent c82148a5f3
commit d18ec6e392

View File

@ -2634,11 +2634,10 @@ draw_poller_win_content(WINDOW *poller_win, struct rpc_poller_info *poller_info)
}
wnoutrefresh(poller_win);
refresh();
}
static void
show_poller(uint8_t current_page)
show_poller(uint8_t current_page, uint8_t active_tab)
{
PANEL *poller_panel;
WINDOW *poller_win;
@ -2646,6 +2645,12 @@ show_poller(uint8_t current_page)
struct rpc_poller_info *poller;
bool stop_loop = false;
int c;
long int time_last, time_dif;
struct timespec time_now;
clock_gettime(CLOCK_MONOTONIC, &time_now);
time_last = time_now.tv_sec;
pthread_mutex_lock(&g_thread_lock);
@ -2663,10 +2668,11 @@ show_poller(uint8_t current_page)
update_panels();
doupdate();
draw_poller_win_content(poller_win, poller);
refresh();
pthread_mutex_unlock(&g_thread_lock);
while (!stop_loop) {
c = wgetch(poller_win);
c = getch();
switch (c) {
case 27: /* ESC */
stop_loop = true;
@ -2674,6 +2680,18 @@ show_poller(uint8_t current_page)
default:
break;
}
clock_gettime(CLOCK_MONOTONIC, &time_now);
time_dif = time_now.tv_sec - time_last;
if (time_dif >= g_sleep_time) {
time_last = time_now.tv_sec;
pthread_mutex_lock(&g_thread_lock);
refresh_tab(active_tab, current_page);
draw_poller_win_content(poller_win, poller);
refresh();
pthread_mutex_unlock(&g_thread_lock);
}
}
del_panel(poller_panel);
@ -2937,7 +2955,7 @@ show_stats(pthread_t *data_thread)
} else if (active_tab == CORES_TAB) {
show_core(current_page, active_tab);
} else if (active_tab == POLLERS_TAB) {
show_poller(current_page);
show_poller(current_page, active_tab);
}
break;
case 'h':