lkml.org 
[lkml]   [2009]   [Apr]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 3/5] tracing/events: add rcu locking around trace event prints

Ted, is this patch still needed?

I'm starting to have second thoughts on this patch because it may require
adding: #include <linux/rcupdate.h> in include/trace/ftrace.h. Jeremy has
been struggling with include hell with these files.

Hmm, maybe this is not an issue because we undef CREATE_TRACE_POINTS
before calling this.

Jeremy,

Do you see a problem if we include linux/rcupdate.h in ftrace.h?
Remember, CREATE_TRACE_POINTS is undefined here.

Thanks,

-- Steve


On Wed, 15 Apr 2009, Steven Rostedt wrote:

> From: Steven Rostedt <srostedt@redhat.com>
>
> 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 <tytso@mit.edu>
> Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
> ---
> 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, <TP_printk> "\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
>
> --
>


\
 
 \ /
  Last update: 2009-04-17 16:11    [W:0.252 / U:0.624 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site