Thread (62 messages) 62 messages, 9 authors, 2020-09-10

Re: [dpdk-dev] [PATCH 1/5] app/testpmd: print clock with CPU cycles per pkt

From: Lukasz Wojciechowski <hidden>
Date: 2020-05-06 22:48:30

W dniu 06.05.2020 o 23:58, Dharmik Thakkar pisze:
quoted hunk ↗ jump to hunk
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 <redacted>
Reviewed-by: Honnappa Nagarahalli <redacted>
Reviewed-by: Phil Yang <redacted>
---
  app/test-pmd/testpmd.c | 5 +++--
  1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c
index 99bacddbfdca..9a8cbbd6fc7c 100644
--- a/app/test-pmd/testpmd.c
+++ b/app/test-pmd/testpmd.c
@@ -1953,11 +1953,12 @@ 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 %lu MHz Clock\n",
Please use PRIu64 instead of %lu to keep printing uint64_t portable for 
different hardware, OS and compilers.
  		       (unsigned int)(fwd_cycles / total_recv),
-		       fwd_cycles, total_recv);
+		       fwd_cycles, total_recv, (uint64_t)(rte_get_tsc_hz() / CYC_PER_MHZ));
  #endif
  }
  
-- 

Lukasz Wojciechowski
Principal Software Engineer

Samsung R&D Institute Poland
Samsung Electronics
Office +48 22 377 88 25
l.wojciechow@partner.samsung.com
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help