[dpdk-dev] [PATCH 3/4] app/flow-perf: change clock measurement functions
Thomas Monjalon
thomas at monjalon.net
Thu Jan 7 15:49:45 CET 2021
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 <wisamm at nvidia.com>
> Reviewed-by: Alexander Kozyrev <akozyrev at nvidia.com>
> Reviewed-by: Suanming Mou <suanmingm at nvidia.com>
> ---
> - 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.
More information about the dev
mailing list