From: Dharmik Thakkar Date: Fri, 8 May 2020 22:38:26 +0000 (+0000) Subject: app/testpmd: print fractional part in CPU cycles X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=1920832a79ff1b1cdd567cf62390041c6b58c891;p=dpdk.git app/testpmd: print fractional part in CPU cycles Change printing of CPU cycles/packet to include fractional part for accurateness. Example: Without patch: CPU cycles/packet=14 (total cycles=4899533541 / total RX packets=343031966) With patch: CPU cycles/packet=14.28 (total cycles=4899533541 / total RX packets=343031966) Signed-off-by: Dharmik Thakkar Reviewed-by: Honnappa Nagarahalli Reviewed-by: Phil Yang Acked-by: Bernard Iremonger --- diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c index b112f83970..baccc3a495 100644 --- a/app/test-pmd/testpmd.c +++ b/app/test-pmd/testpmd.c @@ -1962,10 +1962,10 @@ fwd_stats_display(void) #ifdef RTE_TEST_PMD_RECORD_CORE_CYCLES #define CYC_PER_MHZ 1E6 if (total_recv > 0) - printf("\n CPU cycles/packet=%u (total cycles=" + printf("\n CPU cycles/packet=%.2F (total cycles=" "%"PRIu64" / total RX packets=%"PRIu64") at %"PRIu64 " MHz Clock\n", - (unsigned int)(fwd_cycles / total_recv), + (double) fwd_cycles / total_recv, fwd_cycles, total_recv, (uint64_t)(rte_get_tsc_hz() / CYC_PER_MHZ)); #endif