From patchwork Wed Sep 3 13:35:02 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Petri Savolainen X-Patchwork-Id: 36608 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qc0-f199.google.com (mail-qc0-f199.google.com [209.85.216.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 93426202E4 for ; Wed, 3 Sep 2014 13:34:23 +0000 (UTC) Received: by mail-qc0-f199.google.com with SMTP id x3sf26652150qcv.10 for ; Wed, 03 Sep 2014 06:34:23 -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=n4BgYQISOHWnDT0/5xRFoJX7Q5cauhG5UBZP9bz0dPw=; b=aGwWGdzxibgnAED5+VasFH5PNRTtNW6CiHUW+h7Ij+yR0pVU1LHjtFyY6C3G9dt9nC o78nE+5TT8IPihuqCXVpXo+x6+Ig36DCpiWnryrzvIs033Jf5hH6lbC52f9+YBuQKnEv QzYAPLtYLkOiRAb7/0/lvSGu38B9Iewz5aqei1E3o0Ie2tIMp/gMVeqaxRNrqxWwGlyt KNxUynsjjbIxa/21lK/9gsGMq8OehNvKfoFONXcyWMS8mh5vljHOkEDdlOh3w087n6IC 0ozTvjWkmzeaUx50/rQ17ahTJnJ1dhYGs6q6uF771YL2sSPOlwAOXnz52vNVENn3tVcC M37w== X-Gm-Message-State: ALoCoQlNbXHawwCQdcr5wZ1cCio0h0pNi0bTpdQVrahXQn5/ngO8tiTyFVw9QCU5t7Gn5PodCVXX X-Received: by 10.236.28.228 with SMTP id g64mr22783555yha.40.1409751263444; Wed, 03 Sep 2014 06:34:23 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.47.45 with SMTP id l42ls2970365qga.61.gmail; Wed, 03 Sep 2014 06:34:23 -0700 (PDT) X-Received: by 10.220.46.5 with SMTP id h5mr499394vcf.55.1409751263247; Wed, 03 Sep 2014 06:34:23 -0700 (PDT) Received: from mail-vc0-f175.google.com (mail-vc0-f175.google.com [209.85.220.175]) by mx.google.com with ESMTPS id wd4si902113vdb.33.2014.09.03.06.34.23 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 03 Sep 2014 06:34:23 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.175 as permitted sender) client-ip=209.85.220.175; Received: by mail-vc0-f175.google.com with SMTP id lf12so8664526vcb.20 for ; Wed, 03 Sep 2014 06:34:23 -0700 (PDT) X-Received: by 10.52.94.108 with SMTP id db12mr29348552vdb.8.1409751263181; Wed, 03 Sep 2014 06:34:23 -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 uj3csp681686vcb; Wed, 3 Sep 2014 06:34:21 -0700 (PDT) X-Received: by 10.140.93.44 with SMTP id c41mr3750665qge.106.1409751260485; Wed, 03 Sep 2014 06:34:20 -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 n7si9419828qas.26.2014.09.03.06.34.19 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Wed, 03 Sep 2014 06:34:19 -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 1XPAhV-0001Fu-32; Wed, 03 Sep 2014 13:34:17 +0000 Received: from mail-qa0-f46.google.com ([209.85.216.46]) by ip-10-141-164-156.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1XPAhM-0001FY-1q for lng-odp@lists.linaro.org; Wed, 03 Sep 2014 13:34:08 +0000 Received: by mail-qa0-f46.google.com with SMTP id w8so7756810qac.33 for ; Wed, 03 Sep 2014 06:34:02 -0700 (PDT) X-Received: by 10.140.38.169 with SMTP id t38mr61502648qgt.3.1409751242448; Wed, 03 Sep 2014 06:34:02 -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 g61sm8712765qge.5.2014.09.03.06.34.00 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 03 Sep 2014 06:34:01 -0700 (PDT) From: Petri Savolainen To: lng-odp@lists.linaro.org Date: Wed, 3 Sep 2014 16:35:02 +0300 Message-Id: <1409751302-3904-2-git-send-email-petri.savolainen@linaro.org> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1409751302-3904-1-git-send-email-petri.savolainen@linaro.org> References: <1409751302-3904-1-git-send-email-petri.savolainen@linaro.org> X-Topics: timers patch Subject: [lng-odp] [PATCH v3 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.175 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 | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/example/timer/odp_timer_test.c b/example/timer/odp_timer_test.c index 4168856..d040821 100644 --- a/example/timer/odp_timer_test.c +++ b/example/timer/odp_timer_test.c @@ -26,10 +26,9 @@ #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 /**< Microsecond */ +#define SEC ODP_TIME_SEC /**< Second */ + /** Test arguments */ typedef struct { @@ -195,7 +194,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 +346,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());