spdk_top: Fix missing poller and core sort cases

Added missing sorts for pollers by busy count and cores by frequency
and cores by in interrupt.

Signed-off-by: Michael Piszczek <mpiszczek@ddn.com>
Change-Id: Ie8cf7f11961dd727d59bd406be320ce4d25c7573
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/10104
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: 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 11:19:26 -04:00 committed by Tomasz Zawadzki
parent f59e9fa754
commit 648cf7163b

View File

@ -764,6 +764,7 @@ sort_pollers(const void *p1, const void *p2, void *arg)
const struct rpc_poller_info *poller2 = (struct rpc_poller_info *)p2;
enum sort_type sorting = *(enum sort_type *)arg;
uint64_t count1, count2;
uint64_t last_busy_counter1, last_busy_counter2;
if (sorting == BY_NAME) {
/* Sorting by name requested explicitly */
@ -790,6 +791,20 @@ sort_pollers(const void *p1, const void *p2, void *arg)
count1 = poller1->period_ticks;
count2 = poller2->period_ticks;
break;
case 5: /* Sort by busy count */
count1 = poller1->busy_count;
count2 = poller2->busy_count;
if (g_interval_data) {
last_busy_counter1 = get_last_busy_counter(poller1->name, poller1->thread_id);
last_busy_counter2 = get_last_busy_counter(poller2->name, poller2->thread_id);
if (count1 > last_busy_counter1) {
count1 -= last_busy_counter1;
}
if (count2 > last_busy_counter2) {
count2 -= last_busy_counter2;
}
}
break;
default:
return 0;
}
@ -898,6 +913,14 @@ sort_cores(const void *p1, const void *p2)
count2 = core_info2.busy;
}
break;
case 5: /* Sort by core frequency */
count1 = core_info1.core_freq;
count2 = core_info2.core_freq;
break;
case 6: /* Sort by in interrupt */
count1 = core_info1.in_interrupt;
count2 = core_info2.in_interrupt;
break;
default:
return 0;
}