spdk_top: separate core popup content drawing

Separate drawing of core popup content from the rest
of the popup's functionality.

Change-Id: I60641d347528b08e2809d9678ca306d9db5bb823
Signed-off-by: Krzysztof Karas <krzysztof.karas@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/11236
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
This commit is contained in:
Krzysztof Karas 2022-01-24 16:19:43 +00:00 committed by Tomasz Zawadzki
parent d18ec6e392
commit 6a0c7766bb

View File

@ -2444,36 +2444,12 @@ show_single_thread(uint64_t thread_id, uint8_t current_page, uint8_t active_tab)
}
static void
show_core(uint8_t current_page, uint8_t active_tab)
draw_core_win_content(WINDOW *core_win, struct rpc_core_info *core_info)
{
PANEL *core_panel;
WINDOW *core_win;
uint64_t core_number = current_page * g_max_data_rows + g_selected_row;
struct rpc_core_info *core_info = &g_cores_info[core_number];
uint64_t threads_count, i;
uint64_t thread_id = 0;
uint16_t current_threads_row;
int c;
uint64_t i;
char core_win_title[25];
bool stop_loop = false;
char idle_time[MAX_TIME_STR_LEN], busy_time[MAX_TIME_STR_LEN];
pthread_mutex_lock(&g_thread_lock);
assert(core_number < g_last_cores_count);
threads_count = g_cores_info[core_number].threads.threads_count;
core_win = newwin(threads_count + CORE_WIN_HEIGHT, CORE_WIN_WIDTH,
get_position_for_window(CORE_WIN_HEIGHT + threads_count, g_max_row),
get_position_for_window(CORE_WIN_WIDTH, g_max_col));
keypad(core_win, TRUE);
core_panel = new_panel(core_win);
top_panel(core_panel);
update_panels();
doupdate();
box(core_win, 0, 0);
snprintf(core_win_title, sizeof(core_win_title), "Core %" PRIu32 " details",
core_info->lcore);
@ -2527,6 +2503,38 @@ show_core(uint8_t current_page, uint8_t active_tab)
pthread_mutex_unlock(&g_thread_lock);
wnoutrefresh(core_win);
}
static void
show_core(uint8_t current_page, uint8_t active_tab)
{
PANEL *core_panel;
WINDOW *core_win;
uint64_t core_number = current_page * g_max_data_rows + g_selected_row;
struct rpc_core_info *core_info = &g_cores_info[core_number];
uint64_t threads_count, i;
uint64_t thread_id = 0;
uint16_t current_threads_row;
int c;
bool stop_loop = false;
pthread_mutex_lock(&g_thread_lock);
assert(core_number < g_last_cores_count);
threads_count = g_cores_info[core_number].threads.threads_count;
core_win = newwin(threads_count + CORE_WIN_HEIGHT, CORE_WIN_WIDTH,
get_position_for_window(CORE_WIN_HEIGHT + threads_count, g_max_row),
get_position_for_window(CORE_WIN_WIDTH, g_max_col));
keypad(core_win, TRUE);
core_panel = new_panel(core_win);
top_panel(core_panel);
update_panels();
doupdate();
draw_core_win_content(core_win, core_info);
current_threads_row = 0;