aboutsummaryrefslogtreecommitdiffstats
path: root/include/trace
diff options
context:
space:
mode:
authorJosh Stone <jistone@redhat.com>2009-08-24 17:43:13 -0400
committerFrederic Weisbecker <fweisbec@gmail.com>2009-08-25 18:36:41 -0400
commit97419875865859fd2403e66266c02ce028e2f5ab (patch)
tree7df6e6df767e9c8ff538a50bcae17638a1c8da99 /include/trace
parent3d27d8cb34fc156beb86de2338ca4029873a5cc6 (diff)
tracing: Move tracepoint callbacks from declaration to definition
It's not strictly correct for the tracepoint reg/unreg callbacks to occur when a client is hooking up, because the actual tracepoint may not be present yet. This happens to be fine for syscall, since that's in the core kernel, but it would cause problems for tracepoints defined in a module that hasn't been loaded yet. It also means the reg/unreg has to be EXPORTed for any modules to use the tracepoint (as in SystemTap). This patch removes DECLARE_TRACE_WITH_CALLBACK, and instead introduces DEFINE_TRACE_FN which stores the callbacks in struct tracepoint. The callbacks are used now when the active state of the tracepoint changes in set_tracepoint & disable_tracepoint. This also introduces TRACE_EVENT_FN, so ftrace events can also provide registration callbacks if needed. Signed-off-by: Josh Stone <jistone@redhat.com> Cc: Jason Baron <jbaron@redhat.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Ingo Molnar <mingo@elte.hu> Cc: Li Zefan <lizf@cn.fujitsu.com> Cc: Steven Rostedt <rostedt@goodmis.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca> Cc: Jiaying Zhang <jiayingz@google.com> Cc: Martin Bligh <mbligh@google.com> Cc: Lai Jiangshan <laijs@cn.fujitsu.com> Cc: Paul Mundt <lethal@linux-sh.org> Cc: Martin Schwidefsky <schwidefsky@de.ibm.com> Cc: Heiko Carstens <heiko.carstens@de.ibm.com> LKML-Reference: <1251150194-1713-4-git-send-email-jistone@redhat.com> Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
Diffstat (limited to 'include/trace')
-rw-r--r--include/trace/define_trace.h5
-rw-r--r--include/trace/ftrace.h9
-rw-r--r--include/trace/syscall.h12
3 files changed, 18 insertions, 8 deletions
diff --git a/include/trace/define_trace.h b/include/trace/define_trace.h
index f7a7ae1e8f90..2a969850736d 100644
--- a/include/trace/define_trace.h
+++ b/include/trace/define_trace.h
@@ -26,6 +26,11 @@
26#define TRACE_EVENT(name, proto, args, tstruct, assign, print) \ 26#define TRACE_EVENT(name, proto, args, tstruct, assign, print) \
27 DEFINE_TRACE(name) 27 DEFINE_TRACE(name)
28 28
29#undef TRACE_EVENT_FN
30#define TRACE_EVENT_FN(name, proto, args, tstruct, \
31 assign, print, reg, unreg) \
32 DEFINE_TRACE_FN(name, reg, unreg)
33
29#undef DECLARE_TRACE 34#undef DECLARE_TRACE
30#define DECLARE_TRACE(name, proto, args) \ 35#define DECLARE_TRACE(name, proto, args) \
31 DEFINE_TRACE(name) 36 DEFINE_TRACE(name)
diff --git a/include/trace/ftrace.h b/include/trace/ftrace.h
index 127400255e4c..3a0b44bdabf7 100644
--- a/include/trace/ftrace.h
+++ b/include/trace/ftrace.h
@@ -42,6 +42,15 @@
42 }; \ 42 }; \
43 static struct ftrace_event_call event_##name 43 static struct ftrace_event_call event_##name
44 44
45/* Callbacks are meaningless to ftrace. */
46#undef TRACE_EVENT_FN
47#define TRACE_EVENT_FN(name, proto, args, tstruct, \
48 assign, print, reg, unreg) \
49 TRACE_EVENT(name, TP_PROTO(proto), TP_ARGS(args), \
50 TP_STRUCT__entry(tstruct), \
51 TP_fast_assign(assign), \
52 TP_printk(print))
53
45#include TRACE_INCLUDE(TRACE_INCLUDE_FILE) 54#include TRACE_INCLUDE(TRACE_INCLUDE_FILE)
46 55
47 56
diff --git a/include/trace/syscall.h b/include/trace/syscall.h
index 5dcb7e3a544c..4e1943001854 100644
--- a/include/trace/syscall.h
+++ b/include/trace/syscall.h
@@ -13,18 +13,14 @@
13extern void syscall_regfunc(void); 13extern void syscall_regfunc(void);
14extern void syscall_unregfunc(void); 14extern void syscall_unregfunc(void);
15 15
16DECLARE_TRACE_WITH_CALLBACK(syscall_enter, 16DECLARE_TRACE(syscall_enter,
17 TP_PROTO(struct pt_regs *regs, long id), 17 TP_PROTO(struct pt_regs *regs, long id),
18 TP_ARGS(regs, id), 18 TP_ARGS(regs, id)
19 syscall_regfunc,
20 syscall_unregfunc
21); 19);
22 20
23DECLARE_TRACE_WITH_CALLBACK(syscall_exit, 21DECLARE_TRACE(syscall_exit,
24 TP_PROTO(struct pt_regs *regs, long ret), 22 TP_PROTO(struct pt_regs *regs, long ret),
25 TP_ARGS(regs, ret), 23 TP_ARGS(regs, ret)
26 syscall_regfunc,
27 syscall_unregfunc
28); 24);
29 25
30#endif 26#endif