From: "Theodore Ts'o" <tytso@mit.edu>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: LKML <linux-kernel@vger.kernel.org>
Subject: Checking to see if a bit is _not_ set in a ftrace event filter
Date: Mon, 1 Dec 2014 21:19:12 -0500 [thread overview]
Message-ID: <20141202021912.GA29096@thunk.org> (raw)
I was trying to do something like this:
filter="events/writeback/writeback_mark_inode_dirty/filter"
echo "(flags & 2048) && ((state & 2048) == 0)" > $filter
... but that doesn't work.
This works:
echo "flags & 2048" > $filter
But the problem is this:
echo "(state & 2048) == 0" > $filter
The simplest patch to add this would be add a new filter_ops so we
could do this:
echo "(state !& 2048)" > $filter
... but that's pretty ugly. But adding more general expression
parsing in the ftrace event filter code would be non-trivial, and if
we start trying to make things like "!(state & 2048)" or "(state &
2048) == 0", then at some point some crazy person might request
supporting something like this: "(state ^ flags) == 2048". :-)
So I guess the main question I want to ask is your opinion about
whether a patch that adds support for the operator "!&" is too ugly to
live?
Thanks,
- Ted
next reply other threads:[~2014-12-02 2:19 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-12-02 2:19 Theodore Ts'o [this message]
2014-12-02 2:41 ` Checking to see if a bit is _not_ set in a ftrace event filter Steven Rostedt
2014-12-02 3:52 ` Alexei Starovoitov
2014-12-02 3:57 ` Steven Rostedt
2014-12-02 3:58 ` Steven Rostedt
2014-12-02 4:51 ` Steven Rostedt
2014-12-02 5:04 ` Theodore Ts'o
2014-12-02 5:58 ` Alexei Starovoitov
2014-12-02 12:14 ` Theodore Ts'o
2014-12-03 0:02 ` Alexei Starovoitov
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=20141202021912.GA29096@thunk.org \
--to=tytso@mit.edu \
--cc=linux-kernel@vger.kernel.org \
--cc=rostedt@goodmis.org \
/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.