diff options
author | Steven Rostedt <srostedt@redhat.com> | 2009-04-23 23:26:18 -0400 |
---|---|---|
committer | Steven Rostedt <rostedt@goodmis.org> | 2009-04-23 23:34:20 -0400 |
commit | c2518c4366f087ebc10b3919cb2461bbe4f42d0c (patch) | |
tree | a62093cb5d040a871a33d235f0993dc4b7fe27b9 /include/trace/define_trace.h | |
parent | d7285c6b5c54397fdf112c2fb98ee43193173aa9 (diff) |
tracing: fix cut and paste macro error
In case a module uses the TRACE_EVENT macro for creating automated
events in ftrace, it may choose to use a different file name
than the defined system name, or choose to use a different path than
the default "include/trace/events" include path.
If this is done, then before including trace/define_trace.h the
header would define either "TRACE_INCLUDE_FILE" for the file
name or "TRACE_INCLUDE_PATH" for the include path.
If it does not define these, then the define_trace.h defines them
instead. If define trace defines them, then define_trace.h should
also undefine them before exiting. To do this a macro is used
to note this:
#ifndef TRACE_INCLUDE_FILE
# define TRACE_INCLUDE_FILE TRACE_SYSTEM
# define UNDEF_TRACE_INCLUDE_FILE
#endif
[...]
#ifdef UNDEF_TRACE_INCLUDE_FILE
# undef TRACE_INCLUDE_FILE
# undef UNDEF_TRACE_INCLUDE_FILE
#endif
The UNDEF_TRACE_INCLUDE_FILE acts as a CPP variable to know to undef
the TRACE_INCLUDE_FILE before leaving define_trace.h.
Unfortunately, due to cut and paste errors, the macros between
FILE and PATH got mixed up.
[ Impact: undef TRACE_INCLUDE_FILE and/or TRACE_INCLUDE_PATH when needed ]
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Diffstat (limited to 'include/trace/define_trace.h')
-rw-r--r-- | include/trace/define_trace.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/include/trace/define_trace.h b/include/trace/define_trace.h index 7f1f23d601e..abc611feeb8 100644 --- a/include/trace/define_trace.h +++ b/include/trace/define_trace.h | |||
@@ -44,7 +44,7 @@ | |||
44 | 44 | ||
45 | #ifndef TRACE_INCLUDE_PATH | 45 | #ifndef TRACE_INCLUDE_PATH |
46 | # define __TRACE_INCLUDE(system) <trace/events/system.h> | 46 | # define __TRACE_INCLUDE(system) <trace/events/system.h> |
47 | # define UNDEF_TRACE_INCLUDE_FILE | 47 | # define UNDEF_TRACE_INCLUDE_PATH |
48 | #else | 48 | #else |
49 | # define __TRACE_INCLUDE(system) __stringify(TRACE_INCLUDE_PATH/system.h) | 49 | # define __TRACE_INCLUDE(system) __stringify(TRACE_INCLUDE_PATH/system.h) |
50 | #endif | 50 | #endif |
@@ -64,13 +64,13 @@ | |||
64 | 64 | ||
65 | /* Only undef what we defined in this file */ | 65 | /* Only undef what we defined in this file */ |
66 | #ifdef UNDEF_TRACE_INCLUDE_FILE | 66 | #ifdef UNDEF_TRACE_INCLUDE_FILE |
67 | # undef TRACE_INCLUDE_PATH | 67 | # undef TRACE_INCLUDE_FILE |
68 | # undef UNDEF_TRACE_INCLUDE_FILE | 68 | # undef UNDEF_TRACE_INCLUDE_FILE |
69 | #endif | 69 | #endif |
70 | 70 | ||
71 | #ifdef UNDEF_TRACE_INCLUDE_FILE | 71 | #ifdef UNDEF_TRACE_INCLUDE_PATH |
72 | # undef TRACE_INCLUDE_PATH | 72 | # undef TRACE_INCLUDE_PATH |
73 | # undef UNDEF_TRACE_INCLUDE_FILE | 73 | # undef UNDEF_TRACE_INCLUDE_PATH |
74 | #endif | 74 | #endif |
75 | 75 | ||
76 | /* We may be processing more files */ | 76 | /* We may be processing more files */ |