Thread (7 messages) 7 messages, 2 authors, 2021-01-07

Re: [dpdk-dev] [PATCH 3/4] app/flow-perf: change clock measurement functions

From: Thomas Monjalon <hidden>
Date: 2021-01-07 14:49:55

26/11/2020 12:15, Wisam Jaddo:
The clock() function is not good practice to use for multiple
cores/threads, since it measures the CPU time used by the process
and not the wall clock time, while when running through multiple
cores/threads simultaneously, we can burn through CPU time much
faster.

As a result this commit will change the way of measurement to use
rd_tsc, and the results will be divided by the processor frequency.

Signed-off-by: Wisam Jaddo <redacted>
Reviewed-by: Alexander Kozyrev <redacted>
Reviewed-by: Suanming Mou <redacted>
---
-	start_batch = clock();
+	start_batch = rte_rdtsc();
Please could you try the generic wrapper rte_get_timer_cycles?
It should be the same (inline wrapper) when HPET is disabled.
rdtsc refer to an x86 instruction so I prefer a more generic API.

Can be a separate patch.
While at it, I believe more apps could be converted.

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help