aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTal Shorer <tal.shorer@gmail.com>2015-08-01 08:27:57 -0400
committerSteven Rostedt <rostedt@goodmis.org>2015-10-20 21:55:44 -0400
commitc63b7682b6d90530d3a071ff75b81bfddcce8598 (patch)
tree06ae1511fd717a638d28550388fb2f52b312d179
parentb86d9371be2fcb6ebf47e6c15d23d0ec1586664a (diff)
tracing: Allow disabling compilation of specific trace systems
Allow a trace events header file to disable compilation of its trace events by defining the preprocessor macro NOTRACE. This could be done, for example, according to a Kconfig option. Link: http://lkml.kernel.org/r/1438432079-11704-3-git-send-email-tal.shorer@gmail.com Signed-off-by: Tal Shorer <tal.shorer@gmail.com> Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
-rw-r--r--include/linux/tracepoint.h17
-rw-r--r--include/trace/define_trace.h2
2 files changed, 15 insertions, 4 deletions
diff --git a/include/linux/tracepoint.h b/include/linux/tracepoint.h
index a5f7f3ecafa3..afada369c5b7 100644
--- a/include/linux/tracepoint.h
+++ b/include/linux/tracepoint.h
@@ -111,7 +111,18 @@ extern void syscall_unregfunc(void);
111#define TP_ARGS(args...) args 111#define TP_ARGS(args...) args
112#define TP_CONDITION(args...) args 112#define TP_CONDITION(args...) args
113 113
114#ifdef CONFIG_TRACEPOINTS 114/*
115 * Individual subsystem my have a separate configuration to
116 * enable their tracepoints. By default, this file will create
117 * the tracepoints if CONFIG_TRACEPOINT is defined. If a subsystem
118 * wants to be able to disable its tracepoints from being created
119 * it can define NOTRACE before including the tracepoint headers.
120 */
121#if defined(CONFIG_TRACEPOINTS) && !defined(NOTRACE)
122#define TRACEPOINTS_ENABLED
123#endif
124
125#ifdef TRACEPOINTS_ENABLED
115 126
116/* 127/*
117 * it_func[0] is never NULL because there is at least one element in the array 128 * it_func[0] is never NULL because there is at least one element in the array
@@ -234,7 +245,7 @@ extern void syscall_unregfunc(void);
234#define EXPORT_TRACEPOINT_SYMBOL(name) \ 245#define EXPORT_TRACEPOINT_SYMBOL(name) \
235 EXPORT_SYMBOL(__tracepoint_##name) 246 EXPORT_SYMBOL(__tracepoint_##name)
236 247
237#else /* !CONFIG_TRACEPOINTS */ 248#else /* !TRACEPOINTS_ENABLED */
238#define __DECLARE_TRACE(name, proto, args, cond, data_proto, data_args) \ 249#define __DECLARE_TRACE(name, proto, args, cond, data_proto, data_args) \
239 static inline void trace_##name(proto) \ 250 static inline void trace_##name(proto) \
240 { } \ 251 { } \
@@ -266,7 +277,7 @@ extern void syscall_unregfunc(void);
266#define EXPORT_TRACEPOINT_SYMBOL_GPL(name) 277#define EXPORT_TRACEPOINT_SYMBOL_GPL(name)
267#define EXPORT_TRACEPOINT_SYMBOL(name) 278#define EXPORT_TRACEPOINT_SYMBOL(name)
268 279
269#endif /* CONFIG_TRACEPOINTS */ 280#endif /* TRACEPOINTS_ENABLED */
270 281
271#ifdef CONFIG_TRACING 282#ifdef CONFIG_TRACING
272/** 283/**
diff --git a/include/trace/define_trace.h b/include/trace/define_trace.h
index 09b3880105a9..2d8639ea64d5 100644
--- a/include/trace/define_trace.h
+++ b/include/trace/define_trace.h
@@ -86,7 +86,7 @@
86#undef DECLARE_TRACE 86#undef DECLARE_TRACE
87#define DECLARE_TRACE(name, proto, args) 87#define DECLARE_TRACE(name, proto, args)
88 88
89#ifdef CONFIG_EVENT_TRACING 89#ifdef TRACEPOINTS_ENABLED
90#include <trace/trace_events.h> 90#include <trace/trace_events.h>
91#include <trace/perf.h> 91#include <trace/perf.h>
92#endif 92#endif