tracing/events: put TP_fast_assign into braces
authorLi Zefan <lizf@cn.fujitsu.com>
Mon, 1 Jun 2009 07:35:13 +0000 (15:35 +0800)
committerSteven Rostedt <rostedt@goodmis.org>
Tue, 2 Jun 2009 03:24:53 +0000 (23:24 -0400)
Currently TP_fast_assign has a limitation that we can't define local
variables in it.

Here's one use case when we introduce __dynamic_array():

TP_fast_assign(
type *p = __get_dynamic_array(item);

foo(p);
bar(p);
),

[ Impact: allow defining local variables in TP_fast_assign ]

Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
LKML-Reference: <4A2384B1.90100@cn.fujitsu.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
include/trace/ftrace.h

index 9276ec4f34de0c9bb66abdb0ea54f0b0a7791ff9..ee9268222448fa90722432473d793f994240242f 100644 (file)
@@ -471,7 +471,7 @@ static void ftrace_raw_event_##call(proto)                          \
                return;                                                 \
        entry   = ring_buffer_event_data(event);                        \
                                                                        \
-       assign;                                                         \
+       { assign; }                                                     \
                                                                        \
        if (!filter_current_check_discard(event_call, entry, event))    \
                trace_nowake_buffer_unlock_commit(event, irq_flags, pc); \