All of lore.kernel.org
 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: [RFC][PATCH 3/4] tracing: add per-event filtering
Date: Wed, 18 Mar 2009 01:06:50 -0500	[thread overview]
Message-ID: <1237356410.7922.11.camel@charm-linux> (raw)
In-Reply-To: <alpine.DEB.2.00.0903172131340.10610@gandalf.stny.rr.com>


On Tue, 2009-03-17 at 21:37 -0400, Steven Rostedt wrote:
> 
> 
> On Tue, 17 Mar 2009, Tom Zanussi wrote:
> > diff --git a/kernel/trace/trace_events_stage_3.h b/kernel/trace/trace_events_stage_3.h
> > index 30627d8..d556274 100644
> > --- a/kernel/trace/trace_events_stage_3.h
> > +++ b/kernel/trace/trace_events_stage_3.h
> > @@ -154,6 +154,7 @@ static struct ftrace_event_call event_##call;				\
> >  									\
> >  static void ftrace_raw_event_##call(proto)				\
> >  {									\
> > +	struct ftrace_event_call *call = &event_##call;			\
> >  	struct ring_buffer_event *event;				\
> >  	struct ftrace_raw_##call *entry;				\
> >  	unsigned long irq_flags;					\
> > @@ -172,6 +173,9 @@ static void ftrace_raw_event_##call(proto)				\
> >  	assign;								\
> >  									\
> >  	trace_current_buffer_unlock_commit(event, irq_flags, pc);	\
> 
> I have a concern hear about races.  Once the commit happens, there's 
> nothing protecting us from being preempted. The reader could in fact come 
> in and consume the commit, and a new write may happen, and this discard 
> will corrupt the data in the buffer. Also in overwrite mode, the writer 
> itself can over write this.
> 
> Would you be able to move the above unlock_commit after this.
> I'll make the necessary changes in the commit to check for discarded data.
> 

Yeah, I had meant to do that, but was having enough trouble with the
ring-buffer stuff that I wanted to avoid wondering what might happen if
I discarded an uncommitted event at that point.

I'll make that change in the next version.

Tom

> Thanks,
> 
> -- Steve
> 
> 
> 
> > +									
> \ > +	if (call->preds && !filter_match_preds(call, entry))		\
> > +		rb_event_discard(event);				\
> >  }									\
> >  									\
> >  static int ftrace_raw_reg_event_##call(void)				\
> > -- 
> > 1.5.6.3
> > 
> > 
> > 
> > 
> > 
> > 
> > 


      reply	other threads:[~2009-03-18  6:07 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-17  6:23 [RFC][PATCH 3/4] tracing: add per-event filtering Tom Zanussi
2009-03-18  1:37 ` Steven Rostedt
2009-03-18  6:06   ` 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=1237356410.7922.11.camel@charm-linux \
    --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 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.