diff options
author | Steven Rostedt <srostedt@redhat.com> | 2011-08-08 16:57:47 -0400 |
---|---|---|
committer | Steven Rostedt <rostedt@goodmis.org> | 2012-07-19 13:17:35 -0400 |
commit | 2f5f6ad9390c1ebbf738d130dbfe80b60eaa167e (patch) | |
tree | 1a88c37725d3efbcde8fa0a3cf19490d793877f0 /include/linux/ftrace.h | |
parent | 6e0f17be0361444862637e8986c8c1a3b3f8dcf8 (diff) |
ftrace: Pass ftrace_ops as third parameter to function trace callback
Currently the function trace callback receives only the ip and parent_ip
of the function that it traced. It would be more powerful to also return
the ops that registered the function as well. This allows the same function
to act differently depending on what ftrace_ops registered it.
Link: http://lkml.kernel.org/r/20120612225424.267254552@goodmis.org
Reviewed-by: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Diffstat (limited to 'include/linux/ftrace.h')
-rw-r--r-- | include/linux/ftrace.h | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/include/linux/ftrace.h b/include/linux/ftrace.h index 55e6d63d46d0..2d5964119885 100644 --- a/include/linux/ftrace.h +++ b/include/linux/ftrace.h | |||
@@ -18,6 +18,15 @@ | |||
18 | 18 | ||
19 | #include <asm/ftrace.h> | 19 | #include <asm/ftrace.h> |
20 | 20 | ||
21 | /* | ||
22 | * If the arch supports passing the variable contents of | ||
23 | * function_trace_op as the third parameter back from the | ||
24 | * mcount call, then the arch should define this as 1. | ||
25 | */ | ||
26 | #ifndef ARCH_SUPPORTS_FTRACE_OPS | ||
27 | #define ARCH_SUPPORTS_FTRACE_OPS 0 | ||
28 | #endif | ||
29 | |||
21 | struct module; | 30 | struct module; |
22 | struct ftrace_hash; | 31 | struct ftrace_hash; |
23 | 32 | ||
@@ -29,7 +38,10 @@ ftrace_enable_sysctl(struct ctl_table *table, int write, | |||
29 | void __user *buffer, size_t *lenp, | 38 | void __user *buffer, size_t *lenp, |
30 | loff_t *ppos); | 39 | loff_t *ppos); |
31 | 40 | ||
32 | typedef void (*ftrace_func_t)(unsigned long ip, unsigned long parent_ip); | 41 | struct ftrace_ops; |
42 | |||
43 | typedef void (*ftrace_func_t)(unsigned long ip, unsigned long parent_ip, | ||
44 | struct ftrace_ops *op); | ||
33 | 45 | ||
34 | /* | 46 | /* |
35 | * FTRACE_OPS_FL_* bits denote the state of ftrace_ops struct and are | 47 | * FTRACE_OPS_FL_* bits denote the state of ftrace_ops struct and are |
@@ -163,7 +175,7 @@ static inline int ftrace_function_local_disabled(struct ftrace_ops *ops) | |||
163 | return *this_cpu_ptr(ops->disabled); | 175 | return *this_cpu_ptr(ops->disabled); |
164 | } | 176 | } |
165 | 177 | ||
166 | extern void ftrace_stub(unsigned long a0, unsigned long a1); | 178 | extern void ftrace_stub(unsigned long a0, unsigned long a1, struct ftrace_ops *op); |
167 | 179 | ||
168 | #else /* !CONFIG_FUNCTION_TRACER */ | 180 | #else /* !CONFIG_FUNCTION_TRACER */ |
169 | /* | 181 | /* |