From patchwork Tue Sep 2 12:47:24 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Petri Savolainen X-Patchwork-Id: 36466 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ie0-f200.google.com (mail-ie0-f200.google.com [209.85.223.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 0533C20670 for ; Tue, 2 Sep 2014 12:46:38 +0000 (UTC) Received: by mail-ie0-f200.google.com with SMTP id at20sf37378273iec.7 for ; Tue, 02 Sep 2014 05:46: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: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:errors-to:sender :x-original-sender:x-original-authentication-results:mailing-list :content-type:content-transfer-encoding; bh=GSzaxVeFur/WRvNWaSwUgZ6Iu9A30Q1AiGOZiuw20TE=; b=LtYni2NVx73dNQKMLadZtu3Qn1wKyc6eLwez3fWXWL5+6HVhgXZIK/0etzFtyBg0op sSYn1Rxnc5imIeQCQV1PTjfeqmKdrnK+XypdPwEtfXxL3wEjjA9F6Kx6od0PVWKlPXee aEOj/yujgV35Nz5Y/Avyvddg9dbcAv6SG1MpVeUN2ZPg9No4cAXPnwo0xl8ThswQFshr X0lCiG9y5Ma0pJkf+Bp+HXsyvYPjjQHTx+srIwfZ2QwE368Qo+S+4EUKi8SCIpxO0wxE +cEHEntCa8rTXYFyiykx7DBvyQj6JG1i1E1LHWpvEelpD+m/jlahj4MzZAUnq6uhk6An KHRQ== X-Gm-Message-State: ALoCoQngS7pxHXVjTQg0H5YLZsQ2/c3qW3zWpIrAFSVpAezkKJ0as+CVmSCK98ZXf4ZVlTIoLXvA X-Received: by 10.182.241.1 with SMTP id we1mr18016481obc.37.1409661998660; Tue, 02 Sep 2014 05:46:38 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.44.119 with SMTP id f110ls1878356qga.96.gmail; Tue, 02 Sep 2014 05:46:38 -0700 (PDT) X-Received: by 10.221.44.69 with SMTP id uf5mr30014997vcb.4.1409661998578; Tue, 02 Sep 2014 05:46:38 -0700 (PDT) Received: from mail-vc0-f174.google.com (mail-vc0-f174.google.com [209.85.220.174]) by mx.google.com with ESMTPS id p18si2189659vdg.54.2014.09.02.05.46.38 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 02 Sep 2014 05:46:38 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.174 as permitted sender) client-ip=209.85.220.174; Received: by mail-vc0-f174.google.com with SMTP id hy4so6771523vcb.5 for ; Tue, 02 Sep 2014 05:46:38 -0700 (PDT) X-Received: by 10.220.168.210 with SMTP id v18mr30161097vcy.3.1409661998502; Tue, 02 Sep 2014 05:46:38 -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.221.45.67 with SMTP id uj3csp521747vcb; Tue, 2 Sep 2014 05:46:38 -0700 (PDT) X-Received: by 10.140.25.226 with SMTP id 89mr48728147qgt.62.1409661995600; Tue, 02 Sep 2014 05:46:35 -0700 (PDT) Received: from ip-10-141-164-156.ec2.internal (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTPS id t6si5073139qcc.21.2014.09.02.05.46.34 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Tue, 02 Sep 2014 05:46:35 -0700 (PDT) Received-SPF: none (google.com: lng-odp-bounces@lists.linaro.org does not designate permitted sender hosts) client-ip=54.225.227.206; Received: from localhost ([127.0.0.1] helo=ip-10-141-164-156.ec2.internal) by ip-10-141-164-156.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1XOnTm-0005NL-5m; Tue, 02 Sep 2014 12:46:34 +0000 Received: from mail-qc0-f170.google.com ([209.85.216.170]) by ip-10-141-164-156.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1XOnTe-0005N4-AB for lng-odp@lists.linaro.org; Tue, 02 Sep 2014 12:46:26 +0000 Received: by mail-qc0-f170.google.com with SMTP id r5so6845742qcx.1 for ; Tue, 02 Sep 2014 05:46:21 -0700 (PDT) X-Received: by 10.229.236.8 with SMTP id ki8mr55163554qcb.12.1409661981114; Tue, 02 Sep 2014 05:46:21 -0700 (PDT) Received: from localhost.localdomain (ec2-23-23-178-99.compute-1.amazonaws.com. [23.23.178.99]) by mx.google.com with ESMTPSA id e64sm4806029qgd.37.2014.09.02.05.46.18 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 02 Sep 2014 05:46:20 -0700 (PDT) From: Petri Savolainen To: lng-odp@lists.linaro.org Date: Tue, 2 Sep 2014 15:47:24 +0300 Message-Id: <1409662044-23337-2-git-send-email-petri.savolainen@linaro.org> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1409662044-23337-1-git-send-email-petri.savolainen@linaro.org> References: <1409662044-23337-1-git-send-email-petri.savolainen@linaro.org> X-Topics: timers patch Subject: [lng-odp] [PATCH v2 2/2] Timer example error check X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.14 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-bounces@lists.linaro.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: petri.savolainen@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.220.174 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 Signed-off-by: Petri Savolainen --- example/timer/odp_timer_test.c | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/example/timer/odp_timer_test.c b/example/timer/odp_timer_test.c index bf1d7df..f619665 100644 --- a/example/timer/odp_timer_test.c +++ b/example/timer/odp_timer_test.c @@ -26,10 +26,10 @@ #define MAX_WORKERS 32 /**< Max worker threads */ #define MSG_POOL_SIZE (4*1024*1024) /**< Message pool size */ -/* Nanoseconds */ -#define USEC 1000UL -#define MSEC 1000000UL -#define SEC 1000000000UL +#define USEC ODP_TIME_USEC +#define MSEC ODP_TIME_MSEC +#define SEC ODP_TIME_SEC + /** Test arguments */ typedef struct { @@ -195,7 +195,7 @@ static void parse_args(int argc, char *argv[], test_args_t *args) args->core_count = 0; /* all cores */ args->resolution_us = 10000; args->min_us = args->resolution_us; - args->max_us = 100000000; + args->max_us = 10000000; args->period_us = 1000000; args->tmo_count = 30; @@ -347,6 +347,12 @@ int main(int argc, char *argv[]) args.min_us*USEC, args.max_us*USEC); + if (test_timer == ODP_TIMER_INVALID) { + ODP_ERR("Timer create failed.\n"); + return -1; + } + + odp_shm_print_all(); printf("CPU freq %"PRIu64" hz\n", odp_sys_cpu_hz());