spdk_top: Remove double sorting when getting poller data

No longer need the extra double sort the poller data since the
data is now always double sorted.

Signed-off-by: Michael Piszczek <mpiszczek@ddn.com>
Change-Id: Ic2edf92ec4374c3fb1c2a3ad8d2ba7c111e2e481
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/10107
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Krzysztof Karas <krzysztof.karas@intel.com>
This commit is contained in:
Michael Piszczek 2021-11-03 19:48:10 -04:00 committed by Keith Lucas
parent 09320adbea
commit d440a19538

View File

@ -851,11 +851,7 @@ subsort_pollers(enum column_pollers_type sort_column, const void *p1, const void
} }
static int static int
#ifdef __FreeBSD__ sort_pollers(const void *p1, const void *p2)
sort_pollers(void *arg, const void *p1, const void *p2)
#else
sort_pollers(const void *p1, const void *p2, void *arg)
#endif
{ {
int rc; int rc;
@ -874,7 +870,6 @@ get_pollers_data(void)
uint64_t i = 0; uint64_t i = 0;
uint32_t current_pollers_count; uint32_t current_pollers_count;
struct rpc_poller_info pollers_info[RPC_MAX_POLLERS]; struct rpc_poller_info pollers_info[RPC_MAX_POLLERS];
enum column_pollers_type column_sort;
rc = rpc_send_req("thread_get_pollers", &json_resp); rc = rpc_send_req("thread_get_pollers", &json_resp);
if (rc) { if (rc) {
@ -906,12 +901,7 @@ get_pollers_data(void)
g_last_pollers_count = current_pollers_count; g_last_pollers_count = current_pollers_count;
column_sort = COL_POLLERS_NAME; qsort(&pollers_info, g_last_pollers_count, sizeof(struct rpc_poller_info), sort_pollers);
qsort_r(&pollers_info, g_last_pollers_count, sizeof(struct rpc_poller_info), sort_pollers,
(void *)&column_sort);
column_sort = g_current_sort_col[POLLERS_TAB];
qsort_r(&pollers_info, g_last_pollers_count, sizeof(struct rpc_poller_info), sort_pollers,
(void *)&column_sort);
memcpy(&g_pollers_info, &pollers_info, sizeof(struct rpc_poller_info) * g_last_pollers_count); memcpy(&g_pollers_info, &pollers_info, sizeof(struct rpc_poller_info) * g_last_pollers_count);