mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: "Theodore Ts'o" <tytso@mit.edu>
Cc: LKML <linux-kernel@vger.kernel.org>,
	Alexei Starovoitov <ast@plumgrid.com>
Subject: Re: Checking to see if a bit is _not_ set in a ftrace event filter
Date: Mon, 1 Dec 2014 21:41:04 -0500	[thread overview]
Message-ID: <20141201214104.32d3f10d@gandalf.local.home> (raw)
In-Reply-To: <20141202021912.GA29096@thunk.org>

On Mon, 1 Dec 2014 21:19:12 -0500
Theodore Ts'o <tytso@mit.edu> wrote:

> 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?
> 

Yeah, I don't want to add some bastardization compare that we'll be
stuck with till the end of time. Either we modify the tree walk to
handle values (it shouldn't be too difficult, but it wont be trivial),
or we wait till eBPF is up and running as the trace filter replacement
and that should be able to handle this much better.

-- Steve

  reply	other threads:[~2014-12-02  2:41 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-02  2:19 Theodore Ts'o
2014-12-02  2:41 ` Steven Rostedt [this message]
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=20141201214104.32d3f10d@gandalf.local.home \
    --to=rostedt@goodmis.org \
    --cc=ast@plumgrid.com \
    --cc=linux-kernel@vger.kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®