From patchwork Fri Aug 7 22:28:08 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ivan Khoronzhuk X-Patchwork-Id: 52054 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f198.google.com (mail-wi0-f198.google.com [209.85.212.198]) by patches.linaro.org (Postfix) with ESMTPS id 6628D20539 for ; Fri, 7 Aug 2015 22:31:52 +0000 (UTC) Received: by wijp15 with SMTP id p15sf21505307wij.3 for ; Fri, 07 Aug 2015 15:31:51 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:delivered-to:from:to:date :message-id:in-reply-to:references:subject:precedence:list-id :list-unsubscribe:list-archive:list-post:list-help:list-subscribe :mime-version:content-type:content-transfer-encoding:errors-to :sender:x-original-sender:x-original-authentication-results :mailing-list; bh=8T+0Ntwi7rG15EkmHiN6l2XGwH7rayjVlA/T0o2Me4U=; b=EcenrTSXKO4yHwyW7TOi/yIoq5aGD3CImIcmfE6rc9K+YQleb4/EVwO3CwuyuJ4ZoC BHiOxjlWn5kLtUHfD6yqFLwY3tt9Gkli3NAoyJcwatO4OrQ34GGx3lTzQvMbmFZch7rJ j/lAQK9+J/4J34Q3TBIX0jwKaMdSw8f3l1R3ZtS9UDfEXrYHOocyY/hsrWKUb9XQB0kW 6VAiH1vQXvbdXPIf6ehWukzXn27YSdY/7L4LTW8Cr+hjrTRHWEZe0EDI2YkHaY5BBmHL bjLm0pBgZgZn8brA9s+JGNHyUKqeyaAngRpnqvI3HCHz/KffaJsRXEf31gV3PZoKmpoM nCvg== X-Gm-Message-State: ALoCoQlCEJNzlGGUKE6dUOhaE8TLQuDvlCLLOgEh4QNEhYSqQZ7fbvNhlgsQN+KVUHdzgrKR+EU1 X-Received: by 10.112.122.42 with SMTP id lp10mr2829444lbb.5.1438986711710; Fri, 07 Aug 2015 15:31:51 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.5.129 with SMTP id s1ls585507las.11.gmail; Fri, 07 Aug 2015 15:31:51 -0700 (PDT) X-Received: by 10.152.239.135 with SMTP id vs7mr9823147lac.18.1438986711554; Fri, 07 Aug 2015 15:31:51 -0700 (PDT) Received: from mail-lb0-f170.google.com (mail-lb0-f170.google.com. [209.85.217.170]) by mx.google.com with ESMTPS id xd3si8621658lbb.166.2015.08.07.15.31.51 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 07 Aug 2015 15:31:51 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.170 as permitted sender) client-ip=209.85.217.170; Received: by lbbyj8 with SMTP id yj8so68340598lbb.0 for ; Fri, 07 Aug 2015 15:31:51 -0700 (PDT) X-Received: by 10.112.140.68 with SMTP id re4mr10179813lbb.72.1438986711313; Fri, 07 Aug 2015 15:31:51 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.7.198 with SMTP id l6csp643600lba; Fri, 7 Aug 2015 15:31:50 -0700 (PDT) X-Received: by 10.55.31.93 with SMTP id f90mr10615504qkf.105.1438986709538; Fri, 07 Aug 2015 15:31:49 -0700 (PDT) Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id f46si20791918qgd.11.2015.08.07.15.31.48; Fri, 07 Aug 2015 15:31:49 -0700 (PDT) Received-SPF: pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) client-ip=54.225.227.206; Received: by lists.linaro.org (Postfix, from userid 109) id CDA2B62340; Fri, 7 Aug 2015 22:31:48 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on ip-10-142-244-252.ec2.internal X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, URIBL_BLOCKED autolearn=disabled version=3.4.0 Received: from ip-10-142-244-252.ec2.internal (localhost [127.0.0.1]) by lists.linaro.org (Postfix) with ESMTP id E26B26234B; Fri, 7 Aug 2015 22:29:13 +0000 (UTC) X-Original-To: lng-odp@lists.linaro.org Delivered-To: lng-odp@lists.linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id C6A3962331; Fri, 7 Aug 2015 22:28:47 +0000 (UTC) Received: from mail-lb0-f177.google.com (mail-lb0-f177.google.com [209.85.217.177]) by lists.linaro.org (Postfix) with ESMTPS id 54D8C62316 for ; Fri, 7 Aug 2015 22:28:43 +0000 (UTC) Received: by lbbyj8 with SMTP id yj8so68315280lbb.0 for ; Fri, 07 Aug 2015 15:28:41 -0700 (PDT) X-Received: by 10.112.63.169 with SMTP id h9mr10274210lbs.104.1438986521853; Fri, 07 Aug 2015 15:28:41 -0700 (PDT) Received: from khorivan.synapse.com (14-148-93-178.pool.ukrtel.net. [178.93.148.14]) by smtp.gmail.com with ESMTPSA id ad1sm422651lbc.5.2015.08.07.15.28.40 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 07 Aug 2015 15:28:41 -0700 (PDT) From: Ivan Khoronzhuk To: lng-odp@lists.linaro.org Date: Sat, 8 Aug 2015 01:28:08 +0300 Message-Id: <1438986490-12100-3-git-send-email-ivan.khoronzhuk@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1438986490-12100-1-git-send-email-ivan.khoronzhuk@linaro.org> References: <1438986490-12100-1-git-send-email-ivan.khoronzhuk@linaro.org> X-Topics: patch Subject: [lng-odp] [API-NEXT PATCH v2 2/4] test/example: avoid "cycle" word usage X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , MIME-Version: 1.0 Errors-To: lng-odp-bounces@lists.linaro.org Sender: "lng-odp" X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: ivan.khoronzhuk@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.170 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 The word "cycle" is left from old API time names. The "cycle" is ambiguous word, especially when it can be used for other purposes. So better to use "tick" word or just "t" symbol. Signed-off-by: Ivan Khoronzhuk --- example/ipsec/odp_ipsec.c | 14 +++--- example/timer/odp_timer_test.c | 22 +++++----- test/performance/odp_pktio_perf.c | 32 +++++++------- test/performance/odp_scheduling.c | 80 +++++++++++++++++------------------ test/validation/scheduler/scheduler.c | 4 +- test/validation/time/time.c | 38 ++++++++--------- 6 files changed, 95 insertions(+), 95 deletions(-) diff --git a/example/ipsec/odp_ipsec.c b/example/ipsec/odp_ipsec.c index 3d34210..019a0b6 100644 --- a/example/ipsec/odp_ipsec.c +++ b/example/ipsec/odp_ipsec.c @@ -265,11 +265,11 @@ odp_queue_t polled_odp_queue_create(const char *name, static odp_event_t polled_odp_schedule(odp_queue_t *from, uint64_t wait) { - uint64_t start_cycle; - uint64_t cycle; + uint64_t start_tick; + uint64_t tick; uint64_t diff; - start_cycle = 0; + start_tick = 0; while (1) { int idx; @@ -292,13 +292,13 @@ odp_event_t polled_odp_schedule(odp_queue_t *from, uint64_t wait) if (ODP_SCHED_NO_WAIT == wait) break; - if (0 == start_cycle) { - start_cycle = odp_time_tick(); + if (0 == start_tick) { + start_tick = odp_time_tick(); continue; } - cycle = odp_time_tick(); - diff = odp_time_ticks_diff(start_cycle, cycle); + tick = odp_time_tick(); + diff = odp_time_ticks_diff(start_tick, tick); if (wait < diff) break; diff --git a/example/timer/odp_timer_test.c b/example/timer/odp_timer_test.c index c6c809d..bbaaf7d 100644 --- a/example/timer/odp_timer_test.c +++ b/example/timer/odp_timer_test.c @@ -313,7 +313,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 ticks, ns; odp_queue_param_t param; odp_pool_param_t params; odp_timer_pool_param_t tparams; @@ -438,21 +438,21 @@ int main(int argc, char *argv[]) } printf("CPU freq %"PRIu64" Hz\n", odp_sys_cpu_hz()); - printf("Cycles vs nanoseconds:\n"); + printf("Ticks vs nanoseconds:\n"); ns = 0; - cycles = odp_time_ns_to_tick(ns); + ticks = odp_time_ns_to_tick(ns); - printf(" %12"PRIu64" ns -> %12"PRIu64" cycles\n", ns, cycles); - printf(" %12"PRIu64" cycles -> %12"PRIu64" ns\n", cycles, - odp_time_tick_to_ns(cycles)); + printf(" %12"PRIu64" ns -> %12"PRIu64" ticks\n", ns, ticks); + printf(" %12"PRIu64" ticks -> %12"PRIu64" ns\n", ticks, + odp_time_tick_to_ns(ticks)); for (ns = 1; ns <= 100*ODP_TIME_SEC; ns *= 10) { - cycles = odp_time_ns_to_tick(ns); + ticks = odp_time_ns_to_tick(ns); - printf(" %12"PRIu64" ns -> %12"PRIu64" cycles\n", ns, - cycles); - printf(" %12"PRIu64" cycles -> %12"PRIu64" ns\n", cycles, - odp_time_tick_to_ns(cycles)); + printf(" %12"PRIu64" ns -> %12"PRIu64" ticks\n", ns, + ticks); + printf(" %12"PRIu64" ticks -> %12"PRIu64" ns\n", ticks, + odp_time_tick_to_ns(ticks)); } printf("\n"); diff --git a/test/performance/odp_pktio_perf.c b/test/performance/odp_pktio_perf.c index b3f8d2b..a80d19a 100644 --- a/test/performance/odp_pktio_perf.c +++ b/test/performance/odp_pktio_perf.c @@ -106,7 +106,7 @@ struct tx_stats_s { uint64_t tx_cnt; /* Packets transmitted */ uint64_t alloc_failures;/* Packet allocation failures */ uint64_t enq_failures; /* Enqueue failures */ - uint64_t idle_cycles; /* Idle cycle count in TX loop */ + uint64_t idle_ticks; /* Idle ticks count in TX loop */ }; typedef union tx_stats_u { @@ -302,8 +302,8 @@ static void *run_thread_tx(void *arg) int thr_id; odp_queue_t outq; pkt_tx_stats_t *stats; - uint64_t next_tx_cycles, end_cycles, cur_cycles; - uint64_t burst_gap_cycles; + uint64_t next_tx_tick, end_tick, cur_tick; + uint64_t burst_gap; uint32_t batch_len; int unsent_pkts = 0; odp_event_t tx_event[BATCH_LEN_MAX]; @@ -325,33 +325,33 @@ static void *run_thread_tx(void *arg) if (outq == ODP_QUEUE_INVALID) LOG_ABORT("Failed to get output queue for thread %d\n", thr_id); - burst_gap_cycles = odp_time_ns_to_tick( + burst_gap = odp_time_ns_to_tick( ODP_TIME_SEC / (targs->pps / targs->batch_len)); odp_barrier_wait(&globals->tx_barrier); - cur_cycles = odp_time_tick(); - next_tx_cycles = cur_cycles; - end_cycles = cur_cycles + + cur_tick = odp_time_tick(); + next_tx_tick = cur_tick; + end_tick = cur_tick + odp_time_ns_to_tick(targs->duration * ODP_TIME_SEC); - while (cur_cycles < end_cycles) { + while (cur_tick < end_tick) { unsigned alloc_cnt = 0, tx_cnt; - if (cur_cycles < next_tx_cycles) { - cur_cycles = odp_time_tick(); + if (cur_tick < next_tx_tick) { + cur_tick = odp_time_tick(); if (idle_start == 0) - idle_start = cur_cycles; + idle_start = cur_tick; continue; } if (idle_start) { - stats->s.idle_cycles += odp_time_ticks_diff( - idle_start, cur_cycles); + stats->s.idle_ticks += odp_time_ticks_diff(idle_start, + cur_tick); idle_start = 0; } - next_tx_cycles += burst_gap_cycles; + next_tx_tick += burst_gap; alloc_cnt = alloc_packets(tx_event, batch_len - unsent_pkts); if (alloc_cnt != batch_len) @@ -362,14 +362,14 @@ static void *run_thread_tx(void *arg) stats->s.enq_failures += unsent_pkts; stats->s.tx_cnt += tx_cnt; - cur_cycles = odp_time_tick(); + cur_tick = odp_time_tick(); } VPRINT(" %02d: TxPkts %-8"PRIu64" EnqFail %-6"PRIu64 " AllocFail %-6"PRIu64" Idle %"PRIu64"ms\n", thr_id, stats->s.tx_cnt, stats->s.enq_failures, stats->s.alloc_failures, - odp_time_tick_to_ns(stats->s.idle_cycles) / 1000 / 1000); + odp_time_tick_to_ns(stats->s.idle_ticks) / 1000 / 1000); return NULL; } diff --git a/test/performance/odp_scheduling.c b/test/performance/odp_scheduling.c index e34cea9..8c8a283 100644 --- a/test/performance/odp_scheduling.c +++ b/test/performance/odp_scheduling.c @@ -183,7 +183,7 @@ static int test_alloc_single(int thr, odp_pool_t pool) { int i; odp_buffer_t temp_buf; - uint64_t t1, t2, cycles, ns; + uint64_t t1, t2, ticks, ns; t1 = odp_time_tick(); @@ -199,11 +199,11 @@ static int test_alloc_single(int thr, odp_pool_t pool) } t2 = odp_time_tick(); - cycles = odp_time_ticks_diff(t1, t2); - ns = odp_time_tick_to_ns(cycles); + ticks = odp_time_ticks_diff(t1, t2); + ns = odp_time_tick_to_ns(ticks); - printf(" [%i] alloc_sng alloc+free %"PRIu64" cycles, %"PRIu64" ns\n", - thr, cycles/ALLOC_ROUNDS, ns/ALLOC_ROUNDS); + printf(" [%i] alloc_sng alloc+free %"PRIu64" ticks, %"PRIu64" ns\n", + thr, ticks / ALLOC_ROUNDS, ns / ALLOC_ROUNDS); return 0; } @@ -220,7 +220,7 @@ static int test_alloc_multi(int thr, odp_pool_t pool) { int i, j; odp_buffer_t temp_buf[MAX_ALLOCS]; - uint64_t t1, t2, cycles, ns; + uint64_t t1, t2, ticks, ns; t1 = odp_time_tick(); @@ -239,11 +239,11 @@ static int test_alloc_multi(int thr, odp_pool_t pool) } t2 = odp_time_tick(); - cycles = odp_time_ticks_diff(t1, t2); - ns = odp_time_tick_to_ns(cycles); + ticks = odp_time_ticks_diff(t1, t2); + ns = odp_time_tick_to_ns(ticks); - printf(" [%i] alloc_multi alloc+free %"PRIu64" cycles, %"PRIu64" ns\n", - thr, cycles/(ALLOC_ROUNDS*MAX_ALLOCS), + printf(" [%i] alloc_multi alloc+free %"PRIu64" ticks, %"PRIu64" ns\n", + thr, ticks / (ALLOC_ROUNDS * MAX_ALLOCS), ns/(ALLOC_ROUNDS*MAX_ALLOCS)); return 0; @@ -265,7 +265,7 @@ static int test_poll_queue(int thr, odp_pool_t msg_pool) odp_buffer_t buf; test_message_t *t_msg; odp_queue_t queue; - uint64_t t1, t2, cycles, ns; + uint64_t t1, t2, ticks, ns; int i; /* Alloc test message */ @@ -311,11 +311,11 @@ static int test_poll_queue(int thr, odp_pool_t msg_pool) } t2 = odp_time_tick(); - cycles = odp_time_ticks_diff(t1, t2); - ns = odp_time_tick_to_ns(cycles); + ticks = odp_time_ticks_diff(t1, t2); + ns = odp_time_tick_to_ns(ticks); - printf(" [%i] poll_queue enq+deq %"PRIu64" cycles, %"PRIu64" ns\n", - thr, cycles/QUEUE_ROUNDS, ns/QUEUE_ROUNDS); + printf(" [%i] poll_queue enq+deq %"PRIu64" ticks, %"PRIu64" ns\n", + thr, ticks / QUEUE_ROUNDS, ns / QUEUE_ROUNDS); odp_buffer_free(buf); return 0; @@ -341,7 +341,7 @@ static int test_schedule_single(const char *str, int thr, { odp_event_t ev; odp_queue_t queue; - uint64_t t1, t2, cycles, ns; + uint64_t t1, t2, ticks, ns; uint32_t i; uint32_t tot = 0; @@ -383,17 +383,17 @@ static int test_schedule_single(const char *str, int thr, odp_schedule_resume(); t2 = odp_time_tick(); - cycles = odp_time_ticks_diff(t1, t2); - ns = odp_time_tick_to_ns(cycles); + ticks = odp_time_ticks_diff(t1, t2); + ns = odp_time_tick_to_ns(ticks); odp_barrier_wait(barrier); clear_sched_queues(); - cycles = cycles/tot; + ticks = ticks / tot; ns = ns/tot; - printf(" [%i] %s enq+deq %"PRIu64" cycles, %"PRIu64" ns\n", - thr, str, cycles, ns); + printf(" [%i] %s enq+deq %"PRIu64" ticks, %"PRIu64" ns\n", + thr, str, ticks, ns); return 0; } @@ -421,7 +421,7 @@ static int test_schedule_many(const char *str, int thr, odp_queue_t queue; uint64_t t1 = 0; uint64_t t2 = 0; - uint64_t cycles, ns; + uint64_t ticks, ns; uint32_t i; uint32_t tot = 0; @@ -464,17 +464,17 @@ static int test_schedule_many(const char *str, int thr, odp_schedule_resume(); t2 = odp_time_tick(); - cycles = odp_time_ticks_diff(t1, t2); - ns = odp_time_tick_to_ns(cycles); + ticks = odp_time_ticks_diff(t1, t2); + ns = odp_time_tick_to_ns(ticks); odp_barrier_wait(barrier); clear_sched_queues(); - cycles = cycles/tot; + ticks = ticks / tot; ns = ns/tot; - printf(" [%i] %s enq+deq %"PRIu64" cycles, %"PRIu64" ns\n", - thr, str, cycles, ns); + printf(" [%i] %s enq+deq %"PRIu64" ticks, %"PRIu64" ns\n", + thr, str, ticks, ns); return 0; } @@ -498,7 +498,7 @@ static int test_schedule_multi(const char *str, int thr, odp_queue_t queue; uint64_t t1 = 0; uint64_t t2 = 0; - uint64_t cycles, ns; + uint64_t ticks, ns; int i, j; int num; uint32_t tot = 0; @@ -585,22 +585,22 @@ static int test_schedule_multi(const char *str, int thr, t2 = odp_time_tick(); - cycles = odp_time_ticks_diff(t1, t2); - ns = odp_time_tick_to_ns(cycles); + ticks = odp_time_ticks_diff(t1, t2); + ns = odp_time_tick_to_ns(ticks); odp_barrier_wait(barrier); clear_sched_queues(); if (tot) { - cycles = cycles/tot; + ticks = ticks / tot; ns = ns/tot; } else { - cycles = 0; + ticks = 0; ns = 0; } - printf(" [%i] %s enq+deq %"PRIu64" cycles, %"PRIu64" ns\n", - thr, str, cycles, ns); + printf(" [%i] %s enq+deq %"PRIu64" ticks, %"PRIu64" ns\n", + thr, str, ticks, ns); return 0; } @@ -714,13 +714,13 @@ static void *run_thread(void *arg) } /** - * @internal Test cycle counter accuracy + * @internal Test time counter accuracy */ static void test_time(void) { struct timespec tp1, tp2; uint64_t t1, t2; - uint64_t ns1, ns2, cycles; + uint64_t ns1, ns2, ticks; double err; if (clock_gettime(CLOCK_MONOTONIC, &tp2)) { @@ -757,13 +757,13 @@ static void test_time(void) else ns1 -= tp1.tv_nsec - tp2.tv_nsec; - cycles = odp_time_ticks_diff(t1, t2); - ns2 = odp_time_tick_to_ns(cycles); + ticks = odp_time_ticks_diff(t1, t2); + ns2 = odp_time_tick_to_ns(ticks); err = ((double)(ns2) - (double)ns1) / (double)ns1; printf("clock_gettime %"PRIu64" ns\n", ns1); - printf("odp_time_tick %"PRIu64" cycles\n", cycles); + printf("odp_time_tick %"PRIu64" cycles\n", ticks); printf("odp_time_tick_to_ns %"PRIu64" ns\n", ns2); printf("odp get cycle error %f%%\n", err*100.0); @@ -898,7 +898,7 @@ int main(int argc, char *argv[]) printf("first CPU: %i\n", odp_cpumask_first(&cpumask)); printf("cpu mask: %s\n", cpumaskstr); - /* Test cycle count accuracy */ + /* Test time count accuracy */ test_time(); shm = odp_shm_reserve("test_globals", diff --git a/test/validation/scheduler/scheduler.c b/test/validation/scheduler/scheduler.c index 5fb711f..bfe1f27 100644 --- a/test/validation/scheduler/scheduler.c +++ b/test/validation/scheduler/scheduler.c @@ -212,10 +212,10 @@ static void *schedule_common_(void *arg) CU_ASSERT(from != ODP_QUEUE_INVALID); if (locked) { int cnt; - uint64_t cycles = 0; + uint64_t ticks = 0; /* Do some work here to keep the thread busy */ for (cnt = 0; cnt < 1000; cnt++) - cycles += odp_time_tick(); + ticks += odp_time_tick(); odp_spinlock_unlock(&globals->atomic_lock); } diff --git a/test/validation/time/time.c b/test/validation/time/time.c index a6169aa..89aef00 100644 --- a/test/validation/time/time.c +++ b/test/validation/time/time.c @@ -11,48 +11,48 @@ #define TOLERANCE 1 #define BUSY_LOOP_CNT 100 -/* check that a cycles difference gives a reasonable result */ -static void time_test_odp_cycles_diff(void) +/* check that a counts difference gives a reasonable result */ +static void time_test_odp_counts_diff(void) { /* volatile to stop optimization of busy loop */ volatile int count = 0; - uint64_t diff, cycles1, cycles2; + uint64_t diff, t1, t2; - cycles1 = odp_time_tick(); + t1 = odp_time_tick(); while (count < BUSY_LOOP_CNT) { count++; }; - cycles2 = odp_time_tick(); - CU_ASSERT(cycles2 > cycles1); + t2 = odp_time_tick(); + CU_ASSERT(t2 > t1); - diff = odp_time_ticks_diff(cycles1, cycles2); + diff = odp_time_ticks_diff(t1, t2); CU_ASSERT(diff > 0); } -/* check that a negative cycles difference gives a reasonable result */ -static void time_test_odp_cycles_negative_diff(void) +/* check that a negative counts difference gives a reasonable result */ +static void time_test_odp_counts_negative_diff(void) { - uint64_t diff, cycles1, cycles2; + uint64_t diff, t1, t2; - cycles1 = 10; - cycles2 = 5; - diff = odp_time_ticks_diff(cycles1, cycles2); + t1 = 10; + t2 = 5; + diff = odp_time_ticks_diff(t1, t2); CU_ASSERT(diff > 0); } /* check that related conversions come back to the same value */ static void time_test_odp_time_conversion(void) { - uint64_t ns1, ns2, cycles; + uint64_t ns1, ns2, tick; uint64_t upper_limit, lower_limit; ns1 = 100; - cycles = odp_time_ns_to_tick(ns1); - CU_ASSERT(cycles > 0); + tick = odp_time_ns_to_tick(ns1); + CU_ASSERT(tick > 0); - ns2 = odp_time_tick_to_ns(cycles); + ns2 = odp_time_tick_to_ns(tick); /* need to check within arithmetic tolerance that the same * value in ns is returned after conversions */ @@ -62,8 +62,8 @@ static void time_test_odp_time_conversion(void) } CU_TestInfo time_suite_time[] = { - {"cycles diff", time_test_odp_cycles_diff}, - {"negative diff", time_test_odp_cycles_negative_diff}, + {"counts diff", time_test_odp_counts_diff}, + {"negative diff", time_test_odp_counts_negative_diff}, {"conversion", time_test_odp_time_conversion}, CU_TEST_INFO_NULL };