public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Checking to see if a bit is _not_ set in a ftrace event filter
@ 2014-12-02  2:19 Theodore Ts'o
  2014-12-02  2:41 ` Steven Rostedt
  0 siblings, 1 reply; 10+ messages in thread
From: Theodore Ts'o @ 2014-12-02  2:19 UTC (permalink / raw)
  To: Steven Rostedt; +Cc: LKML

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

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2014-12-03  0:02 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-12-02  2:19 Checking to see if a bit is _not_ set in a ftrace event filter Theodore Ts'o
2014-12-02  2:41 ` 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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox