From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1762209AbZEGCKo (ORCPT ); Wed, 6 May 2009 22:10:44 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1761933AbZEGCKX (ORCPT ); Wed, 6 May 2009 22:10:23 -0400 Received: from hrndva-omtalb.mail.rr.com ([71.74.56.125]:48838 "EHLO hrndva-omtalb.mail.rr.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1762108AbZEGCKV (ORCPT ); Wed, 6 May 2009 22:10:21 -0400 Date: Wed, 6 May 2009 22:10:19 -0400 (EDT) From: Steven Rostedt X-X-Sender: rostedt@gandalf.stny.rr.com To: linux-kernel@vger.kernel.org cc: Ingo Molnar , Jeremy Fitzhardinge , Andrew Morton , Thomas Gleixner , Peter Zijlstra , Frederic Weisbecker , "Paul E. McKenney" Subject: Re: [PATCH 3/5] tracing/events: add rcu locking around trace event prints In-Reply-To: <20090416021928.467656424@goodmis.org> Message-ID: References: <20090416021830.556671772@goodmis.org> <20090416021928.467656424@goodmis.org> User-Agent: Alpine 2.00 (DEB 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Somehow this patch got dropped. I believe Ted's work requires it. I'm not sure if we need to include rcupdate.h or not to use rcu_read_lock. I think it may be fine to include it in ftrace.h. Jeremy, does this patch effect anything that you are doing? -- Steve On Wed, 15 Apr 2009, Steven Rostedt wrote: > From: Steven Rostedt > > Some trace events need to have a way to print out data that his > allocated, but will be freed later. Using a function that can allocate > memory, and free it with call_rcu, can be useful. > > This patch adds rcu locking around the print part of the TRACE_EVENT > macro to facilitate this. > > Reported-by: Theodore Tso > Signed-off-by: Steven Rostedt > --- > include/trace/ftrace.h | 4 ++++ > 1 files changed, 4 insertions(+), 0 deletions(-) > > diff --git a/include/trace/ftrace.h b/include/trace/ftrace.h > index 60c5323..6fb06bd 100644 > --- a/include/trace/ftrace.h > +++ b/include/trace/ftrace.h > @@ -62,7 +62,9 @@ > * > * field = (typeof(field))entry; > * > + * rcu_read_lock(); > * ret = trace_seq_printf(s, "\n"); > + * rcu_read_unlock(); > * if (!ret) > * return TRACE_TYPE_PARTIAL_LINE; > * > @@ -99,7 +101,9 @@ ftrace_raw_output_##call(struct trace_iterator *iter, int flags) \ > \ > field = (typeof(field))entry; \ > \ > + rcu_read_lock(); \ > ret = trace_seq_printf(s, #call ": " print); \ > + rcu_read_unlock(); \ > if (!ret) \ > return TRACE_TYPE_PARTIAL_LINE; \ > \ > -- > 1.6.2.1 > > -- >