Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755849AbZCRGHI (ORCPT ); Wed, 18 Mar 2009 02:07:08 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753483AbZCRGGz (ORCPT ); Wed, 18 Mar 2009 02:06:55 -0400 Received: from yw-out-2324.google.com ([74.125.46.31]:39156 "EHLO yw-out-2324.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753125AbZCRGGz (ORCPT ); Wed, 18 Mar 2009 02:06:55 -0400 DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=subject:from:to:cc:in-reply-to:references:content-type:date :message-id:mime-version:x-mailer:content-transfer-encoding; b=ZB54YF6mSnG5VJ0KFXmz9wdpeBun/8S0DfCXngrxyeRWKv9mXEgHLb8FNfRtV5acno Rgyshf/eZazI2gIdMWtuYlq9TTthTpUORIP8hy1p3t+W+dtEp+puA6Wpi7W4KjGvRDwm KLgSAz3miYL36BMVamKtBQVZDW8bu3FGv9ULk= Subject: Re: [RFC][PATCH 3/4] tracing: add per-event filtering From: Tom Zanussi To: Steven Rostedt Cc: linux-kernel , Ingo Molnar , =?ISO-8859-1?Q?Fr=E9d=E9ric?= Weisbecker In-Reply-To: References: <1237271031.8033.151.camel@charm-linux> Content-Type: text/plain Date: Wed, 18 Mar 2009 01:06:50 -0500 Message-Id: <1237356410.7922.11.camel@charm-linux> Mime-Version: 1.0 X-Mailer: Evolution 2.12.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2101 Lines: 67 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 > > > > > > > > > > > > > > -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/