From: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: linux-kernel@vger.kernel.org, Ingo Molnar <mingo@kernel.org>,
Andrew Morton <akpm@linux-foundation.org>,
Theodore Tso <tytso@mit.edu>,
Alexei Starovoitov <ast@plumgrid.com>
Subject: Re: [PATCH 3/3] ftracetests: Add test to test event filter logic
Date: Wed, 03 Dec 2014 18:26:43 +0900 [thread overview]
Message-ID: <547ED753.3060508@hitachi.com> (raw)
In-Reply-To: <20141203032106.156623189@goodmis.org>
(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.
> 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" ''
:-)
> +
> +test_cmp2 -ne 0 -a -gt 10 "!= 0" "> 10" "&&" '!'
> +test_cmp2 -ne 0 -o -gt 10 "!= 0" "> 10" "||" '!'
Thank you,
--
Masami HIRAMATSU
Software Platform Research Dept. Linux Technology Research Center
Hitachi, Ltd., Yokohama Research Laboratory
E-mail: masami.hiramatsu.pt@hitachi.com
next prev parent reply other threads:[~2014-12-03 9:26 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-12-03 3:13 [PATCH 0/3] tracing: Add event filter logic for !(...) Steven Rostedt
2014-12-03 3:13 ` [PATCH 1/3] tracing: Add NOT to filtering logic Steven Rostedt
2014-12-03 3:13 ` [PATCH 2/3] tracing: Allow NOT to filter AND and OR clauses Steven Rostedt
2014-12-03 3:13 ` [PATCH 3/3] ftracetests: Add test to test event filter logic Steven Rostedt
2014-12-03 6:22 ` Alexei Starovoitov
2014-12-03 8:40 ` Steven Rostedt
2014-12-03 17:53 ` Alexei Starovoitov
2014-12-03 18:01 ` Steven Rostedt
2014-12-03 9:26 ` Masami Hiramatsu [this message]
2014-12-03 9:34 ` Steven Rostedt
2014-12-03 16:20 ` Steven Rostedt
2014-12-04 8:12 ` Masami Hiramatsu
2014-12-03 23:14 ` Masami Hiramatsu
2014-12-03 23:29 ` Steven Rostedt
2014-12-04 3:18 ` [PATCH v2] " Steven Rostedt
2014-12-04 10:06 ` Masami Hiramatsu
2014-12-04 12:04 ` Steven Rostedt
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=547ED753.3060508@hitachi.com \
--to=masami.hiramatsu.pt@hitachi.com \
--cc=akpm@linux-foundation.org \
--cc=ast@plumgrid.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=rostedt@goodmis.org \
--cc=tytso@mit.edu \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.