From patchwork Thu Sep 17 08:31:27 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ivan Khoronzhuk X-Patchwork-Id: 53774 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f71.google.com (mail-la0-f71.google.com [209.85.215.71]) by patches.linaro.org (Postfix) with ESMTPS id 0E5C422E57 for ; Thu, 17 Sep 2015 08:32:55 +0000 (UTC) Received: by lagj9 with SMTP id j9sf4070990lag.0 for ; Thu, 17 Sep 2015 01:32:54 -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=4U8Mp7tn0BZZUg9ge3xnvJnwLgmQgomITkkDTeuAv/g=; b=D6TIBhG+MPqKE9L5i2Ap88EYYW7YLTZN3wjZI6QXpnCNPWS1Oe7MHqvsPwDOZ6ldC+ BLifqxXNGOXCXqnUJ015kCYsImcHNS2nzufvd+44HvGZnpGd/q3qM3ZdB8DAg2D7AUnU dXRwKJl7AsAy8yO/K14zeZuLt5YbxOjiC6n/eR8E7/8sWH7YVUsBrtlcTCYmMmqXWLms xq+6X6S3UwA7qOYC/PkcRMNgXhQ0fat+MHb1vF4rwH6MEvmNY2Gbka6jgR0GyX7yB8g1 4Z4K+dgU15yLxs4fW93CeZmr6GNJjMAxMSH1b7/eLcPAYWn2DMWE3XFwnoPapqHNCRve zt0Q== X-Gm-Message-State: ALoCoQnfGiL7elG2ulPlY6oXk4XX2sYN5kOV2SYc5004Eyf0OHjgxiIZuOeuvXJPLbxA5uKesKK0 X-Received: by 10.194.115.135 with SMTP id jo7mr6310395wjb.7.1442478773985; Thu, 17 Sep 2015 01:32:53 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.28.41 with SMTP id y9ls49312lag.109.gmail; Thu, 17 Sep 2015 01:32:53 -0700 (PDT) X-Received: by 10.152.37.162 with SMTP id z2mr29639650laj.117.1442478773817; Thu, 17 Sep 2015 01:32:53 -0700 (PDT) Received: from mail-lb0-f175.google.com (mail-lb0-f175.google.com. [209.85.217.175]) by mx.google.com with ESMTPS id li6si1502322lab.27.2015.09.17.01.32.53 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 17 Sep 2015 01:32:53 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.175 as permitted sender) client-ip=209.85.217.175; Received: by lbcao8 with SMTP id ao8so5401049lbc.3 for ; Thu, 17 Sep 2015 01:32:53 -0700 (PDT) X-Received: by 10.112.130.70 with SMTP id oc6mr22718326lbb.32.1442478773516; Thu, 17 Sep 2015 01:32:53 -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.59.35 with SMTP id w3csp2925792lbq; Thu, 17 Sep 2015 01:32:52 -0700 (PDT) X-Received: by 10.50.45.33 with SMTP id j1mr3890068igm.61.1442478772519; Thu, 17 Sep 2015 01:32:52 -0700 (PDT) Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id i34si1529438ioo.198.2015.09.17.01.32.52; Thu, 17 Sep 2015 01:32:52 -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 034B562D48; Thu, 17 Sep 2015 08:32:51 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on ip-10-142-244-252 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 [127.0.0.1] (localhost [127.0.0.1]) by lists.linaro.org (Postfix) with ESMTP id 714EA62C21; Thu, 17 Sep 2015 08:32:17 +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 8BF4C62D48; Thu, 17 Sep 2015 08:32:07 +0000 (UTC) Received: from mail-wi0-f177.google.com (mail-wi0-f177.google.com [209.85.212.177]) by lists.linaro.org (Postfix) with ESMTPS id 39A7D61A22 for ; Thu, 17 Sep 2015 08:31:40 +0000 (UTC) Received: by wicge5 with SMTP id ge5so107933158wic.0 for ; Thu, 17 Sep 2015 01:31:39 -0700 (PDT) X-Received: by 10.180.105.135 with SMTP id gm7mr26802192wib.18.1442478699449; Thu, 17 Sep 2015 01:31:39 -0700 (PDT) Received: from localhost.localdomain ([195.238.92.128]) by smtp.gmail.com with ESMTPSA id s16sm8743445wik.13.2015.09.17.01.31.38 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 17 Sep 2015 01:31:38 -0700 (PDT) From: Ivan Khoronzhuk To: lng-odp@lists.linaro.org Date: Thu, 17 Sep 2015 11:31:27 +0300 Message-Id: <1442478691-30098-2-git-send-email-ivan.khoronzhuk@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1442478691-30098-1-git-send-email-ivan.khoronzhuk@linaro.org> References: <1442478691-30098-1-git-send-email-ivan.khoronzhuk@linaro.org> X-Topics: timers patch Subject: [lng-odp] [PATCH v3 1/5] example: timer: print timer ticks/ns table instead of cycles/ns 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.175 as permitted sender) smtp.mailfrom=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 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 --- example/timer/odp_timer_test.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) 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");