aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDenis Kirjanov <kda@linux-powerpc.org>2015-12-14 15:18:05 -0500
committerSteven Rostedt <rostedt@goodmis.org>2015-12-23 14:27:21 -0500
commit2701121b8f4db4d69c327c0d8f8694ff2ce30ef7 (patch)
tree8075d22174057d82cf72134c1923efd303dd6df3
parentff078d8fc644722f7b163d79e8a03b00b9dc2385 (diff)
tracing: Introduce TRACE_EVENT_FN_COND macro
TRACE_EVENT_FN can't be used in some circumstances like invoking trace functions from offlined CPU due to RCU usage. This patch adds the TRACE_EVENT_FN_COND macro to make such trace points conditional. Link: http://lkml.kernel.org/r/1450124286-4822-1-git-send-email-kda@linux-powerpc.org Signed-off-by: Denis Kirjanov <kda@linux-powerpc.org> Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
-rw-r--r--include/linux/tracepoint.h4
-rw-r--r--include/trace/define_trace.h6
-rw-r--r--include/trace/trace_events.h6
3 files changed, 16 insertions, 0 deletions
diff --git a/include/linux/tracepoint.h b/include/linux/tracepoint.h
index 696a339c592c..45b3fcf7dd3c 100644
--- a/include/linux/tracepoint.h
+++ b/include/linux/tracepoint.h
@@ -493,6 +493,10 @@ extern void syscall_unregfunc(void);
493#define TRACE_EVENT_FN(name, proto, args, struct, \ 493#define TRACE_EVENT_FN(name, proto, args, struct, \
494 assign, print, reg, unreg) \ 494 assign, print, reg, unreg) \
495 DECLARE_TRACE(name, PARAMS(proto), PARAMS(args)) 495 DECLARE_TRACE(name, PARAMS(proto), PARAMS(args))
496#define TRACE_EVENT_FN_COND(name, proto, args, cond, struct, \
497 assign, print, reg, unreg) \
498 DECLARE_TRACE_CONDITION(name, PARAMS(proto), \
499 PARAMS(args), PARAMS(cond))
496#define TRACE_EVENT_CONDITION(name, proto, args, cond, \ 500#define TRACE_EVENT_CONDITION(name, proto, args, cond, \
497 struct, assign, print) \ 501 struct, assign, print) \
498 DECLARE_TRACE_CONDITION(name, PARAMS(proto), \ 502 DECLARE_TRACE_CONDITION(name, PARAMS(proto), \
diff --git a/include/trace/define_trace.h b/include/trace/define_trace.h
index 2d8639ea64d5..6e3945f64102 100644
--- a/include/trace/define_trace.h
+++ b/include/trace/define_trace.h
@@ -40,6 +40,11 @@
40 assign, print, reg, unreg) \ 40 assign, print, reg, unreg) \
41 DEFINE_TRACE_FN(name, reg, unreg) 41 DEFINE_TRACE_FN(name, reg, unreg)
42 42
43#undef TRACE_EVENT_FN_COND
44#define TRACE_EVENT_FN_COND(name, proto, args, cond, tstruct, \
45 assign, print, reg, unreg) \
46 DEFINE_TRACE_FN(name, reg, unreg)
47
43#undef DEFINE_EVENT 48#undef DEFINE_EVENT
44#define DEFINE_EVENT(template, name, proto, args) \ 49#define DEFINE_EVENT(template, name, proto, args) \
45 DEFINE_TRACE(name) 50 DEFINE_TRACE(name)
@@ -93,6 +98,7 @@
93 98
94#undef TRACE_EVENT 99#undef TRACE_EVENT
95#undef TRACE_EVENT_FN 100#undef TRACE_EVENT_FN
101#undef TRACE_EVENT_FN_COND
96#undef TRACE_EVENT_CONDITION 102#undef TRACE_EVENT_CONDITION
97#undef DECLARE_EVENT_CLASS 103#undef DECLARE_EVENT_CLASS
98#undef DEFINE_EVENT 104#undef DEFINE_EVENT
diff --git a/include/trace/trace_events.h b/include/trace/trace_events.h
index de996cf61053..170c93bbdbb7 100644
--- a/include/trace/trace_events.h
+++ b/include/trace/trace_events.h
@@ -123,6 +123,12 @@ TRACE_MAKE_SYSTEM_STR();
123 TRACE_EVENT(name, PARAMS(proto), PARAMS(args), \ 123 TRACE_EVENT(name, PARAMS(proto), PARAMS(args), \
124 PARAMS(tstruct), PARAMS(assign), PARAMS(print)) \ 124 PARAMS(tstruct), PARAMS(assign), PARAMS(print)) \
125 125
126#undef TRACE_EVENT_FN_COND
127#define TRACE_EVENT_FN_COND(name, proto, args, cond, tstruct, \
128 assign, print, reg, unreg) \
129 TRACE_EVENT_CONDITION(name, PARAMS(proto), PARAMS(args), PARAMS(cond), \
130 PARAMS(tstruct), PARAMS(assign), PARAMS(print)) \
131
126#undef TRACE_EVENT_FLAGS 132#undef TRACE_EVENT_FLAGS
127#define TRACE_EVENT_FLAGS(name, value) \ 133#define TRACE_EVENT_FLAGS(name, value) \
128 __TRACE_EVENT_FLAGS(name, value) 134 __TRACE_EVENT_FLAGS(name, value)