From 4c0497b1dd531c3f72e8cbfab32e32350a9cbfa5 Mon Sep 17 00:00:00 2001 From: Dharmik Thakkar Date: Fri, 8 May 2020 22:38:25 +0000 Subject: [PATCH] app/testpmd: print clock with CPU cycles per packet On aarch64 platforms, the cycles are counted using either a low-resolution generic counter or a high-resolution PMU cycle counter. Print the clock frequency along with CPU cycles/packet to identify which cycle counter is being used. Signed-off-by: Dharmik Thakkar Reviewed-by: Honnappa Nagarahalli Reviewed-by: Phil Yang Acked-by: Bernard Iremonger --- app/test-pmd/testpmd.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c index 9cbe6e9f68..b112f83970 100644 --- a/app/test-pmd/testpmd.c +++ b/app/test-pmd/testpmd.c @@ -1960,11 +1960,14 @@ fwd_stats_display(void) "%s\n", acc_stats_border, acc_stats_border); #ifdef RTE_TEST_PMD_RECORD_CORE_CYCLES +#define CYC_PER_MHZ 1E6 if (total_recv > 0) printf("\n CPU cycles/packet=%u (total cycles=" - "%"PRIu64" / total RX packets=%"PRIu64")\n", + "%"PRIu64" / total RX packets=%"PRIu64") at %"PRIu64 + " MHz Clock\n", (unsigned int)(fwd_cycles / total_recv), - fwd_cycles, total_recv); + fwd_cycles, total_recv, + (uint64_t)(rte_get_tsc_hz() / CYC_PER_MHZ)); #endif } -- 2.20.1