[dpdk-dev] [PATCH 2/5] app/testpmd: print fractional part in CPU cycles
Dharmik Thakkar
dharmik.thakkar at arm.com
Wed May 6 23:58:44 CEST 2020
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 <dharmik.thakkar at arm.com>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli at arm.com>
Reviewed-by: Phil Yang <phil.yang at arm.com>
---
app/test-pmd/testpmd.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c
index 9a8cbbd6fc7c..9444a730a153 100644
--- a/app/test-pmd/testpmd.c
+++ b/app/test-pmd/testpmd.c
@@ -1955,9 +1955,9 @@ 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 %lu MHz Clock\n",
- (unsigned int)(fwd_cycles / total_recv),
+ (double)(fwd_cycles / (double)total_recv),
fwd_cycles, total_recv, (uint64_t)(rte_get_tsc_hz() / CYC_PER_MHZ));
#endif
}
--
2.20.1
More information about the dev
mailing list