From patchwork Fri Aug 7 22:28:07 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ivan Khoronzhuk X-Patchwork-Id: 52051 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f200.google.com (mail-wi0-f200.google.com [209.85.212.200]) by patches.linaro.org (Postfix) with ESMTPS id 0501920539 for ; Fri, 7 Aug 2015 22:29:39 +0000 (UTC) Received: by wibdx1 with SMTP id dx1sf21814201wib.2 for ; Fri, 07 Aug 2015 15:29:38 -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=Ebua7FYoGozop/f6efLgeKA31NAB7uEnlOyrBq+Y/K8=; b=Z+7Xm0dNv5H4xrwUMj8KkYKK2L+kPT8k9DVTIMRPCcHCF+PL7gE0tSfhCq5CVcwFvt ue95vFIR962zJQnCsqCAjNc36o3kcklZHddR984u2FOTsks42apa+U8PvnvRfLxcaGdw QLD/2ZY8bAWkiheLNaMW9hptkhGA3xkGBX0NOKx4zSaRexM0jdjnp3MQ5PI7ERwRv8kq 07WyvlqDfns/Ntob+MBFvkovLrnRm1PG0PdvyZo2Mtl7eFVBrQZoCR4PKC5wPY3wLFTP 3nlqxpiIe/nPa4+lmwq6xeOluRqC4mu1xYhaFzJvukUNBsun7ilYLTlqMvZaG7PIqlb9 xE3g== X-Gm-Message-State: ALoCoQllkbPf6zZj0zQg+0lRyfossULjCXsYJMaam5gzLgq9K4+I7cF6Wpv6tRQHIMoqsAWiVix2 X-Received: by 10.112.122.42 with SMTP id lp10mr2827107lbb.5.1438986578297; Fri, 07 Aug 2015 15:29:38 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.8.201 with SMTP id t9ls494242laa.95.gmail; Fri, 07 Aug 2015 15:29:38 -0700 (PDT) X-Received: by 10.152.43.41 with SMTP id t9mr10258824lal.4.1438986578137; Fri, 07 Aug 2015 15:29:38 -0700 (PDT) Received: from mail-la0-f51.google.com (mail-la0-f51.google.com. [209.85.215.51]) by mx.google.com with ESMTPS id o10si8641993lao.120.2015.08.07.15.29.38 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 07 Aug 2015 15:29:38 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.51 as permitted sender) client-ip=209.85.215.51; Received: by labjt7 with SMTP id jt7so57423860lab.0 for ; Fri, 07 Aug 2015 15:29:38 -0700 (PDT) X-Received: by 10.152.203.134 with SMTP id kq6mr10263600lac.106.1438986577966; Fri, 07 Aug 2015 15:29:37 -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 l6csp642843lba; Fri, 7 Aug 2015 15:29:36 -0700 (PDT) X-Received: by 10.55.15.148 with SMTP id 20mr17225084qkp.36.1438986576064; Fri, 07 Aug 2015 15:29:36 -0700 (PDT) Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id b97si736378qge.22.2015.08.07.15.29.35; Fri, 07 Aug 2015 15:29:36 -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 4C7FD62316; Fri, 7 Aug 2015 22:29:35 +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 077A762342; Fri, 7 Aug 2015 22:29:03 +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 0C2386230D; Fri, 7 Aug 2015 22:28:44 +0000 (UTC) Received: from mail-la0-f50.google.com (mail-la0-f50.google.com [209.85.215.50]) by lists.linaro.org (Postfix) with ESMTPS id 087516230D for ; Fri, 7 Aug 2015 22:28:42 +0000 (UTC) Received: by lagz9 with SMTP id z9so29441483lag.3 for ; Fri, 07 Aug 2015 15:28:40 -0700 (PDT) X-Received: by 10.112.53.229 with SMTP id e5mr10183870lbp.61.1438986520701; Fri, 07 Aug 2015 15:28:40 -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.39 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 07 Aug 2015 15:28:40 -0700 (PDT) From: Ivan Khoronzhuk To: lng-odp@lists.linaro.org Date: Sat, 8 Aug 2015 01:28:07 +0300 Message-Id: <1438986490-12100-2-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 1/4] api: time: unbind CPU cycles from time API 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.215.51 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 Current time API supposes that frequency of counter is equal to CPU frequency. But that's not always true, for instance, in case if no access to CPU cycle counter, another hi-resolution timer can be used, and it`s frequency can be different from CPU frequency. There is no big difference in which cycles to measure time, the better hi-resolution timer the better measurements. So, unbind CPU cycle counter from time API by eliminating word "cycle" as it's believed to use with CPU. Signed-off-by: Ivan Khoronzhuk --- example/ipsec/odp_ipsec.c | 6 ++-- example/timer/odp_timer_test.c | 8 ++--- include/odp/api/time.h | 22 ++++++------- test/performance/odp_pktio_perf.c | 19 +++++------ test/performance/odp_scheduling.c | 60 +++++++++++++++++------------------ test/validation/pktio/pktio.c | 16 +++++----- test/validation/scheduler/scheduler.c | 2 +- test/validation/time/time.c | 12 +++---- 8 files changed, 73 insertions(+), 72 deletions(-) diff --git a/example/ipsec/odp_ipsec.c b/example/ipsec/odp_ipsec.c index d392925..3d34210 100644 --- a/example/ipsec/odp_ipsec.c +++ b/example/ipsec/odp_ipsec.c @@ -293,12 +293,12 @@ odp_event_t polled_odp_schedule(odp_queue_t *from, uint64_t wait) break; if (0 == start_cycle) { - start_cycle = odp_time_cycles(); + start_cycle = odp_time_tick(); continue; } - cycle = odp_time_cycles(); - diff = odp_time_diff_cycles(start_cycle, cycle); + cycle = odp_time_tick(); + diff = odp_time_ticks_diff(start_cycle, cycle); if (wait < diff) break; diff --git a/example/timer/odp_timer_test.c b/example/timer/odp_timer_test.c index 5d362ec..c6c809d 100644 --- a/example/timer/odp_timer_test.c +++ b/example/timer/odp_timer_test.c @@ -440,19 +440,19 @@ int main(int argc, char *argv[]) printf("CPU freq %"PRIu64" Hz\n", odp_sys_cpu_hz()); printf("Cycles vs nanoseconds:\n"); ns = 0; - cycles = odp_time_ns_to_cycles(ns); + cycles = 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_cycles_to_ns(cycles)); + odp_time_tick_to_ns(cycles)); for (ns = 1; ns <= 100*ODP_TIME_SEC; ns *= 10) { - cycles = odp_time_ns_to_cycles(ns); + cycles = 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_cycles_to_ns(cycles)); + odp_time_tick_to_ns(cycles)); } printf("\n"); diff --git a/include/odp/api/time.h b/include/odp/api/time.h index b0072fc..b48dcae 100644 --- a/include/odp/api/time.h +++ b/include/odp/api/time.h @@ -30,11 +30,11 @@ extern "C" { /** - * Current time in CPU cycles + * Current time in ticks of best hi-resolution timer available * - * @return Current time in CPU cycles + * @return Current time in timer ticks */ -uint64_t odp_time_cycles(void); +uint64_t odp_time_tick(void); /** @@ -43,29 +43,29 @@ uint64_t odp_time_cycles(void); * @param t1 First time stamp * @param t2 Second time stamp * - * @return Difference of time stamps in CPU cycles + * @return Difference of time stamps in timer ticks */ -uint64_t odp_time_diff_cycles(uint64_t t1, uint64_t t2); +uint64_t odp_time_ticks_diff(uint64_t t1, uint64_t t2); /** - * Convert CPU cycles to nanoseconds + * Convert timer ticks to nanoseconds * - * @param cycles Time in CPU cycles + * @param ticks Time in timer ticks * * @return Time in nanoseconds */ -uint64_t odp_time_cycles_to_ns(uint64_t cycles); +uint64_t odp_time_tick_to_ns(uint64_t ticks); /** - * Convert nanoseconds to CPU cycles + * Convert nanoseconds to ticks of best hi-resolution timer available * * @param ns Time in nanoseconds * - * @return Time in CPU cycles + * @return Time in timer ticks */ -uint64_t odp_time_ns_to_cycles(uint64_t ns); +uint64_t odp_time_ns_to_tick(uint64_t ns); /** * @} diff --git a/test/performance/odp_pktio_perf.c b/test/performance/odp_pktio_perf.c index b09055f..b3f8d2b 100644 --- a/test/performance/odp_pktio_perf.c +++ b/test/performance/odp_pktio_perf.c @@ -325,28 +325,28 @@ 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_cycles( + burst_gap_cycles = odp_time_ns_to_tick( ODP_TIME_SEC / (targs->pps / targs->batch_len)); odp_barrier_wait(&globals->tx_barrier); - cur_cycles = odp_time_cycles(); + cur_cycles = odp_time_tick(); next_tx_cycles = cur_cycles; end_cycles = cur_cycles + - odp_time_ns_to_cycles(targs->duration * ODP_TIME_SEC); + odp_time_ns_to_tick(targs->duration * ODP_TIME_SEC); while (cur_cycles < end_cycles) { unsigned alloc_cnt = 0, tx_cnt; if (cur_cycles < next_tx_cycles) { - cur_cycles = odp_time_cycles(); + cur_cycles = odp_time_tick(); if (idle_start == 0) idle_start = cur_cycles; continue; } if (idle_start) { - stats->s.idle_cycles += odp_time_diff_cycles( + stats->s.idle_cycles += odp_time_ticks_diff( idle_start, cur_cycles); idle_start = 0; } @@ -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_cycles(); + cur_cycles = 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_cycles_to_ns(stats->s.idle_cycles)/1000/1000); + odp_time_tick_to_ns(stats->s.idle_cycles) / 1000 / 1000); return NULL; } @@ -587,8 +587,9 @@ static int setup_txrx_masks(odp_cpumask_t *thd_mask_tx, */ static void busy_loop_ns(uint64_t wait_ns) { - uint64_t end = odp_time_cycles() + odp_time_ns_to_cycles(wait_ns); - while (odp_time_cycles() < end) + uint64_t end = odp_time_tick() + odp_time_ns_to_tick(wait_ns); + + while (odp_time_tick() < end) ; } diff --git a/test/performance/odp_scheduling.c b/test/performance/odp_scheduling.c index c425024..e34cea9 100644 --- a/test/performance/odp_scheduling.c +++ b/test/performance/odp_scheduling.c @@ -185,7 +185,7 @@ static int test_alloc_single(int thr, odp_pool_t pool) odp_buffer_t temp_buf; uint64_t t1, t2, cycles, ns; - t1 = odp_time_cycles(); + t1 = odp_time_tick(); for (i = 0; i < ALLOC_ROUNDS; i++) { temp_buf = odp_buffer_alloc(pool); @@ -198,9 +198,9 @@ static int test_alloc_single(int thr, odp_pool_t pool) odp_buffer_free(temp_buf); } - t2 = odp_time_cycles(); - cycles = odp_time_diff_cycles(t1, t2); - ns = odp_time_cycles_to_ns(cycles); + t2 = odp_time_tick(); + cycles = odp_time_ticks_diff(t1, t2); + ns = odp_time_tick_to_ns(cycles); printf(" [%i] alloc_sng alloc+free %"PRIu64" cycles, %"PRIu64" ns\n", thr, cycles/ALLOC_ROUNDS, ns/ALLOC_ROUNDS); @@ -222,7 +222,7 @@ static int test_alloc_multi(int thr, odp_pool_t pool) odp_buffer_t temp_buf[MAX_ALLOCS]; uint64_t t1, t2, cycles, ns; - t1 = odp_time_cycles(); + t1 = odp_time_tick(); for (i = 0; i < ALLOC_ROUNDS; i++) { for (j = 0; j < MAX_ALLOCS; j++) { @@ -238,9 +238,9 @@ static int test_alloc_multi(int thr, odp_pool_t pool) odp_buffer_free(temp_buf[j-1]); } - t2 = odp_time_cycles(); - cycles = odp_time_diff_cycles(t1, t2); - ns = odp_time_cycles_to_ns(cycles); + t2 = odp_time_tick(); + cycles = odp_time_ticks_diff(t1, t2); + ns = odp_time_tick_to_ns(cycles); printf(" [%i] alloc_multi alloc+free %"PRIu64" cycles, %"PRIu64" ns\n", thr, cycles/(ALLOC_ROUNDS*MAX_ALLOCS), @@ -289,7 +289,7 @@ static int test_poll_queue(int thr, odp_pool_t msg_pool) return -1; } - t1 = odp_time_cycles(); + t1 = odp_time_tick(); for (i = 0; i < QUEUE_ROUNDS; i++) { ev = odp_buffer_to_event(buf); @@ -310,9 +310,9 @@ static int test_poll_queue(int thr, odp_pool_t msg_pool) } } - t2 = odp_time_cycles(); - cycles = odp_time_diff_cycles(t1, t2); - ns = odp_time_cycles_to_ns(cycles); + t2 = odp_time_tick(); + cycles = odp_time_ticks_diff(t1, t2); + ns = odp_time_tick_to_ns(cycles); printf(" [%i] poll_queue enq+deq %"PRIu64" cycles, %"PRIu64" ns\n", thr, cycles/QUEUE_ROUNDS, ns/QUEUE_ROUNDS); @@ -348,7 +348,7 @@ static int test_schedule_single(const char *str, int thr, if (create_queue(thr, msg_pool, prio)) return -1; - t1 = odp_time_cycles(); + t1 = odp_time_tick(); for (i = 0; i < QUEUE_ROUNDS; i++) { ev = odp_schedule(&queue, ODP_SCHED_WAIT); @@ -382,9 +382,9 @@ static int test_schedule_single(const char *str, int thr, odp_schedule_resume(); - t2 = odp_time_cycles(); - cycles = odp_time_diff_cycles(t1, t2); - ns = odp_time_cycles_to_ns(cycles); + t2 = odp_time_tick(); + cycles = odp_time_ticks_diff(t1, t2); + ns = odp_time_tick_to_ns(cycles); odp_barrier_wait(barrier); clear_sched_queues(); @@ -429,7 +429,7 @@ static int test_schedule_many(const char *str, int thr, return -1; /* Start sched-enq loop */ - t1 = odp_time_cycles(); + t1 = odp_time_tick(); for (i = 0; i < QUEUE_ROUNDS; i++) { ev = odp_schedule(&queue, ODP_SCHED_WAIT); @@ -463,9 +463,9 @@ static int test_schedule_many(const char *str, int thr, odp_schedule_resume(); - t2 = odp_time_cycles(); - cycles = odp_time_diff_cycles(t1, t2); - ns = odp_time_cycles_to_ns(cycles); + t2 = odp_time_tick(); + cycles = odp_time_ticks_diff(t1, t2); + ns = odp_time_tick_to_ns(cycles); odp_barrier_wait(barrier); clear_sched_queues(); @@ -547,7 +547,7 @@ static int test_schedule_multi(const char *str, int thr, } /* Start sched-enq loop */ - t1 = odp_time_cycles(); + t1 = odp_time_tick(); for (i = 0; i < QUEUE_ROUNDS; i++) { num = odp_schedule_multi(&queue, ODP_SCHED_WAIT, ev, @@ -584,9 +584,9 @@ static int test_schedule_multi(const char *str, int thr, odp_schedule_resume(); - t2 = odp_time_cycles(); - cycles = odp_time_diff_cycles(t1, t2); - ns = odp_time_cycles_to_ns(cycles); + t2 = odp_time_tick(); + cycles = odp_time_ticks_diff(t1, t2); + ns = odp_time_tick_to_ns(cycles); odp_barrier_wait(barrier); clear_sched_queues(); @@ -738,7 +738,7 @@ static void test_time(void) } while (tp1.tv_sec == tp2.tv_sec); - t1 = odp_time_cycles(); + t1 = odp_time_tick(); do { if (clock_gettime(CLOCK_MONOTONIC, &tp2)) { @@ -748,7 +748,7 @@ static void test_time(void) } while ((tp2.tv_sec - tp1.tv_sec) < TEST_SEC); - t2 = odp_time_cycles(); + t2 = odp_time_tick(); ns1 = (tp2.tv_sec - tp1.tv_sec)*1000000000; @@ -757,14 +757,14 @@ static void test_time(void) else ns1 -= tp1.tv_nsec - tp2.tv_nsec; - cycles = odp_time_diff_cycles(t1, t2); - ns2 = odp_time_cycles_to_ns(cycles); + cycles = odp_time_ticks_diff(t1, t2); + ns2 = odp_time_tick_to_ns(cycles); err = ((double)(ns2) - (double)ns1) / (double)ns1; printf("clock_gettime %"PRIu64" ns\n", ns1); - printf("odp_time_cycles %"PRIu64" cycles\n", cycles); - printf("odp_time_cycles_to_ns %"PRIu64" ns\n", ns2); + printf("odp_time_tick %"PRIu64" cycles\n", cycles); + printf("odp_time_tick_to_ns %"PRIu64" ns\n", ns2); printf("odp get cycle error %f%%\n", err*100.0); printf("\n"); diff --git a/test/validation/pktio/pktio.c b/test/validation/pktio/pktio.c index dc8d427..e32c7df 100644 --- a/test/validation/pktio/pktio.c +++ b/test/validation/pktio/pktio.c @@ -305,15 +305,15 @@ static odp_event_t queue_deq_wait_time(odp_queue_t queue, uint64_t ns) uint64_t start, now, diff; odp_event_t ev; - start = odp_time_cycles(); + start = odp_time_tick(); do { ev = odp_queue_deq(queue); if (ev != ODP_EVENT_INVALID) return ev; - now = odp_time_cycles(); - diff = odp_time_diff_cycles(start, now); - } while (odp_time_cycles_to_ns(diff) < ns); + now = odp_time_tick(); + diff = odp_time_ticks_diff(start, now); + } while (odp_time_tick_to_ns(diff) < ns); return ODP_EVENT_INVALID; } @@ -325,7 +325,7 @@ static odp_packet_t wait_for_packet(odp_queue_t queue, odp_event_t ev; odp_packet_t pkt = ODP_PACKET_INVALID; - start = odp_time_cycles(); + start = odp_time_tick(); do { if (queue != ODP_QUEUE_INVALID && @@ -345,9 +345,9 @@ static odp_packet_t wait_for_packet(odp_queue_t queue, odp_event_free(ev); } - now = odp_time_cycles(); - diff = odp_time_diff_cycles(start, now); - } while (odp_time_cycles_to_ns(diff) < ns); + now = odp_time_tick(); + diff = odp_time_ticks_diff(start, now); + } while (odp_time_tick_to_ns(diff) < ns); CU_FAIL("failed to receive transmitted packet"); diff --git a/test/validation/scheduler/scheduler.c b/test/validation/scheduler/scheduler.c index fe03ab7..5fb711f 100644 --- a/test/validation/scheduler/scheduler.c +++ b/test/validation/scheduler/scheduler.c @@ -215,7 +215,7 @@ static void *schedule_common_(void *arg) uint64_t cycles = 0; /* Do some work here to keep the thread busy */ for (cnt = 0; cnt < 1000; cnt++) - cycles += odp_time_cycles(); + cycles += odp_time_tick(); odp_spinlock_unlock(&globals->atomic_lock); } diff --git a/test/validation/time/time.c b/test/validation/time/time.c index 0aac599..a6169aa 100644 --- a/test/validation/time/time.c +++ b/test/validation/time/time.c @@ -18,16 +18,16 @@ static void time_test_odp_cycles_diff(void) volatile int count = 0; uint64_t diff, cycles1, cycles2; - cycles1 = odp_time_cycles(); + cycles1 = odp_time_tick(); while (count < BUSY_LOOP_CNT) { count++; }; - cycles2 = odp_time_cycles(); + cycles2 = odp_time_tick(); CU_ASSERT(cycles2 > cycles1); - diff = odp_time_diff_cycles(cycles1, cycles2); + diff = odp_time_ticks_diff(cycles1, cycles2); CU_ASSERT(diff > 0); } @@ -38,7 +38,7 @@ static void time_test_odp_cycles_negative_diff(void) cycles1 = 10; cycles2 = 5; - diff = odp_time_diff_cycles(cycles1, cycles2); + diff = odp_time_ticks_diff(cycles1, cycles2); CU_ASSERT(diff > 0); } @@ -49,10 +49,10 @@ static void time_test_odp_time_conversion(void) uint64_t upper_limit, lower_limit; ns1 = 100; - cycles = odp_time_ns_to_cycles(ns1); + cycles = odp_time_ns_to_tick(ns1); CU_ASSERT(cycles > 0); - ns2 = odp_time_cycles_to_ns(cycles); + ns2 = odp_time_tick_to_ns(cycles); /* need to check within arithmetic tolerance that the same * value in ns is returned after conversions */