aboutsummaryrefslogtreecommitdiff
path: root/samples
diff options
context:
space:
mode:
authorSteven Rostedt <srostedt@redhat.com>2009-05-06 21:20:39 -0400
committerSteven Rostedt <rostedt@goodmis.org>2009-05-06 23:10:42 -0400
commit71e1c8ac42ae4038ddb1367cce7097ab868dc532 (patch)
treea8e7ce8c468ad924da2d510df95c4da84edbb309 /samples
parent3e07a4f680adc66dfa175aa5021aedf340251b12 (diff)
downloadlinux-2.6.38-lt-ux500-71e1c8ac42ae4038ddb1367cce7097ab868dc532.tar.gz
tracing: update sample with TRACE_INCLUDE_FILE
When creating trace events for ftrace, the header file with the TRACE_EVENT macros must also have a macro called TRACE_SYSTEM. This macro describes the name of the system the TRACE_EVENTS are defined for. It also doubles as a way for the define_trace.h file to include the file that included it. For example: in irq.h #define TRACE_SYSTEM irq [...] #include <trace/define_trace.h> The define_trace will use TRACE_SYSTEM to include irq.h. But if the name of the trace system does not match the name of the trace header file, one can override it with: Which will change define_trace.h to inclued foo_trace.h instead of foo.h The sample comments this, but people that use the sample code will more likely use the code and not read the comments. This patch changes the sample code to use the TRACE_INCLUDE_FILE to better show developers how to use it. [ Impact: make sample less confusing to developers ] Reported-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Diffstat (limited to 'samples')
-rw-r--r--samples/trace_events/trace-events-sample.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/samples/trace_events/trace-events-sample.h b/samples/trace_events/trace-events-sample.h
index eab46443e61..128a897687c 100644
--- a/samples/trace_events/trace-events-sample.h
+++ b/samples/trace_events/trace-events-sample.h
@@ -31,7 +31,7 @@
*
*/
#undef TRACE_SYSTEM
-#define TRACE_SYSTEM trace-events-sample
+#define TRACE_SYSTEM sample
/*
* The TRACE_EVENT macro is broken up into 5 parts.
@@ -120,5 +120,10 @@ TRACE_EVENT(foo_bar,
* result.
*/
#undef TRACE_INCLUDE_PATH
+#undef TRACE_INCLUDE_FILE
#define TRACE_INCLUDE_PATH .
+/*
+ * TRACE_INCLUDE_FILE is not needed if the filename and TRACE_SYSTEM are equal
+ */
+#define TRACE_INCLUDE_FILE trace-events-sample
#include <trace/define_trace.h>