From patchwork Thu Jan 29 11:01:09 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ola Liljedahl X-Patchwork-Id: 43919 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f197.google.com (mail-lb0-f197.google.com [209.85.217.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 2C7BA24119 for ; Thu, 29 Jan 2015 11:01:38 +0000 (UTC) Received: by mail-lb0-f197.google.com with SMTP id b6sf18351061lbj.0 for ; Thu, 29 Jan 2015 03:01:37 -0800 (PST) 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:content-type :content-transfer-encoding:errors-to:sender:x-original-sender :x-original-authentication-results:mailing-list; bh=Mm5zmZaYpEDyW/Q5b03ip9W1TUIyebI6xUvT6VEiBmQ=; b=QwQA7Kix73Teo+2BByRSbdqj4nPJivJ99gWA6AcTLy6nysQSECDHMJz0ollPCDeEl2 SKz/r3yAxgZLlmSaPvp8ThiTpcrXmEYOmWzTb0seG4FXh4lVPDJTuCdtFRghmtXcEVZP BF23aF6VAfcBPxyjCwV6nEp0KYxCRPNT8er4JgGyjG1EhwGPzXWNdheXp7m3kJu4X/3e rxi/jBgIkntsuJVv8T82qA0fvgnKDuboG4mOKizQCA+AyiKlu/MvDucW0JM5f30dLAm/ 0WleFn3yDWPDNbwtjf0AJ+LOrbojRrrITkGBk056Nd6/v21DexM6IY2bRuzRyg2zfgpB ILqw== X-Gm-Message-State: ALoCoQlpoYruVMwgDVBhO0s7ZxGfwoAuyXe4uyL+LBMjFozRoM0K2IL0KexVa1JBniZtd5druuNQ X-Received: by 10.152.2.40 with SMTP id 8mr1668178lar.7.1422529297026; Thu, 29 Jan 2015 03:01:37 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.153.11.163 with SMTP id ej3ls265101lad.94.gmail; Thu, 29 Jan 2015 03:01:36 -0800 (PST) X-Received: by 10.152.4.233 with SMTP id n9mr13564339lan.61.1422529296855; Thu, 29 Jan 2015 03:01:36 -0800 (PST) Received: from mail-lb0-f175.google.com (mail-lb0-f175.google.com. [209.85.217.175]) by mx.google.com with ESMTPS id r5si6994405lah.125.2015.01.29.03.01.36 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 29 Jan 2015 03:01:36 -0800 (PST) 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 mail-lb0-f175.google.com with SMTP id 10so26733987lbg.6 for ; Thu, 29 Jan 2015 03:01:36 -0800 (PST) X-Received: by 10.112.25.104 with SMTP id b8mr1786015lbg.69.1422529296655; Thu, 29 Jan 2015 03:01:36 -0800 (PST) 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.35.133 with SMTP id h5csp1724045lbj; Thu, 29 Jan 2015 03:01:36 -0800 (PST) X-Received: by 10.140.22.234 with SMTP id 97mr26281qgn.21.1422529295716; Thu, 29 Jan 2015 03:01:35 -0800 (PST) Received: from ip-10-35-177-41.ec2.internal (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTPS id j64si9811934qgd.38.2015.01.29.03.01.34 (version=TLSv1 cipher=RC4-SHA bits=128/128); Thu, 29 Jan 2015 03:01:35 -0800 (PST) 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-35-177-41.ec2.internal) by ip-10-35-177-41.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1YGmqq-0007tQ-RS; Thu, 29 Jan 2015 11:01:32 +0000 Received: from mail-lb0-f175.google.com ([209.85.217.175]) by ip-10-35-177-41.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1YGmqg-0007sk-Pa for lng-odp@lists.linaro.org; Thu, 29 Jan 2015 11:01:22 +0000 Received: by mail-lb0-f175.google.com with SMTP id 10so26731170lbg.6 for ; Thu, 29 Jan 2015 03:01:16 -0800 (PST) X-Received: by 10.152.87.106 with SMTP id w10mr13626657laz.41.1422529276870; Thu, 29 Jan 2015 03:01:16 -0800 (PST) Received: from macmini.lan (78-82-118-111.tn.glocalnet.net. [78.82.118.111]) by mx.google.com with ESMTPSA id s7sm2045761las.17.2015.01.29.03.01.15 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 29 Jan 2015 03:01:16 -0800 (PST) From: Ola Liljedahl To: lng-odp@lists.linaro.org Date: Thu, 29 Jan 2015 12:01:09 +0100 Message-Id: <1422529273-31282-2-git-send-email-ola.liljedahl@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1422529273-31282-1-git-send-email-ola.liljedahl@linaro.org> References: <1422529273-31282-1-git-send-email-ola.liljedahl@linaro.org> X-Topics: timers patch Subject: [lng-odp] [PATCHv3 1/5] validation: odp_timer.c: avoid cunit warnings for late timeouts 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: ola.liljedahl@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.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 Don't report late timeouts using CU_FAIL as this interferes with the cunit test framework. Just count and report (using LOG_DBG) the number of late timeouts. (Discussed with Mike Holmes) Signed-off-by: Ola Liljedahl --- (This document/code contribution attached is provided under the terms of agreement LES-LTM-21309) test/validation/odp_timer.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/test/validation/odp_timer.c b/test/validation/odp_timer.c index c0b6f67..0238cf4 100644 --- a/test/validation/odp_timer.c +++ b/test/validation/odp_timer.c @@ -12,6 +12,7 @@ #include #include #include "odp_cunit_common.h" +#include "test_debug.h" /** @private Timeout range in milliseconds (ms) */ #define RANGE_MS 2000 @@ -28,6 +29,9 @@ static odp_pool_t tbp; /** @private Timer pool handle used by all threads */ static odp_timer_pool_t tp; +/** @private Count of timeouts delivered too late */ +static odp_atomic_u32_t ndelivtoolate; + /** @private min() function */ static int min(int a, int b) { @@ -88,9 +92,10 @@ static void handle_tmo(odp_event_t ev, bool stale, uint64_t prev_tick) if (tick > odp_timer_current_tick(tp)) CU_FAIL("Timeout delivered early"); if (tick < prev_tick) { - printf("Too late tick: %"PRIu64" prev_tick %"PRIu64"\n", - tick, prev_tick); - CU_FAIL("Timeout delivered late"); + LOG_DBG("Too late tick: %"PRIu64" prev_tick %"PRIu64"\n", + tick, prev_tick); + /* We don't report late timeouts using CU_FAIL */ + odp_atomic_inc_u32(&ndelivtoolate); } } @@ -317,6 +322,9 @@ static void test_odp_timer_all(void) /* Initialize barrier used by worker threads for synchronization */ odp_barrier_init(&test_barrier, num_workers); + /* Initialize the shared timeout counter */ + odp_atomic_init_u32(&ndelivtoolate, 0); + /* Create and start worker threads */ pthrd_arg thrdarg; thrdarg.testcase = 0; @@ -325,6 +333,8 @@ static void test_odp_timer_all(void) /* Wait for worker threads to exit */ odp_cunit_thread_exit(&thrdarg); + LOG_DBG("Number of timeouts delivered/received too late: %u\n", + odp_atomic_load_u32(&ndelivtoolate)); /* Check some statistics after the test */ if (odp_timer_pool_info(tp, &tpinfo) != 0)