diff options
author | Ivan Khoronzhuk <ivan.khoronzhuk@linaro.org> | 2015-09-17 11:31:27 +0300 |
---|---|---|
committer | Maxim Uvarov <maxim.uvarov@linaro.org> | 2015-09-22 21:07:43 +0300 |
commit | 86cbe5ee79e53067c16f1001b3f84e8e2ef8cf74 (patch) | |
tree | e7fb94dc1980895cfad911c350a6caee1dfa1fef /example | |
parent | f96945d1a5dd2e69c31b59ace2cad8856dd45a41 (diff) |
example: timer: print timer ticks/ns table instead of cycles/ns
The timer API can have nothing common with CPU cycles or time API.
Thus timer test shouldn't print conversion cycles/ns table.
More correct to print conversion table for timer ticks/ns.
Signed-off-by: Ivan Khoronzhuk <ivan.khoronzhuk@linaro.org>
Reviewed-by: Petri Savolainen <petri.savolainen@nokia.com>
Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
Diffstat (limited to 'example')
-rw-r--r-- | example/timer/odp_timer_test.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/example/timer/odp_timer_test.c b/example/timer/odp_timer_test.c index 49630b05..3aa0f512 100644 --- a/example/timer/odp_timer_test.c +++ b/example/timer/odp_timer_test.c @@ -322,7 +322,7 @@ int main(int argc, char *argv[]) odph_linux_pthread_t thread_tbl[MAX_WORKERS]; int num_workers; odp_queue_t queue; - uint64_t cycles, ns; + uint64_t tick, ns; odp_queue_param_t param; odp_pool_param_t params; odp_timer_pool_param_t tparams; @@ -447,21 +447,21 @@ int main(int argc, char *argv[]) } printf("CPU freq %"PRIu64" Hz\n", odp_sys_cpu_hz()); - printf("Cycles vs nanoseconds:\n"); + printf("Timer ticks vs nanoseconds:\n"); ns = 0; - cycles = odp_time_ns_to_cycles(ns); + tick = odp_timer_ns_to_tick(gbls->tp, ns); - printf(" %12"PRIu64" ns -> %12"PRIu64" cycles\n", ns, cycles); - printf(" %12"PRIu64" cycles -> %12"PRIu64" ns\n", cycles, - odp_time_cycles_to_ns(cycles)); + printf(" %12" PRIu64 " ns -> %12" PRIu64 " ticks\n", ns, tick); + printf(" %12" PRIu64 " ticks -> %12" PRIu64 " ns\n", tick, + odp_timer_tick_to_ns(gbls->tp, tick)); for (ns = 1; ns <= 100*ODP_TIME_SEC; ns *= 10) { - cycles = odp_time_ns_to_cycles(ns); + tick = odp_timer_ns_to_tick(gbls->tp, ns); - printf(" %12"PRIu64" ns -> %12"PRIu64" cycles\n", ns, - cycles); - printf(" %12"PRIu64" cycles -> %12"PRIu64" ns\n", cycles, - odp_time_cycles_to_ns(cycles)); + printf(" %12" PRIu64 " ns -> %12" PRIu64 " ticks\n", ns, + tick); + printf(" %12" PRIu64 " ticks -> %12" PRIu64 " ns\n", tick, + odp_timer_tick_to_ns(gbls->tp, tick)); } printf("\n"); |