Message ID | 20221104020931.231090-1-zouyipeng@huawei.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp117672wru; Thu, 3 Nov 2022 19:17:24 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7fWkz8OirfztplnOQNJIxbx+3JTzxxCI88QuFirVPVB1oWCxFh7L84/whFypWj4E53fqH2 X-Received: by 2002:a17:906:ae48:b0:7ae:1723:e8c3 with SMTP id lf8-20020a170906ae4800b007ae1723e8c3mr6207201ejb.603.1667528243842; Thu, 03 Nov 2022 19:17:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667528243; cv=none; d=google.com; s=arc-20160816; b=QGsF/rdMdc75FGLN98S7havByBlHAZ6Xdt/Rz79vuP1dzfVIfZLB9OoP/mRNoCsnNW rg/FEcbMWZIOuyYidwNQswVvqhAGLkYJPD6fwFsCPDM8CLvAjnt0TmBzj1fejdrsodj/ V3lhVvWebU3NiZX/VUJrUi63oSeIV0S+3CpbDwd/fSSw9PBUEdX2WE/376fw3SZTYQRO INhnn9geTRo07RyoBu5koW36iHDIiq/USI9SsWbcarctNSC3jzY6WBaVd6yWRoMtDj+z k36dUw2xFsp8XOkQl+NuExpJn8o3Ai7G8H6U09iUDlVq/EsvqOduLxM5KVrzxZQSTirk VpKg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:subject:cc:to:from; bh=KK9wlAmQ2AjyghwZ5nhEmXcK8MFaZ3/e/HACSmABw1w=; b=radj4ra7VV36V26CsINFBTqjcHlEcpSKVAKHyFn3++FrcB1tRodf5FeYLwYFsaL7TK 1b5Iazkf+Iqsg3Rekda57c2nKxSt3uBPId978hZr9Bxd/jwyeHtotNCMmvrjz3hGaeLu jzUIrUUvwgh6gw2KZ9gA/qcAYaC7DAusRLrT8oyHTkM0MrfgPGFbR+IP3iKVd2Pn1Q9U rrYe69VHBvC6H3Y0gLz8kuxsmOrNVdZCP2uPeWQhUgDpv4YxeNn11Csb9FzkD6zr3w6z roprTfyXjuNnVxd9w/s653211e4xHq5tmpnfjdq5Hf3OSEl8y9ymKEgQ3FB1DJ7ZLoGg kFxg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id jo26-20020a170906f6da00b00791910ecd0fsi2594078ejb.540.2022.11.03.19.16.59; Thu, 03 Nov 2022 19:17:23 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231485AbiKDCNS (ORCPT <rfc822;jimliu8233@gmail.com> + 99 others); Thu, 3 Nov 2022 22:13:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56310 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231387AbiKDCNC (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Thu, 3 Nov 2022 22:13:02 -0400 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B0D2D1902B; Thu, 3 Nov 2022 19:12:59 -0700 (PDT) Received: from dggpemm500023.china.huawei.com (unknown [172.30.72.55]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4N3PKh53mXzRp1R; Fri, 4 Nov 2022 10:12:56 +0800 (CST) Received: from dggpemm500016.china.huawei.com (7.185.36.25) by dggpemm500023.china.huawei.com (7.185.36.83) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Fri, 4 Nov 2022 10:12:58 +0800 Received: from huawei.com (10.67.175.41) by dggpemm500016.china.huawei.com (7.185.36.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Fri, 4 Nov 2022 10:12:57 +0800 From: Yipeng Zou <zouyipeng@huawei.com> To: <rostedt@goodmis.org>, <mhiramat@kernel.org>, <shuah@kernel.org>, <rdunlap@infradead.org>, <linux-kselftest@vger.kernel.org>, <linux-kernel@vger.kernel.org> CC: <zouyipeng@huawei.com> Subject: [PATCH] selftests/ftrace: event_triggers: wait longer for test_event_enable Date: Fri, 4 Nov 2022 10:09:31 +0800 Message-ID: <20221104020931.231090-1-zouyipeng@huawei.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.67.175.41] X-ClientProxiedBy: dggems705-chm.china.huawei.com (10.3.19.182) To dggpemm500016.china.huawei.com (7.185.36.25) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1748530096155808752?= X-GMAIL-MSGID: =?utf-8?q?1748530096155808752?= |
Series |
selftests/ftrace: event_triggers: wait longer for test_event_enable
|
|
Commit Message
Yipeng Zou
Nov. 4, 2022, 2:09 a.m. UTC
In some platform, the schedule event may came slowly, delay 100ms can't
cover it.
I was notice that on my board which running in low cpu_freq,and this
selftests allways gose fail.
So maybe we can check more times here to wait longer.
Fixes: 43bb45da82f9 ("selftests: ftrace: Add a selftest to test event enable/disable func trigger")
Signed-off-by: Yipeng Zou <zouyipeng@huawei.com>
---
.../ftrace/test.d/ftrace/func_event_triggers.tc | 15 +++++++++++----
1 file changed, 11 insertions(+), 4 deletions(-)
Comments
Hi Yipeng, On Fri, 4 Nov 2022 10:09:31 +0800 Yipeng Zou <zouyipeng@huawei.com> wrote: > In some platform, the schedule event may came slowly, delay 100ms can't > cover it. > > I was notice that on my board which running in low cpu_freq,and this > selftests allways gose fail. This looks good to me, since this can just extend the waiting time to 1 sec. (and most of the platforms have no effect) Acked-by: Masami Hiramatsu (Google) <mhiramat@kernel.org> Thank you! > > So maybe we can check more times here to wait longer. > > Fixes: 43bb45da82f9 ("selftests: ftrace: Add a selftest to test event enable/disable func trigger") > Signed-off-by: Yipeng Zou <zouyipeng@huawei.com> > --- > .../ftrace/test.d/ftrace/func_event_triggers.tc | 15 +++++++++++---- > 1 file changed, 11 insertions(+), 4 deletions(-) > > diff --git a/tools/testing/selftests/ftrace/test.d/ftrace/func_event_triggers.tc b/tools/testing/selftests/ftrace/test.d/ftrace/func_event_triggers.tc > index 8d26d5505808..3eea2abf68f9 100644 > --- a/tools/testing/selftests/ftrace/test.d/ftrace/func_event_triggers.tc > +++ b/tools/testing/selftests/ftrace/test.d/ftrace/func_event_triggers.tc > @@ -38,11 +38,18 @@ cnt_trace() { > > test_event_enabled() { > val=$1 > + check_times=10 # wait for 10 * SLEEP_TIME at most > > - e=`cat $EVENT_ENABLE` > - if [ "$e" != $val ]; then > - fail "Expected $val but found $e" > - fi > + while [ $check_times -ne 0 ]; do > + e=`cat $EVENT_ENABLE` > + if [ "$e" == $val ]; then > + return 0 > + fi > + sleep $SLEEP_TIME > + check_times=$((check_times - 1)) > + done > + > + fail "Expected $val but found $e" > } > > run_enable_disable() { > -- > 2.17.1 >
On Sat, 5 Nov 2022 17:52:41 +0900 Masami Hiramatsu (Google) <mhiramat@kernel.org> wrote: > Hi Yipeng, > > On Fri, 4 Nov 2022 10:09:31 +0800 > Yipeng Zou <zouyipeng@huawei.com> wrote: > > > In some platform, the schedule event may came slowly, delay 100ms can't > > cover it. > > > > I was notice that on my board which running in low cpu_freq,and this > > selftests allways gose fail. > > This looks good to me, since this can just extend the waiting time to 1 sec. > (and most of the platforms have no effect) > > Acked-by: Masami Hiramatsu (Google) <mhiramat@kernel.org> > Acked-by: Steven Rostedt (Google) <rostedt@goodmis.org> Shuah, Care to take this through your tree? Thanks, -- Steve > Thank you! > > > > > So maybe we can check more times here to wait longer. > > > > Fixes: 43bb45da82f9 ("selftests: ftrace: Add a selftest to test event enable/disable func trigger") > > Signed-off-by: Yipeng Zou <zouyipeng@huawei.com> > > --- > > .../ftrace/test.d/ftrace/func_event_triggers.tc | 15 +++++++++++---- > > 1 file changed, 11 insertions(+), 4 deletions(-) > > > > diff --git a/tools/testing/selftests/ftrace/test.d/ftrace/func_event_triggers.tc b/tools/testing/selftests/ftrace/test.d/ftrace/func_event_triggers.tc > > index 8d26d5505808..3eea2abf68f9 100644 > > --- a/tools/testing/selftests/ftrace/test.d/ftrace/func_event_triggers.tc > > +++ b/tools/testing/selftests/ftrace/test.d/ftrace/func_event_triggers.tc > > @@ -38,11 +38,18 @@ cnt_trace() { > > > > test_event_enabled() { > > val=$1 > > + check_times=10 # wait for 10 * SLEEP_TIME at most > > > > - e=`cat $EVENT_ENABLE` > > - if [ "$e" != $val ]; then > > - fail "Expected $val but found $e" > > - fi > > + while [ $check_times -ne 0 ]; do > > + e=`cat $EVENT_ENABLE` > > + if [ "$e" == $val ]; then > > + return 0 > > + fi > > + sleep $SLEEP_TIME > > + check_times=$((check_times - 1)) > > + done > > + > > + fail "Expected $val but found $e" > > } > > > > run_enable_disable() { > > -- > > 2.17.1 > > > >
On 11/14/22 11:10, Steven Rostedt wrote: > On Sat, 5 Nov 2022 17:52:41 +0900 > Masami Hiramatsu (Google) <mhiramat@kernel.org> wrote: > >> Hi Yipeng, >> >> On Fri, 4 Nov 2022 10:09:31 +0800 >> Yipeng Zou <zouyipeng@huawei.com> wrote: >> >>> In some platform, the schedule event may came slowly, delay 100ms can't >>> cover it. >>> >>> I was notice that on my board which running in low cpu_freq,and this >>> selftests allways gose fail. >> >> This looks good to me, since this can just extend the waiting time to 1 sec. >> (and most of the platforms have no effect) >> >> Acked-by: Masami Hiramatsu (Google) <mhiramat@kernel.org> >> > > Acked-by: Steven Rostedt (Google) <rostedt@goodmis.org> > > Shuah, > > Care to take this through your tree? > Yup. I will get this in. thanks, -- Shuah
diff --git a/tools/testing/selftests/ftrace/test.d/ftrace/func_event_triggers.tc b/tools/testing/selftests/ftrace/test.d/ftrace/func_event_triggers.tc index 8d26d5505808..3eea2abf68f9 100644 --- a/tools/testing/selftests/ftrace/test.d/ftrace/func_event_triggers.tc +++ b/tools/testing/selftests/ftrace/test.d/ftrace/func_event_triggers.tc @@ -38,11 +38,18 @@ cnt_trace() { test_event_enabled() { val=$1 + check_times=10 # wait for 10 * SLEEP_TIME at most - e=`cat $EVENT_ENABLE` - if [ "$e" != $val ]; then - fail "Expected $val but found $e" - fi + while [ $check_times -ne 0 ]; do + e=`cat $EVENT_ENABLE` + if [ "$e" == $val ]; then + return 0 + fi + sleep $SLEEP_TIME + check_times=$((check_times - 1)) + done + + fail "Expected $val but found $e" } run_enable_disable() {