From: Steven Rostedt <rostedt@goodmis.org>
To: "Masami Hiramatsu (Google)" <mhiramat@kernel.org>
Cc: Yipeng Zou <zouyipeng@huawei.com>, <shuah@kernel.org>,
<rdunlap@infradead.org>, <linux-kselftest@vger.kernel.org>,
<linux-kernel@vger.kernel.org>,
Shuah Khan <skhan@linuxfoundation.org>
Subject: Re: [PATCH] selftests/ftrace: event_triggers: wait longer for test_event_enable
Date: Mon, 14 Nov 2022 13:10:28 -0500 [thread overview]
Message-ID: <20221114131028.110a91c4@gandalf.local.home> (raw)
In-Reply-To: <20221105175241.858bbd5b5337fc2b8a075ee9@kernel.org>
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
> >
>
>
next prev parent reply other threads:[~2022-11-14 18:10 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-04 2:09 [PATCH] selftests/ftrace: event_triggers: wait longer for test_event_enable Yipeng Zou
2022-11-05 8:52 ` Masami Hiramatsu
2022-11-14 18:10 ` Steven Rostedt [this message]
2022-11-14 18:25 ` Shuah Khan
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20221114131028.110a91c4@gandalf.local.home \
--to=rostedt@goodmis.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=mhiramat@kernel.org \
--cc=rdunlap@infradead.org \
--cc=shuah@kernel.org \
--cc=skhan@linuxfoundation.org \
--cc=zouyipeng@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox