From patchwork Fri Sep 11 10:04:45 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ivan Khoronzhuk X-Patchwork-Id: 53432 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 45255215BF for ; Fri, 11 Sep 2015 10:08:53 +0000 (UTC) Received: by wicgb1 with SMTP id gb1sf16750272wic.3 for ; Fri, 11 Sep 2015 03:08:52 -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=JcA92dGU3AmIJVTCXJZ/CrvmxqOW06Dy0ClT+JSYBk0=; b=eKiI+RiY0QdS4x9KUtlb1ko2FnSHwhP56kXM6pEpTy72gmtCRRvpJ4Ga1VQcFH8JBl tPpZ2NnG5la+W24hhSxTyk7VjviYBsN8pmmsntFuC91mNaX5E9kCRuBGlftMYH65d3Ba L7j33Qb/xZhfukYc71w12RWzBqEsC6gLbOvMaRsoIly78EXMXtiYyyQVRNbEkJ1H1DJu WMKR+hzTP9ikJpx7Ai2FGgBWWVQJpJe1906/RGMskncstsEMOHeCxwFLXcDak6ZsE1fd 16NzypKTK28mpX3pAjomkxY1v+TJzBy9XVEWQCG1dA5JhcmVmKqe3S1XUHew0Ny4y/WB xQqg== X-Gm-Message-State: ALoCoQnPcUIArOO22m3sUERRAiNs3kVD46zzUFhLbsTxF0dTrI4K/L04JXVXD70LPCvjNNCeah6X X-Received: by 10.112.173.230 with SMTP id bn6mr11004688lbc.15.1441966132523; Fri, 11 Sep 2015 03:08:52 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.224.129 with SMTP id rc1ls307638lac.6.gmail; Fri, 11 Sep 2015 03:08:52 -0700 (PDT) X-Received: by 10.112.199.230 with SMTP id jn6mr24882787lbc.12.1441966132373; Fri, 11 Sep 2015 03:08:52 -0700 (PDT) Received: from mail-la0-f42.google.com (mail-la0-f42.google.com. [209.85.215.42]) by mx.google.com with ESMTPS id a9si536419laf.15.2015.09.11.03.08.52 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 11 Sep 2015 03:08:52 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.42 as permitted sender) client-ip=209.85.215.42; Received: by lagj9 with SMTP id j9so45478733lag.2 for ; Fri, 11 Sep 2015 03:08:52 -0700 (PDT) X-Received: by 10.112.166.106 with SMTP id zf10mr40844264lbb.36.1441966132274; Fri, 11 Sep 2015 03:08:52 -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 w3csp1485518lbq; Fri, 11 Sep 2015 03:08:51 -0700 (PDT) X-Received: by 10.55.221.213 with SMTP id u82mr61968276qku.0.1441966131406; Fri, 11 Sep 2015 03:08:51 -0700 (PDT) Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id l15si533975qkh.74.2015.09.11.03.08.50; Fri, 11 Sep 2015 03:08:51 -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 7F31761995; Fri, 11 Sep 2015 10:08:50 +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 09EBE61979; Fri, 11 Sep 2015 10:08:14 +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 6CC2561989; Fri, 11 Sep 2015 10:08:07 +0000 (UTC) Received: from mail-wi0-f174.google.com (mail-wi0-f174.google.com [209.85.212.174]) by lists.linaro.org (Postfix) with ESMTPS id 2058761983 for ; Fri, 11 Sep 2015 10:05:37 +0000 (UTC) Received: by wicfx3 with SMTP id fx3so52288856wic.0 for ; Fri, 11 Sep 2015 03:05:36 -0700 (PDT) X-Received: by 10.194.83.70 with SMTP id o6mr40694841wjy.44.1441965936311; Fri, 11 Sep 2015 03:05:36 -0700 (PDT) Received: from khorivan.synapse.com ([195.238.92.128]) by smtp.gmail.com with ESMTPSA id ww8sm987313wjb.4.2015.09.11.03.05.34 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 11 Sep 2015 03:05:35 -0700 (PDT) From: Ivan Khoronzhuk To: lng-odp@lists.linaro.org Date: Fri, 11 Sep 2015 13:04:45 +0300 Message-Id: <1441965889-15727-2-git-send-email-ivan.khoronzhuk@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1441965889-15727-1-git-send-email-ivan.khoronzhuk@linaro.org> References: <1441965889-15727-1-git-send-email-ivan.khoronzhuk@linaro.org> X-Topics: timers patch Subject: [lng-odp] [PATCH v2 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.215.42 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 here conversion cycles/ns table. More correct to print here 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");