lkml.org 
[lkml]   [2009]   [Mar]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 4/4] tracing: add per-subsystem filtering

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.

-- Steve

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


\
 
 \ /
  Last update: 2009-03-24 17:33    [W:0.054 / U:0.472 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site