From patchwork Tue Feb 3 15:44:08 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ola Liljedahl X-Patchwork-Id: 44249 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 E4DB921513 for ; Tue, 3 Feb 2015 15:44:40 +0000 (UTC) Received: by mail-lb0-f197.google.com with SMTP id b6sf7078853lbj.0 for ; Tue, 03 Feb 2015 07:44:39 -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=E4JN5okLhBwo1ylc+w2ZFhqu3/xY1SiT/yDLOFQRoJ3zaC1Rk47ffnIHDRwi3acsBH v0Wp2QUMOMidcGyty+EbWVX3hyt2kJAqz8MCoeGZvfXkvmxHylcf7BQSjYmSJO69UCO8 0HgG3twCoZ44GITE0v5k7ICOCmVYYKVdLTnlDmq8ahU9q8YJDDfV/ixm7MA12F9zy3wf 0vL4mrKhs1wzehOZJT5I7Rmb8tIAkkZq2Ony0u7CXIVcWHQ/2sdRHPLIqm8bqMTjWZ8s lGyDytZx2tbtjFrkpUUYWGxLjwUyB2oqq7/QSFoS+b2eWGR1RA7BEpw9Qz12CTzq2oPV doVA== X-Gm-Message-State: ALoCoQmXXtXH1qBlPDP8/oR01R7Ut+ZPEOAMZorRbXhDNxVhIbJvDCBo2LGvHP6oxi+UJlaEqHcX X-Received: by 10.112.42.104 with SMTP id n8mr3180214lbl.19.1422978279903; Tue, 03 Feb 2015 07:44:39 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.205.11 with SMTP id lc11ls528152lac.19.gmail; Tue, 03 Feb 2015 07:44:39 -0800 (PST) X-Received: by 10.112.92.204 with SMTP id co12mr14410911lbb.43.1422978279760; Tue, 03 Feb 2015 07:44:39 -0800 (PST) Received: from mail-la0-f41.google.com (mail-la0-f41.google.com. [209.85.215.41]) by mx.google.com with ESMTPS id q3si18966932lbh.43.2015.02.03.07.44.39 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 03 Feb 2015 07:44:39 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.41 as permitted sender) client-ip=209.85.215.41; Received: by mail-la0-f41.google.com with SMTP id gm9so53101483lab.0 for ; Tue, 03 Feb 2015 07:44:39 -0800 (PST) X-Received: by 10.112.63.134 with SMTP id g6mr21412598lbs.52.1422978279652; Tue, 03 Feb 2015 07:44:39 -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 h5csp2018678lbj; Tue, 3 Feb 2015 07:44:38 -0800 (PST) X-Received: by 10.224.129.134 with SMTP id o6mr54374350qas.51.1422978278239; Tue, 03 Feb 2015 07:44:38 -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 b13si29161884qaq.76.2015.02.03.07.44.36 (version=TLSv1 cipher=RC4-SHA bits=128/128); Tue, 03 Feb 2015 07:44:38 -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 1YIfeV-0004tQ-CF; Tue, 03 Feb 2015 15:44:35 +0000 Received: from mail-la0-f49.google.com ([209.85.215.49]) by ip-10-35-177-41.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1YIfeL-0004se-VM for lng-odp@lists.linaro.org; Tue, 03 Feb 2015 15:44:26 +0000 Received: by mail-la0-f49.google.com with SMTP id gf13so52842067lab.8 for ; Tue, 03 Feb 2015 07:44:20 -0800 (PST) X-Received: by 10.152.10.65 with SMTP id g1mr12980997lab.84.1422978260061; Tue, 03 Feb 2015 07:44:20 -0800 (PST) Received: from localhost.localdomain (78-82-118-111.tn.glocalnet.net. [78.82.118.111]) by mx.google.com with ESMTPSA id k2sm325464lah.32.2015.02.03.07.44.19 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 03 Feb 2015 07:44:19 -0800 (PST) From: Ola Liljedahl To: lng-odp@lists.linaro.org Date: Tue, 3 Feb 2015 16:44:08 +0100 Message-Id: <1422978253-7721-2-git-send-email-ola.liljedahl@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1422978253-7721-1-git-send-email-ola.liljedahl@linaro.org> References: <1422978253-7721-1-git-send-email-ola.liljedahl@linaro.org> X-Topics: timers patch Subject: [lng-odp] [PATCHv4 1/6] 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.215.41 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)