mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Tom Zanussi <tzanussi@gmail.com>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: linux-kernel <linux-kernel@vger.kernel.org>,
	"Ingo Molnar" <mingo@elte.hu>,
	"Frédéric Weisbecker" <fweisbec@gmail.com>
Subject: Re: [PATCH 4/4] tracing: add per-subsystem filtering
Date: Wed, 25 Mar 2009 00:26:07 -0500	[thread overview]
Message-ID: <1237958767.31239.30.camel@bookworm> (raw)
In-Reply-To: <alpine.DEB.2.00.0903241228520.22830@gandalf.stny.rr.com>

On Tue, 2009-03-24 at 12:29 -0400, Steven Rostedt wrote:
> On Tue, 24 Mar 2009, Tom Zanussi wrote:
> > > > +
> > > > +static ssize_t
> > > > +subsystem_filter_write(struct file *filp, const char __user *ubuf, size_t cnt,
> > > > +		       loff_t *ppos)
> > > > +{
> > > > +	struct event_subsystem *system = filp->private_data;
> > > > +	char buf[64], *pbuf = buf;
> > > > +	struct filter_pred *pred;
> > > > +	int err;
> > > > +
> > > > +	if (cnt >= sizeof(buf))
> > > > +		return -EINVAL;
> > > > +
> > > > +	if (copy_from_user(&buf, ubuf, cnt))
> > > > +		return -EFAULT;
> > > > +
> > > > +	pred = kzalloc(sizeof(*pred), GFP_KERNEL);
> > > > +	if (!pred)
> > > > +		return -ENOMEM;
> > > > +
> > > > +	err = filter_parse(&pbuf, pred);
> > > > +	if (err < 0) {
> > > > +		filter_free_pred(pred);
> > > > +		return err;
> > > > +	}
> > > > +
> > > > +	if (pred->clear) {
> > > > +		filter_free_subsystem_preds(system);
> > > 
> > > is "system" correct here?
> > 
> > Do you mean the naming i.e. would be better as "subsystem"?  Otherwise,
> > I think it's correct.
> 
> No, I'm just confused how the system could see the pred before it was 
> added below.

Again, in this case the pred is only used to flag clearing and never
gets added.

Tom

> 
> -- Steve
> 
> > 
> > > 
> > > > +		return cnt;
> > > > +	}
> > > > +
> > > > +	if (filter_add_subsystem_pred(system, pred)) {
> > > > +		filter_free_pred(pred);
> > > > +		return -EINVAL;
> > > > +	}
> > > > +
> > > > +	*ppos += cnt;
> > > > +
> > > > +	return cnt;
> > > > +}
> > > > +


      reply	other threads:[~2009-03-25  5:26 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-22  8:31 Tom Zanussi
2009-03-22 19:01 ` Frederic Weisbecker
2009-03-22 19:50   ` Ingo Molnar
2009-03-22 19:54     ` Frederic Weisbecker
2009-03-22 19:40 ` [tip:tracing/filters] " Tom Zanussi
2009-03-23 18:24 ` [PATCH 4/4] " Steven Rostedt
2009-03-24  7:19   ` Tom Zanussi
2009-03-24 16:29     ` Steven Rostedt
2009-03-25  5:26       ` Tom Zanussi [this message]

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=1237958767.31239.30.camel@bookworm \
    --to=tzanussi@gmail.com \
    --cc=fweisbec@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --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 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®