From patchwork Fri Jul 3 12:38:38 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ivan Khoronzhuk X-Patchwork-Id: 50631 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f197.google.com (mail-wi0-f197.google.com [209.85.212.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 8405D214B3 for ; Fri, 3 Jul 2015 12:40:19 +0000 (UTC) Received: by wipp2 with SMTP id p2sf11891563wip.2 for ; Fri, 03 Jul 2015 05:40:18 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to: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=Md+s7Pd5SkU+RcQ5klTqlsyM2gmzYtfmWkvBGUng55M=; b=l8GGTPo+S9POXVVBNGHrh7IbhddIjgD9yvkrA5Hxy00hP9mYL6GYGkLYOw9WUsg/mv JibZXx2F7CTrpb8oV0gtUaRBBdiP3YXKgfMWGfmjS4sclUhjWA0YyT49NmqhJccGOmYv nfo6bhLhMA5P6mw/D4iHTsqpKDT5cWzZVW2fV0vFv+x/+kPyatLKWNSOXQNm/9rHz9n8 u7wkGwz9rEG7sX5X6jbx0KgQQmWvQj+Zt7TiX3zLieuHH3eIijkzLri5j1d3j75PZRWr fpPFnOttzB2VUPevRduocLzQP/XVtVILhg0g+TTwnCKKJgn90fAq4aNzaYDeCpGKsNs6 5GUQ== X-Gm-Message-State: ALoCoQndurSylcYJMryV3lRQiMAxs8UjTFhhqVuRAe2J+MlJXQz+COXys8uUM7VdNY7DACZDOxiX X-Received: by 10.180.198.172 with SMTP id jd12mr20400304wic.5.1435927218863; Fri, 03 Jul 2015 05:40:18 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.9.7 with SMTP id v7ls459069laa.75.gmail; Fri, 03 Jul 2015 05:40:18 -0700 (PDT) X-Received: by 10.112.147.233 with SMTP id tn9mr35411081lbb.119.1435927218504; Fri, 03 Jul 2015 05:40:18 -0700 (PDT) Received: from mail-la0-f51.google.com (mail-la0-f51.google.com. [209.85.215.51]) by mx.google.com with ESMTPS id b5si7112635lbk.87.2015.07.03.05.40.18 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 03 Jul 2015 05:40:18 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.51 as permitted sender) client-ip=209.85.215.51; Received: by lagh6 with SMTP id h6so83703478lag.2 for ; Fri, 03 Jul 2015 05:40:18 -0700 (PDT) X-Received: by 10.152.7.7 with SMTP id f7mr35950749laa.106.1435927218230; Fri, 03 Jul 2015 05:40:18 -0700 (PDT) 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.108.230 with SMTP id hn6csp1163435lbb; Fri, 3 Jul 2015 05:40:17 -0700 (PDT) X-Received: by 10.140.235.19 with SMTP id g19mr53197679qhc.52.1435927216970; Fri, 03 Jul 2015 05:40:16 -0700 (PDT) Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id h107si10150104qgd.120.2015.07.03.05.40.15; Fri, 03 Jul 2015 05:40:16 -0700 (PDT) Received-SPF: pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) client-ip=54.225.227.206; Received: by lists.linaro.org (Postfix, from userid 109) id A46C561841; Fri, 3 Jul 2015 12:40:15 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on ip-10-142-244-252.ec2.internal X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, URIBL_BLOCKED autolearn=disabled version=3.4.0 Received: from ip-10-142-244-252.ec2.internal (localhost [127.0.0.1]) by lists.linaro.org (Postfix) with ESMTP id 88DB66204A; Fri, 3 Jul 2015 12:39:17 +0000 (UTC) X-Original-To: lng-odp@lists.linaro.org Delivered-To: lng-odp@lists.linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id BBA4961D86; Fri, 3 Jul 2015 12:39:11 +0000 (UTC) Received: from mail-la0-f49.google.com (mail-la0-f49.google.com [209.85.215.49]) by lists.linaro.org (Postfix) with ESMTPS id 10D846201E for ; Fri, 3 Jul 2015 12:38:50 +0000 (UTC) Received: by laar3 with SMTP id r3so83826236laa.0 for ; Fri, 03 Jul 2015 05:38:49 -0700 (PDT) X-Received: by 10.112.163.129 with SMTP id yi1mr23999334lbb.77.1435927129009; Fri, 03 Jul 2015 05:38:49 -0700 (PDT) Received: from khorivan.synapse.com ([195.238.92.128]) by mx.google.com with ESMTPSA id p9sm2303386laf.11.2015.07.03.05.38.47 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 03 Jul 2015 05:38:48 -0700 (PDT) From: Ivan Khoronzhuk To: lng-odp@lists.linaro.org Date: Fri, 3 Jul 2015 15:38:38 +0300 Message-Id: <1435927118-12397-3-git-send-email-ivan.khoronzhuk@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1435927118-12397-1-git-send-email-ivan.khoronzhuk@linaro.org> References: <1435927118-12397-1-git-send-email-ivan.khoronzhuk@linaro.org> X-Topics: timers patch Subject: [lng-odp] [Patch v2 2/2] example: timer: use ability to indicate that event was lost X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.16 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" X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: ivan.khoronzhuk@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.51 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 In case if for some reason one of the TMOs was lost, the test will be polling forever in order to take it and delete. It can be used to indicate that event was lost. Just abort the test if it cannot receive one of the "last" TMOs for some period. Signed-off-by: Ivan Khoronzhuk --- example/timer/odp_timer_test.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/example/timer/odp_timer_test.c b/example/timer/odp_timer_test.c index 584a581..906bd15 100644 --- a/example/timer/odp_timer_test.c +++ b/example/timer/odp_timer_test.c @@ -21,6 +21,7 @@ #define MAX_WORKERS 32 /**< Max worker threads */ #define NUM_TMOS 10000 /**< Number of timers */ +#define WAIT_NUM 10 /**< Max tries to rx last tmo per worker */ /** Test arguments */ @@ -141,6 +142,7 @@ static void test_abs_timeouts(int thr, test_globals_t *gbls) tick = odp_timer_current_tick(gbls->tp); while (1) { + int wait = 0; odp_event_t ev; odp_timer_set_t rc; @@ -166,6 +168,9 @@ static void test_abs_timeouts(int thr, test_globals_t *gbls) ev = odp_schedule(&queue, sched_tmo); /* Check if odp_schedule() timed out, possibly there * are no remaining timeouts to receive */ + if (++wait > WAIT_NUM && odp_atomic_load_u32(&gbls->remain) + < gbls->num_workers) + EXAMPLE_ABORT("At least one TMO was lost\n"); } while (ev == ODP_EVENT_INVALID && (int)odp_atomic_load_u32(&gbls->remain) > 0);