From patchwork Thu Jan 29 15:32:36 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ola Liljedahl X-Patchwork-Id: 43941 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f198.google.com (mail-lb0-f198.google.com [209.85.217.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 8296E2410D for ; Thu, 29 Jan 2015 15:33:11 +0000 (UTC) Received: by mail-lb0-f198.google.com with SMTP id l4sf21194773lbv.1 for ; Thu, 29 Jan 2015 07:33:08 -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=lRnGAqfx6VOJMdDEgLmruj+QlwoDU1dd+0d+FmQp9Z0=; b=VEsgouzGNppQmfNwiJwJP4DK9aB24mW9IiQ/ZK+Zv/jlaevhXAXjQ8ksYeG2mrYVO6 4AJvwFi0SsN/jLiI6pILFsMsx7YqLRxTUxAJhtcUeHKLBBDhLjlVpvL43JEZaJJtaXDt EFpHR1cjlYvtZEVjyVrDrp6ou90S67PFMx3gYZUxtbqnadisrRO2E/Os96FFSC8Nj6Zl X/X2m/NaccuFrmi8eyT6I1OWnJ6o83Rm8c4NjFr4OOv9QVi++bQsQt0c2L1zYa8oeAhD 2nvMAub9bOW/PJb9epUd7jxr8+qu+OziasKiKGtH7w5prnO7RZc5+tROT/rQDMulBJld ss8A== X-Gm-Message-State: ALoCoQmzmSyAuCvjXK2smsVf909W6FsRgAVVmMWA4HCCU+IuW+HqzpeC0olGG5w4xg5YpyhZ+/Sp X-Received: by 10.112.154.233 with SMTP id vr9mr186016lbb.9.1422545588094; Thu, 29 Jan 2015 07:33:08 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.197.2 with SMTP id iq2ls362869lac.2.gmail; Thu, 29 Jan 2015 07:33:07 -0800 (PST) X-Received: by 10.112.167.228 with SMTP id zr4mr1644437lbb.20.1422545587751; Thu, 29 Jan 2015 07:33:07 -0800 (PST) Received: from mail-lb0-f172.google.com (mail-lb0-f172.google.com. [209.85.217.172]) by mx.google.com with ESMTPS id o4si7747922lbc.57.2015.01.29.07.33.07 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 29 Jan 2015 07:33:07 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.172 as permitted sender) client-ip=209.85.217.172; Received: by mail-lb0-f172.google.com with SMTP id l4so29409578lbv.3 for ; Thu, 29 Jan 2015 07:33:07 -0800 (PST) X-Received: by 10.152.23.195 with SMTP id o3mr1577059laf.70.1422545587599; Thu, 29 Jan 2015 07:33:07 -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 h5csp1798632lbj; Thu, 29 Jan 2015 07:33:06 -0800 (PST) X-Received: by 10.224.75.7 with SMTP id w7mr2395309qaj.6.1422545586125; Thu, 29 Jan 2015 07:33:06 -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 v20si10525452qah.64.2015.01.29.07.33.04 (version=TLSv1 cipher=RC4-SHA bits=128/128); Thu, 29 Jan 2015 07:33:06 -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 1YGr5a-00043U-Sx; Thu, 29 Jan 2015 15:33:02 +0000 Received: from mail-lb0-f174.google.com ([209.85.217.174]) by ip-10-35-177-41.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1YGr5S-00042W-0C for lng-odp@lists.linaro.org; Thu, 29 Jan 2015 15:32:54 +0000 Received: by mail-lb0-f174.google.com with SMTP id f15so29373291lbj.5 for ; Thu, 29 Jan 2015 07:32:48 -0800 (PST) X-Received: by 10.152.204.40 with SMTP id kv8mr1630902lac.42.1422545568125; Thu, 29 Jan 2015 07:32:48 -0800 (PST) Received: from macmini.lan (78-82-118-111.tn.glocalnet.net. [78.82.118.111]) by mx.google.com with ESMTPSA id rv1sm2172650lbb.25.2015.01.29.07.32.46 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 29 Jan 2015 07:32:47 -0800 (PST) From: Ola Liljedahl To: lng-odp@lists.linaro.org Date: Thu, 29 Jan 2015 16:32:36 +0100 Message-Id: <1422545560-6466-2-git-send-email-ola.liljedahl@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1422545560-6466-1-git-send-email-ola.liljedahl@linaro.org> References: <1422545560-6466-1-git-send-email-ola.liljedahl@linaro.org> X-Topics: timers patch Subject: [lng-odp] [PATCHv4 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.172 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 the number of late timeouts. Signed-off-by: Ola Liljedahl Suggested-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 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)