From patchwork Wed Aug 5 21:01:10 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ivan Khoronzhuk X-Patchwork-Id: 51974 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f72.google.com (mail-la0-f72.google.com [209.85.215.72]) by patches.linaro.org (Postfix) with ESMTPS id 00DA8229FD for ; Wed, 5 Aug 2015 21:02:13 +0000 (UTC) Received: by labkp1 with SMTP id kp1sf19833201lab.0 for ; Wed, 05 Aug 2015 14:02:12 -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=YCaiZGvPWnK80SRqrUYRQYpgDY/nekz6Ep5tRScw20E=; b=fQJjA3FmMyi8AOl1oRQlRUP8dfMIsHXSVOu9X0pc+MGC60S+NEFJo8ct25JacbOj36 ii16EDdZcFzHYKm/6tsCF/0q8RjXbgtezHh5EiiKdZQtl1NU+6VtP/lI65EZp/0ePuM4 +yJW5WRW1NVh/oyuD6bG0l9S5OyBdb7PjM8JNp6ax3AuBmxOf8bRyFcRUm6fKtGWbkh/ ZfWqT7SRcNwfcRpJ82GjdjYa0qhH7UY/Q8cz+1gUDkoXdVTo8AenekaVvm/+s4y1EVO0 KWvS9Ag/ScQ5ixqDtDyS+KrGwRnJLPHWCJMSWmkZIFCG3P4asKtZKOdH+WkByY3EA/zf 3BiQ== X-Gm-Message-State: ALoCoQlN6WKqw/f1ikzCG0HULLI1rKD1I9LQApOQYYSZwI0MZys8wgEkbgC7q136KuekCuUQFqQL X-Received: by 10.112.189.131 with SMTP id gi3mr3250318lbc.6.1438808531947; Wed, 05 Aug 2015 14:02:11 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.219.4 with SMTP id pk4ls244660lac.90.gmail; Wed, 05 Aug 2015 14:02:11 -0700 (PDT) X-Received: by 10.152.21.71 with SMTP id t7mr11033122lae.118.1438808531788; Wed, 05 Aug 2015 14:02:11 -0700 (PDT) Received: from mail-la0-f52.google.com (mail-la0-f52.google.com. [209.85.215.52]) by mx.google.com with ESMTPS id lk12si2978636lac.139.2015.08.05.14.02.11 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 05 Aug 2015 14:02:11 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.52 as permitted sender) client-ip=209.85.215.52; Received: by labgo9 with SMTP id go9so36706010lab.3 for ; Wed, 05 Aug 2015 14:02:11 -0700 (PDT) X-Received: by 10.152.6.69 with SMTP id y5mr11152939lay.72.1438808531641; Wed, 05 Aug 2015 14:02:11 -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 l6csp574872lba; Wed, 5 Aug 2015 14:02:10 -0700 (PDT) X-Received: by 10.140.201.200 with SMTP id w191mr21836462qha.50.1438808529700; Wed, 05 Aug 2015 14:02:09 -0700 (PDT) Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id 67si7703191qhy.7.2015.08.05.14.02.08; Wed, 05 Aug 2015 14:02:09 -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 D5CAB62075; Wed, 5 Aug 2015 21:02:08 +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 457B66206E; Wed, 5 Aug 2015 21:01:34 +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 CF57162064; Wed, 5 Aug 2015 21:01:25 +0000 (UTC) Received: from mail-wi0-f169.google.com (mail-wi0-f169.google.com [209.85.212.169]) by lists.linaro.org (Postfix) with ESMTPS id 5EECA62064 for ; Wed, 5 Aug 2015 21:01:23 +0000 (UTC) Received: by wijp15 with SMTP id p15so63868557wij.0 for ; Wed, 05 Aug 2015 14:01:22 -0700 (PDT) X-Received: by 10.194.184.82 with SMTP id es18mr25267875wjc.79.1438808482612; Wed, 05 Aug 2015 14:01:22 -0700 (PDT) Received: from khorivan.synapse.com (46-148-93-178.pool.ukrtel.net. [178.93.148.46]) by smtp.gmail.com with ESMTPSA id rz9sm5931423wjb.8.2015.08.05.14.01.21 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 05 Aug 2015 14:01:22 -0700 (PDT) From: Ivan Khoronzhuk To: lng-odp@lists.linaro.org Date: Thu, 6 Aug 2015 00:01:10 +0300 Message-Id: <1438808473-26968-2-git-send-email-ivan.khoronzhuk@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1438808473-26968-1-git-send-email-ivan.khoronzhuk@linaro.org> References: <1438808473-26968-1-git-send-email-ivan.khoronzhuk@linaro.org> X-Topics: patch Subject: [lng-odp] [API-NEXT PATCH 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.52 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..8a18322 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_counts(); continue; } - cycle = odp_time_cycles(); - diff = odp_time_diff_cycles(start_cycle, cycle); + cycle = odp_time_counts(); + diff = odp_time_diff_counts(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..ace280b 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_counts(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_counts_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_counts(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_counts_to_ns(cycles)); } printf("\n"); diff --git a/include/odp/api/time.h b/include/odp/api/time.h index b0072fc..6f15dec 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 counts of best hi-resolution timer available * - * @return Current time in CPU cycles + * @return Current time in timer counts */ -uint64_t odp_time_cycles(void); +uint64_t odp_time_counts(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 counts */ -uint64_t odp_time_diff_cycles(uint64_t t1, uint64_t t2); +uint64_t odp_time_diff_counts(uint64_t t1, uint64_t t2); /** - * Convert CPU cycles to nanoseconds + * Convert timer counts to nanoseconds * - * @param cycles Time in CPU cycles + * @param counts Time in timer counts * * @return Time in nanoseconds */ -uint64_t odp_time_cycles_to_ns(uint64_t cycles); +uint64_t odp_time_counts_to_ns(uint64_t counts); /** - * Convert nanoseconds to CPU cycles + * Convert nanoseconds to counts of best hi-resolution timer available * * @param ns Time in nanoseconds * - * @return Time in CPU cycles + * @return Time in timer counts */ -uint64_t odp_time_ns_to_cycles(uint64_t ns); +uint64_t odp_time_ns_to_counts(uint64_t ns); /** * @} diff --git a/test/performance/odp_pktio_perf.c b/test/performance/odp_pktio_perf.c index b09055f..0574536 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_counts( ODP_TIME_SEC / (targs->pps / targs->batch_len)); odp_barrier_wait(&globals->tx_barrier); - cur_cycles = odp_time_cycles(); + cur_cycles = odp_time_counts(); next_tx_cycles = cur_cycles; end_cycles = cur_cycles + - odp_time_ns_to_cycles(targs->duration * ODP_TIME_SEC); + odp_time_ns_to_counts(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_counts(); 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_diff_counts( 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_counts(); } 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_counts_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_counts() + odp_time_ns_to_counts(wait_ns); + + while (odp_time_counts() < end) ; } diff --git a/test/performance/odp_scheduling.c b/test/performance/odp_scheduling.c index c425024..3969111 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_counts(); 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_counts(); + cycles = odp_time_diff_counts(t1, t2); + ns = odp_time_counts_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_counts(); 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_counts(); + cycles = odp_time_diff_counts(t1, t2); + ns = odp_time_counts_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_counts(); 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_counts(); + cycles = odp_time_diff_counts(t1, t2); + ns = odp_time_counts_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_counts(); 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_counts(); + cycles = odp_time_diff_counts(t1, t2); + ns = odp_time_counts_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_counts(); 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_counts(); + cycles = odp_time_diff_counts(t1, t2); + ns = odp_time_counts_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_counts(); 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_counts(); + cycles = odp_time_diff_counts(t1, t2); + ns = odp_time_counts_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_counts(); 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_counts(); 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_diff_counts(t1, t2); + ns2 = odp_time_counts_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_counts %"PRIu64" cycles\n", cycles); + printf("odp_time_counts_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..1dc744e 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_counts(); 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_counts(); + diff = odp_time_diff_counts(start, now); + } while (odp_time_counts_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_counts(); 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_counts(); + diff = odp_time_diff_counts(start, now); + } while (odp_time_counts_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..22d19a6 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_counts(); odp_spinlock_unlock(&globals->atomic_lock); } diff --git a/test/validation/time/time.c b/test/validation/time/time.c index 0aac599..8ef7f2a 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_counts(); while (count < BUSY_LOOP_CNT) { count++; }; - cycles2 = odp_time_cycles(); + cycles2 = odp_time_counts(); CU_ASSERT(cycles2 > cycles1); - diff = odp_time_diff_cycles(cycles1, cycles2); + diff = odp_time_diff_counts(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_diff_counts(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_counts(ns1); CU_ASSERT(cycles > 0); - ns2 = odp_time_cycles_to_ns(cycles); + ns2 = odp_time_counts_to_ns(cycles); /* need to check within arithmetic tolerance that the same * value in ns is returned after conversions */