lkml.org 
[lkml]   [2014]   [Dec]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 3/3] ftracetests: Add test to test event filter logic
On Wed, 03 Dec 2014 18:26:43 +0900
Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com> wrote:

> (2014/12/03 12:13), Steven Rostedt wrote:
> > From: "Steven Rostedt (Red Hat)" <rostedt@goodmis.org>
> >
> > Add a test to test the event filter logic. It currently tests the
> > following filters against sched:sched_switch event.
> >
> > ( prev_pid != 0 )
> > ( prev_pid == 0 )
> > ( prev_pid < 100 )
> > ( prev_pid <= $$ )
> > ( prev_pid > 100 )
> > ( prev_pid >= $$ )
> > ! ( prev_pid != 0 )
> > ! ( prev_pid == 0 )
> > ! ( prev_pid < 100 )
> > ! ( prev_pid <= $$ )
> > ! ( prev_pid > 100 )
> > ! ( prev_pid >= $$ )
> > ( prev_pid != 0 && next_pid > 10 )
> > ( prev_pid != 0 || next_pid > 10 )
> > ! ( prev_pid != 0 && next_pid > 10 )
> > ! ( prev_pid != 0 || next_pid > 10 )
> > ( prev_pid & 1 )
> > ( prev_pid & 2 )
> > ( prev_pid & 4 )
> > ( prev_pid & 8 )
> > ( prev_pid & 16 )
> > ! ( prev_pid & 1 )
> > ! ( prev_pid & 2 )
> > ! ( prev_pid & 4 )
> > ! ( prev_pid & 8 )
> > ! ( prev_pid & 16 )
> > ( next_comm ~ "ftrace-test-fil" )
> > ( next_comm != "ftrace-test-fil" )
> > ! ( next_comm ~ "ftrace-test-fil" )
> > ! ( next_comm != "ftrace-test-fil" )
> >
>
> Hmm, this uses some bash-only syntax, here is the result of checkbashisms.
>
> # checkbashisms tools/testing/selftests/ftrace/test.d/ftrace/filter.tc
> possible bashism in tools/testing/selftests/ftrace/test.d/ftrace/filter.tc line 70 (should be 'b = a'):
> if [ "$not" == '!' ]; then
> possible bashism in tools/testing/selftests/ftrace/test.d/ftrace/filter.tc line 99 (should be 'b = a'):
> if [ "$not" == '!' ]; then
> possible bashism in tools/testing/selftests/ftrace/test.d/ftrace/filter.tc line 137 (let ...):
> let x=1
> possible bashism in tools/testing/selftests/ftrace/test.d/ftrace/filter.tc line 148 (let ...):
> let val="$pid & $x"
> possible bashism in tools/testing/selftests/ftrace/test.d/ftrace/filter.tc line 155 (should be 'b = a'):
> elif [ "$not" == '!' ]; then
> possible bashism in tools/testing/selftests/ftrace/test.d/ftrace/filter.tc line 160 (let ...):
> let x="$x << 1"
> possible bashism in tools/testing/selftests/ftrace/test.d/ftrace/filter.tc line 182 (should be 'b = a'):
> if [ "$not" == '!' ]; then
>
> to allow run this on busybox or dash, we'd better clean it.

Do you know how to fix this?

>
> > Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
> > ---
> [...]
> > +# Test more complex compares (&& and !!)
> > +test_cmp2 -ne 0 -a -gt 10 "!= 0" "> 10" "&&" ''
> > +test_cmp2 -ne 0 -o -gt 10 "!= 0" "> 10" "||" ''
>
> This might better be
> test_cmp2 -ne 0 -a -gt 10 "!= 0" "&&" "> 10" ''
> test_cmp2 -ne 0 -o -gt 10 "!= 0" "||" "> 10" ''
>
> :-)

Sure.

OK, I'll hold off on sending this patch then till 3.20.

I'll still add the update to the kernel for 3.19, but the testing for
it needs work. It passes my test suite, but I don't know how to handle
the busybox limitations.

-- Steve

>
> > +
> > +test_cmp2 -ne 0 -a -gt 10 "!= 0" "> 10" "&&" '!'
> > +test_cmp2 -ne 0 -o -gt 10 "!= 0" "> 10" "||" '!'
>
> Thank you,
>
>



\
 
 \ /
  Last update: 2014-12-03 11:01    [W:0.119 / U:1.376 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site