aboutsummaryrefslogtreecommitdiffstats
path: root/samples/trace_events
diff options
context:
space:
mode:
authorLi Zefan <lizf@cn.fujitsu.com>2009-07-12 22:33:21 -0400
committerIngo Molnar <mingo@elte.hu>2009-07-13 04:59:55 -0400
commitd0b6e04a4cd8360e3c9c419f7c30a3081a0c142a (patch)
tree621a99cac5fdc0c90a3bcdab60d5896daba04a00 /samples/trace_events
parent7638d5322bd89d49e013a03fe2afaeb6d214fabd (diff)
tracing/events: Move TRACE_SYSTEM outside of include guard
If TRACE_INCLDUE_FILE is defined, <trace/events/TRACE_INCLUDE_FILE.h> will be included and compiled, otherwise it will be <trace/events/TRACE_SYSTEM.h> So TRACE_SYSTEM should be defined outside of #if proctection, just like TRACE_INCLUDE_FILE. Imaging this scenario: #include <trace/events/foo.h> -> TRACE_SYSTEM == foo ... #include <trace/events/bar.h> -> TRACE_SYSTEM == bar ... #define CREATE_TRACE_POINTS #include <trace/events/foo.h> -> TRACE_SYSTEM == bar !!! and then bar.h will be included and compiled. Signed-off-by: Li Zefan <lizf@cn.fujitsu.com> Cc: Steven Rostedt <rostedt@goodmis.org> Cc: Frederic Weisbecker <fweisbec@gmail.com> LKML-Reference: <4A5A9CF1.2010007@cn.fujitsu.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'samples/trace_events')
-rw-r--r--samples/trace_events/trace-events-sample.h37
1 files changed, 20 insertions, 17 deletions
diff --git a/samples/trace_events/trace-events-sample.h b/samples/trace_events/trace-events-sample.h
index 9977a756fb32..f24ae370e514 100644
--- a/samples/trace_events/trace-events-sample.h
+++ b/samples/trace_events/trace-events-sample.h
@@ -1,21 +1,4 @@
1/* 1/*
2 * Notice that this file is not protected like a normal header.
3 * We also must allow for rereading of this file. The
4 *
5 * || defined(TRACE_HEADER_MULTI_READ)
6 *
7 * serves this purpose.
8 */
9#if !defined(_TRACE_EVENT_SAMPLE_H) || defined(TRACE_HEADER_MULTI_READ)
10#define _TRACE_EVENT_SAMPLE_H
11
12/*
13 * All trace headers should include tracepoint.h, until we finally
14 * make it into a standard header.
15 */
16#include <linux/tracepoint.h>
17
18/*
19 * If TRACE_SYSTEM is defined, that will be the directory created 2 * If TRACE_SYSTEM is defined, that will be the directory created
20 * in the ftrace directory under /debugfs/tracing/events/<system> 3 * in the ftrace directory under /debugfs/tracing/events/<system>
21 * 4 *
@@ -34,11 +17,31 @@
34 * #define TRACE_INCLUDE_FILE trace-events-sample 17 * #define TRACE_INCLUDE_FILE trace-events-sample
35 * 18 *
36 * As we do an the bottom of this file. 19 * As we do an the bottom of this file.
20 *
21 * Notice that TRACE_SYSTEM should be defined outside of #if
22 * protection, just like TRACE_INCLUDE_FILE.
37 */ 23 */
38#undef TRACE_SYSTEM 24#undef TRACE_SYSTEM
39#define TRACE_SYSTEM sample 25#define TRACE_SYSTEM sample
40 26
41/* 27/*
28 * Notice that this file is not protected like a normal header.
29 * We also must allow for rereading of this file. The
30 *
31 * || defined(TRACE_HEADER_MULTI_READ)
32 *
33 * serves this purpose.
34 */
35#if !defined(_TRACE_EVENT_SAMPLE_H) || defined(TRACE_HEADER_MULTI_READ)
36#define _TRACE_EVENT_SAMPLE_H
37
38/*
39 * All trace headers should include tracepoint.h, until we finally
40 * make it into a standard header.
41 */
42#include <linux/tracepoint.h>
43
44/*
42 * The TRACE_EVENT macro is broken up into 5 parts. 45 * The TRACE_EVENT macro is broken up into 5 parts.
43 * 46 *
44 * name: name of the trace point. This is also how to enable the tracepoint. 47 * name: name of the trace point. This is also how to enable the tracepoint.