2024-02-05 13:45:28

by Steven Rostedt

[permalink] [raw]
Subject: Re: [PATCH] selftests/ftrace: Limit length in subsystem-enable tests

On Mon, 5 Feb 2024 21:12:33 +0800
Yuanhe Shu <[email protected]> wrote:

> While sched* events being traced and sched* events continuously happen,
> "[xx] event tracing - enable/disable with subsystem level files" would
> never stop as it cat an endless output.
> Select the first 100 lines of output would be enough to judge whether
> there are more than 3 types of sched events.

It's not that it never stops but on some slower systems it does seem to
take forever.

Acked-by: Steven Rostedt (Google) <rostedt@org>

Shuah,

Can you take this through your tree?

Thanks,

-- Steve


>
> Signed-off-by: Yuanhe Shu <[email protected]>
> ---
> .../selftests/ftrace/test.d/event/subsystem-enable.tc | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/tools/testing/selftests/ftrace/test.d/event/subsystem-enable.tc b/tools/testing/selftests/ftrace/test.d/event/subsystem-enable.tc
> index b1ede6249866..74c1114603a7 100644
> --- a/tools/testing/selftests/ftrace/test.d/event/subsystem-enable.tc
> +++ b/tools/testing/selftests/ftrace/test.d/event/subsystem-enable.tc
> @@ -18,7 +18,7 @@ echo 'sched:*' > set_event
>
> yield
>
> -count=`cat trace | grep -v ^# | awk '{ print $5 }' | sort -u | wc -l`
> +count=`head -n 100 trace | grep -v ^# | awk '{ print $5 }' | sort -u | wc -l`
> if [ $count -lt 3 ]; then
> fail "at least fork, exec and exit events should be recorded"
> fi
> @@ -29,7 +29,7 @@ echo 1 > events/sched/enable
>
> yield
>
> -count=`cat trace | grep -v ^# | awk '{ print $5 }' | sort -u | wc -l`
> +count=`head -n 100 | grep -v ^# | awk '{ print $5 }' | sort -u | wc -l`
> if [ $count -lt 3 ]; then
> fail "at least fork, exec and exit events should be recorded"
> fi
> @@ -40,7 +40,7 @@ echo 0 > events/sched/enable
>
> yield
>
> -count=`cat trace | grep -v ^# | awk '{ print $5 }' | sort -u | wc -l`
> +count=`head -n 100 | grep -v ^# | awk '{ print $5 }' | sort -u | wc -l`
> if [ $count -ne 0 ]; then
> fail "any of scheduler events should not be recorded"
> fi



2024-02-22 12:15:37

by Yuanhe Shu

[permalink] [raw]
Subject: Re: [PATCH] selftests/ftrace: Limit length in subsystem-enable tests



On 2024/2/5 21:21, Steven Rostedt wrote:
> On Mon, 5 Feb 2024 21:12:33 +0800
> Yuanhe Shu <[email protected]> wrote:
>
>> While sched* events being traced and sched* events continuously happen,
>> "[xx] event tracing - enable/disable with subsystem level files" would
>> never stop as it cat an endless output.
>> Select the first 100 lines of output would be enough to judge whether
>> there are more than 3 types of sched events.
>
> It's not that it never stops but on some slower systems it does seem to
> take forever.
>
> Acked-by: Steven Rostedt (Google) <rostedt@org>
>
> Shuah,
>
> Can you take this through your tree?
>
> Thanks,
>
> -- Steve
>

Thanks for your ack but I found that I missed the 2nd and 3rd 'trace'
after 'head -n 100' in code. Should I resend a new patch to fix this and
meanwhile modify commit messages according to Steve's words?

>
>>
>> Signed-off-by: Yuanhe Shu <[email protected]>
>> ---
>> .../selftests/ftrace/test.d/event/subsystem-enable.tc | 6 +++---
>> 1 file changed, 3 insertions(+), 3 deletions(-)
>>
>> diff --git a/tools/testing/selftests/ftrace/test.d/event/subsystem-enable.tc b/tools/testing/selftests/ftrace/test.d/event/subsystem-enable.tc
>> index b1ede6249866..74c1114603a7 100644
>> --- a/tools/testing/selftests/ftrace/test.d/event/subsystem-enable.tc
>> +++ b/tools/testing/selftests/ftrace/test.d/event/subsystem-enable.tc
>> @@ -18,7 +18,7 @@ echo 'sched:*' > set_event
>>
>> yield
>>
>> -count=`cat trace | grep -v ^# | awk '{ print $5 }' | sort -u | wc -l`
>> +count=`head -n 100 trace | grep -v ^# | awk '{ print $5 }' | sort -u | wc -l`
>> if [ $count -lt 3 ]; then
>> fail "at least fork, exec and exit events should be recorded"
>> fi
>> @@ -29,7 +29,7 @@ echo 1 > events/sched/enable
>>
>> yield
>>
>> -count=`cat trace | grep -v ^# | awk '{ print $5 }' | sort -u | wc -l`
>> +count=`head -n 100 | grep -v ^# | awk '{ print $5 }' | sort -u | wc -l`
>> if [ $count -lt 3 ]; then
>> fail "at least fork, exec and exit events should be recorded"
>> fi
>> @@ -40,7 +40,7 @@ echo 0 > events/sched/enable
>>
>> yield
>>
>> -count=`cat trace | grep -v ^# | awk '{ print $5 }' | sort -u | wc -l`
>> +count=`head -n 100 | grep -v ^# | awk '{ print $5 }' | sort -u | wc -l`
>> if [ $count -ne 0 ]; then
>> fail "any of scheduler events should not be recorded"
>> fi

2024-02-25 22:31:13

by Masami Hiramatsu

[permalink] [raw]
Subject: Re: [PATCH] selftests/ftrace: Limit length in subsystem-enable tests

On Thu, 22 Feb 2024 20:14:56 +0800
Yuanhe Shu <[email protected]> wrote:

>
>
> On 2024/2/5 21:21, Steven Rostedt wrote:
> > On Mon, 5 Feb 2024 21:12:33 +0800
> > Yuanhe Shu <[email protected]> wrote:
> >
> >> While sched* events being traced and sched* events continuously happen,
> >> "[xx] event tracing - enable/disable with subsystem level files" would
> >> never stop as it cat an endless output.
> >> Select the first 100 lines of output would be enough to judge whether
> >> there are more than 3 types of sched events.
> >
> > It's not that it never stops but on some slower systems it does seem to
> > take forever.
> >
> > Acked-by: Steven Rostedt (Google) <rostedt@org>
> >
> > Shuah,
> >
> > Can you take this through your tree?
> >
> > Thanks,
> >
> > -- Steve
> >
>
> Thanks for your ack but I found that I missed the 2nd and 3rd 'trace'
> after 'head -n 100' in code. Should I resend a new patch to fix this and
> meanwhile modify commit messages according to Steve's words?

Yeah, please fix that and resend. This also should have Cc: stable with Fixed: tag.

Thank you,

>
> >
> >>
> >> Signed-off-by: Yuanhe Shu <[email protected]>
> >> ---
> >> .../selftests/ftrace/test.d/event/subsystem-enable.tc | 6 +++---
> >> 1 file changed, 3 insertions(+), 3 deletions(-)
> >>
> >> diff --git a/tools/testing/selftests/ftrace/test.d/event/subsystem-enable.tc b/tools/testing/selftests/ftrace/test.d/event/subsystem-enable.tc
> >> index b1ede6249866..74c1114603a7 100644
> >> --- a/tools/testing/selftests/ftrace/test.d/event/subsystem-enable.tc
> >> +++ b/tools/testing/selftests/ftrace/test.d/event/subsystem-enable.tc
> >> @@ -18,7 +18,7 @@ echo 'sched:*' > set_event
> >>
> >> yield
> >>
> >> -count=`cat trace | grep -v ^# | awk '{ print $5 }' | sort -u | wc -l`
> >> +count=`head -n 100 trace | grep -v ^# | awk '{ print $5 }' | sort -u | wc -l`
> >> if [ $count -lt 3 ]; then
> >> fail "at least fork, exec and exit events should be recorded"
> >> fi
> >> @@ -29,7 +29,7 @@ echo 1 > events/sched/enable
> >>
> >> yield
> >>
> >> -count=`cat trace | grep -v ^# | awk '{ print $5 }' | sort -u | wc -l`
> >> +count=`head -n 100 | grep -v ^# | awk '{ print $5 }' | sort -u | wc -l`
> >> if [ $count -lt 3 ]; then
> >> fail "at least fork, exec and exit events should be recorded"
> >> fi
> >> @@ -40,7 +40,7 @@ echo 0 > events/sched/enable
> >>
> >> yield
> >>
> >> -count=`cat trace | grep -v ^# | awk '{ print $5 }' | sort -u | wc -l`
> >> +count=`head -n 100 | grep -v ^# | awk '{ print $5 }' | sort -u | wc -l`
> >> if [ $count -ne 0 ]; then
> >> fail "any of scheduler events should not be recorded"
> >> fi


--
Masami Hiramatsu (Google) <[email protected]>