From patchwork Fri Jan 16 17:05:56 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ola Liljedahl X-Patchwork-Id: 43257 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-we0-f200.google.com (mail-we0-f200.google.com [74.125.82.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id EB020240E0 for ; Fri, 16 Jan 2015 17:06:42 +0000 (UTC) Received: by mail-we0-f200.google.com with SMTP id u56sf11767250wes.3 for ; Fri, 16 Jan 2015 09:06:42 -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=kTEXPNr85LjgOlR4wEE436MfWZ9Ody+kRjqFYab9cEQ=; b=MKUw0wb6LYSTBuJ+vAdngRH9ie7UO2Pj/IyhVlR1x9RASfhavpX/PAUyUef4f+gjt6 F0uyU49Ht5P4EnrvON9khIFpEy44v1P0b2+6FVK+0UmA+i+YfyydA7AVKfJaYjEECRLp bo0JpOMfwbfbMQ7MvNJw9yX/HYnfdnwPaR3vi8Ns3WqTSJxgfucCubAKuNd9SGCXq4e9 DtClpizSrmbBCRQAXGipoLqy0inlMMOX3GHAPXzxTt6wUHM57yZsyQNBf8aCKhbLsTou EFojAhajmEQArrQtbqAO8F+1wf8NRu32Cws/TDmKNSJCcvJa20cn5A14wLuvapl7ny01 zbmQ== X-Gm-Message-State: ALoCoQn/sARMTxUJI2gZ1ZQHn9PcdK//LSixk6bbSOQ3g9/wNEZtjIIwfNgcsdUStHemR+6qLij1 X-Received: by 10.112.133.98 with SMTP id pb2mr2128158lbb.2.1421428002175; Fri, 16 Jan 2015 09:06:42 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.9.195 with SMTP id c3ls394499lab.61.gmail; Fri, 16 Jan 2015 09:06:42 -0800 (PST) X-Received: by 10.112.159.195 with SMTP id xe3mr16682062lbb.64.1421428002026; Fri, 16 Jan 2015 09:06:42 -0800 (PST) Received: from mail-la0-f49.google.com (mail-la0-f49.google.com. [209.85.215.49]) by mx.google.com with ESMTPS id yp4si3434357lbb.136.2015.01.16.09.06.42 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 16 Jan 2015 09:06:42 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.49 as permitted sender) client-ip=209.85.215.49; Received: by mail-la0-f49.google.com with SMTP id hs14so19989806lab.8 for ; Fri, 16 Jan 2015 09:06:42 -0800 (PST) X-Received: by 10.152.5.226 with SMTP id v2mr16887523lav.34.1421428001921; Fri, 16 Jan 2015 09:06:41 -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.9.200 with SMTP id c8csp373740lbb; Fri, 16 Jan 2015 09:06:41 -0800 (PST) X-Received: by 10.224.69.1 with SMTP id x1mr27103026qai.32.1421427999449; Fri, 16 Jan 2015 09:06:39 -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 u18si2831544qag.111.2015.01.16.09.06.30 (version=TLSv1 cipher=RC4-SHA bits=128/128); Fri, 16 Jan 2015 09:06:39 -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 1YCALs-0000vo-Fm; Fri, 16 Jan 2015 17:06:28 +0000 Received: from mail-la0-f43.google.com ([209.85.215.43]) by ip-10-35-177-41.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1YCALc-0000st-NO for lng-odp@lists.linaro.org; Fri, 16 Jan 2015 17:06:12 +0000 Received: by mail-la0-f43.google.com with SMTP id q1so4610590lam.2 for ; Fri, 16 Jan 2015 09:06:06 -0800 (PST) X-Received: by 10.152.219.3 with SMTP id pk3mr9237455lac.19.1421427966468; Fri, 16 Jan 2015 09:06:06 -0800 (PST) Received: from macmini.lan (78-82-118-111.tn.glocalnet.net. [78.82.118.111]) by mx.google.com with ESMTPSA id 1sm1578217lay.40.2015.01.16.09.06.05 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 16 Jan 2015 09:06:05 -0800 (PST) From: Ola Liljedahl To: lng-odp@lists.linaro.org Date: Fri, 16 Jan 2015 18:05:56 +0100 Message-Id: <1421427959-11751-2-git-send-email-ola.liljedahl@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1421427959-11751-1-git-send-email-ola.liljedahl@linaro.org> References: <1421427959-11751-1-git-send-email-ola.liljedahl@linaro.org> X-Topics: timers patch Subject: [lng-odp] [PATCHv2 1/4] test: 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.215.49 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 Reviewed-by: Mike Holmes --- (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 4c93f71..dca01ce 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_buffer_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_buffer_t buf, 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); } } @@ -319,6 +324,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; @@ -327,6 +335,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)