diff mbox

[v3,1/5] example: timer: print timer ticks/ns table instead of cycles/ns

Message ID 1442478691-30098-2-git-send-email-ivan.khoronzhuk@linaro.org
State Accepted
Commit 86cbe5ee79e53067c16f1001b3f84e8e2ef8cf74
Headers show

Commit Message

Ivan Khoronzhuk Sept. 17, 2015, 8:31 a.m. UTC
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>
---
 example/timer/odp_timer_test.c | 22 +++++++++++-----------
 1 file changed, 11 insertions(+), 11 deletions(-)
diff mbox

Patch

diff --git a/example/timer/odp_timer_test.c b/example/timer/odp_timer_test.c
index 49630b0..3aa0f51 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");