lkml.org 
[lkml]   [2011]   [May]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[RFC patch 02/32] trace event sample remove semicolons, specify need for ifdef around declarations
Part of the gradual TRACE_EVENT() semicolon removal. Enables creation of array
of events, thus saving space for trace event probes.

Protecting declarations with ifndef _TRACE_SAMPLE_DEF_ is required if we want to
ensure that, e.g., structure forward declarations do not generate extra
semicolons. It's already needed for enumerations and static inline functions
declarations, but not documented, so document it here.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
CC: Steven Rostedt <rostedt@goodmis.org>
CC: Frederic Weisbecker <fweisbec@gmail.com>
CC: Ingo Molnar <mingo@elte.hu>
CC: Thomas Gleixner <tglx@linutronix.de>
CC: Li Zefan <lizf@cn.fujitsu.com>
---
samples/trace_events/trace-events-sample.h | 14 +++++++++++++-
1 file changed, 13 insertions(+), 1 deletion(-)

Index: linux-2.6-lttng/samples/trace_events/trace-events-sample.h
===================================================================
--- linux-2.6-lttng.orig/samples/trace_events/trace-events-sample.h
+++ linux-2.6-lttng/samples/trace_events/trace-events-sample.h
@@ -41,6 +41,18 @@
*/
#include <linux/tracepoint.h>

+#ifndef _TRACE_SAMPLE_DEF_
+#define _TRACE_SAMPLE_DEF_
+
+/*
+ * All static inline functions, enumerations, types and structures declarations,
+ * as well as structure forward declarations, should be surrounded by
+ * _TRACE_SAMPLE_DEF_ preprocessor idefs (where SAMPLE is the name of the trace
+ * system).
+ */
+
+#endif /* _TRACE_SAMPLE_DEF_ */
+
/*
* The TRACE_EVENT macro is broken up into 5 parts.
*
@@ -91,7 +103,7 @@ TRACE_EVENT(foo_bar,
),

TP_printk("foo %s %d", __entry->foo, __entry->bar)
-);
+)
#endif

/***** NOTICE! The #if protection ends here. *****/


\
 
 \ /
  Last update: 2011-05-03 00:07    [W:0.191 / U:0.872 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site