diff --git a/app/spdk_top/spdk_top.c b/app/spdk_top/spdk_top.c index 1235e8c7e..463e441f8 100644 --- a/app/spdk_top/spdk_top.c +++ b/app/spdk_top/spdk_top.c @@ -622,6 +622,8 @@ get_data(void) struct spdk_jsonrpc_client_response *json_resp = NULL; struct rpc_core_info *core_info; struct rpc_threads_stats threads_stats; + struct rpc_pollers *pollers; + struct rpc_poller_info *poller; uint64_t i, j; int rc = 0; @@ -659,6 +661,25 @@ get_data(void) goto end; } + /* Save last run counter of each poller before updating g_pollers_stats */ + for (i = 0; i < g_pollers_stats.pollers_threads.threads_count; i++) { + pollers = &g_pollers_stats.pollers_threads.threads[i].active_pollers; + for (j = 0; j < pollers->pollers_count; j++) { + poller = &pollers->pollers[j]; + store_last_run_counter(poller->name, poller->thread_id, poller->run_count); + } + pollers = &g_pollers_stats.pollers_threads.threads[i].timed_pollers; + for (j = 0; j < pollers->pollers_count; j++) { + poller = &pollers->pollers[j]; + store_last_run_counter(poller->name, poller->thread_id, poller->run_count); + } + pollers = &g_pollers_stats.pollers_threads.threads[i].paused_pollers; + for (j = 0; j < pollers->pollers_count; j++) { + poller = &pollers->pollers[j]; + store_last_run_counter(poller->name, poller->thread_id, poller->run_count); + } + } + /* Free old pollers values before allocating memory for new ones */ free_rpc_pollers_stats(&g_pollers_stats); @@ -1224,8 +1245,6 @@ refresh_pollers_tab(uint8_t current_page) col += col_desc[3].max_data_string + 4; } - store_last_run_counter(pollers[i]->name, pollers[i]->thread_id, pollers[i]->run_count); - if (!col_desc[5].disabled) { if (pollers[i]->busy_count > 0) { if (item_index != g_selected_row) {