From patchwork Fri Jul 3 12:00:39 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ivan Khoronzhuk X-Patchwork-Id: 50628 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f71.google.com (mail-la0-f71.google.com [209.85.215.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 5B72322916 for ; Fri, 3 Jul 2015 12:02:30 +0000 (UTC) Received: by laar3 with SMTP id r3sf27976340laa.1 for ; Fri, 03 Jul 2015 05:02:29 -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=g16WX/FKWiRTFHjVToDK97Hitb/xqhL0jtsTUDZHMgA=; b=c2G+ougH6yg8QU6EpYg/Ca7TOkx2y9YF5mFI+gKlR8nsuRjrTmJzdS7hKNYp9jNI7Y 8tPUxGUhgKXB5yi2OX5Ytj5tMJHh/lKHcmZ3JgZ2Chuf9X57B511U3vavHsgkhmTCVHb UzmgjlNAgPESIL3GKNUeFrdSQwpy7ZaOOWOpqMT/pp4rQSjQEto6A07qntLFs3seoPHh UXF735gxVurMZSM10C34vZvA5JqBO5Yza2Qepat6nXmsoVkmSQVQzuI1uFxdq1IAMiH1 8IzcrzqcmOAs294F6uFwUaWPEpWyGdg381dmwfX10WlQHCUiJAw1lKQaDfvn/rbiAEze 5BPg== X-Gm-Message-State: ALoCoQmQkbtR2gwq+uuRjl7M3fXkGRU8BGGsgCQSwzxpufTE5Tntu5bbXJOCWIFsxe+g33S37haA X-Received: by 10.152.22.163 with SMTP id e3mr15887855laf.6.1435924949035; Fri, 03 Jul 2015 05:02:29 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.20.67 with SMTP id l3ls477054lae.73.gmail; Fri, 03 Jul 2015 05:02:28 -0700 (PDT) X-Received: by 10.112.210.137 with SMTP id mu9mr31239995lbc.95.1435924948595; Fri, 03 Jul 2015 05:02:28 -0700 (PDT) Received: from mail-la0-f44.google.com (mail-la0-f44.google.com. [209.85.215.44]) by mx.google.com with ESMTPS id p5si7032171lap.109.2015.07.03.05.02.28 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 03 Jul 2015 05:02:28 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.44 as permitted sender) client-ip=209.85.215.44; Received: by lagh6 with SMTP id h6so82579777lag.2 for ; Fri, 03 Jul 2015 05:02:28 -0700 (PDT) X-Received: by 10.152.4.163 with SMTP id l3mr36131019lal.35.1435924948505; Fri, 03 Jul 2015 05:02:28 -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 hn6csp1138359lbb; Fri, 3 Jul 2015 05:02:27 -0700 (PDT) X-Received: by 10.140.98.36 with SMTP id n33mr50188806qge.62.1435924947141; Fri, 03 Jul 2015 05:02:27 -0700 (PDT) Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id b27si10098870qkh.24.2015.07.03.05.02.26; Fri, 03 Jul 2015 05:02:27 -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 4E7E561B34; Fri, 3 Jul 2015 12:02:26 +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 D569F61DB1; Fri, 3 Jul 2015 12:02:00 +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 81E2161B2F; Fri, 3 Jul 2015 12:01:57 +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 DEFC461B39 for ; Fri, 3 Jul 2015 12:00:51 +0000 (UTC) Received: by lagx9 with SMTP id x9so82590297lag.1 for ; Fri, 03 Jul 2015 05:00:50 -0700 (PDT) X-Received: by 10.152.22.99 with SMTP id c3mr36253813laf.32.1435924850894; Fri, 03 Jul 2015 05:00:50 -0700 (PDT) Received: from khorivan.synapse.com ([195.238.92.128]) by mx.google.com with ESMTPSA id aj4sm2284300lbd.5.2015.07.03.05.00.49 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 03 Jul 2015 05:00:50 -0700 (PDT) From: Ivan Khoronzhuk To: lng-odp@lists.linaro.org Date: Fri, 3 Jul 2015 15:00:39 +0300 Message-Id: <1435924839-11521-3-git-send-email-ivan.khoronzhuk@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1435924839-11521-1-git-send-email-ivan.khoronzhuk@linaro.org> References: <1435924839-11521-1-git-send-email-ivan.khoronzhuk@linaro.org> X-Topics: timers patch Subject: [lng-odp] [Patch 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.44 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);