From patchwork Thu Feb 5 08:15: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: 44404 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f200.google.com (mail-wi0-f200.google.com [209.85.212.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 11D4F21173 for ; Thu, 5 Feb 2015 08:16:29 +0000 (UTC) Received: by mail-wi0-f200.google.com with SMTP id fb4sf5242994wid.3 for ; Thu, 05 Feb 2015 00:16:28 -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=eXO2Kdi5IsIVWvjwpm+DfUr7dc8Gt1hwHe/j1b/eVbA=; b=cdd4SzmcRubroMHTen/F/fM5W87v/mvQN6Nb2pcVDxtzHAepyWv3GS2a8g6quF49VI hlhEwqpoZRko/G3Eh7fVqoP/ibh2QupUhcXWR2qnxxaxO10HJb7d+8b00nsLl7Mv0yeq APkPBrJEJ1KMPqANlSTlFvZ4JjY9Iim4hU+wZfp+L8O9rNqf1oAD5OSBX1Wc979PnI5B e3dzNg9RsB9IfKiVkPeJ0aCgW8lPgcMtGn9Ae2NYqVToS3VDGj1JL1jHQruqH/Ost0d6 Zjm4VHmusxCYqZCf6k9Gk0UQuMZTHn4T6klxmoHYv87nwbimFMWG4vt6SI9ak5TeLrj2 wdyw== X-Gm-Message-State: ALoCoQm9Yhsqy/sr6L5Kds+bMagcQJC3ekK3hUxkFlR6S1F6cQVF8qxSC5UEYB21u2MFNFR3TjbL X-Received: by 10.180.88.199 with SMTP id bi7mr874743wib.1.1423124188355; Thu, 05 Feb 2015 00:16:28 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.42.234 with SMTP id r10ls118279lal.94.gmail; Thu, 05 Feb 2015 00:16:28 -0800 (PST) X-Received: by 10.152.87.210 with SMTP id ba18mr2096090lab.3.1423124188055; Thu, 05 Feb 2015 00:16:28 -0800 (PST) Received: from mail-la0-f45.google.com (mail-la0-f45.google.com. [209.85.215.45]) by mx.google.com with ESMTPS id mt5si3342812lbb.59.2015.02.05.00.16.27 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 05 Feb 2015 00:16:27 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.45 as permitted sender) client-ip=209.85.215.45; Received: by mail-la0-f45.google.com with SMTP id gd6so5911260lab.4 for ; Thu, 05 Feb 2015 00:16:27 -0800 (PST) X-Received: by 10.152.23.195 with SMTP id o3mr2154066laf.70.1423124187589; Thu, 05 Feb 2015 00:16:27 -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 h5csp991802lbj; Thu, 5 Feb 2015 00:16:26 -0800 (PST) X-Received: by 10.224.172.10 with SMTP id j10mr5719296qaz.39.1423124186121; Thu, 05 Feb 2015 00:16:26 -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 s8si5394910qac.5.2015.02.05.00.16.24 (version=TLSv1 cipher=RC4-SHA bits=128/128); Thu, 05 Feb 2015 00:16:26 -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 1YJHbr-0003av-7y; Thu, 05 Feb 2015 08:16:23 +0000 Received: from mail-lb0-f171.google.com ([209.85.217.171]) by ip-10-35-177-41.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1YJHbh-0003a8-2m for lng-odp@lists.linaro.org; Thu, 05 Feb 2015 08:16:13 +0000 Received: by mail-lb0-f171.google.com with SMTP id u14so5679267lbd.2 for ; Thu, 05 Feb 2015 00:16:07 -0800 (PST) X-Received: by 10.152.27.136 with SMTP id t8mr2123664lag.60.1423124167477; Thu, 05 Feb 2015 00:16:07 -0800 (PST) Received: from macmini.lan (78-82-118-111.tn.glocalnet.net. [78.82.118.111]) by mx.google.com with ESMTPSA id nq7sm807336lbb.49.2015.02.05.00.16.06 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 05 Feb 2015 00:16:06 -0800 (PST) From: Ola Liljedahl To: lng-odp@lists.linaro.org Date: Thu, 5 Feb 2015 09:15:56 +0100 Message-Id: <1423124161-18716-2-git-send-email-ola.liljedahl@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1423124161-18716-1-git-send-email-ola.liljedahl@linaro.org> References: <1423124161-18716-1-git-send-email-ola.liljedahl@linaro.org> X-Topics: timers patch Subject: [lng-odp] [PATCHv5 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.45 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 --- (This document/code contribution attached is provided under the terms of agreement LES-LTM-21309) test/validation/odp_timer.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/test/validation/odp_timer.c b/test/validation/odp_timer.c index c0b6f67..c098b20 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) { @@ -90,7 +94,8 @@ static void handle_tmo(odp_event_t ev, bool stale, uint64_t prev_tick) if (tick < prev_tick) { printf("Too late tick: %"PRIu64" prev_tick %"PRIu64"\n", tick, prev_tick); - CU_FAIL("Timeout delivered late"); + /* 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); + printf("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)