summaryrefslogtreecommitdiff
path: root/include/linux/ftrace.h
diff options
context:
space:
mode:
authorSteven Rostedt <srostedt@redhat.com>2012-07-20 19:04:44 +0400
committerSteven Rostedt <rostedt@goodmis.org>2012-07-31 18:29:52 +0400
commit4740974a6844156c14d741b0080b59d275679a23 (patch)
tree7272f577c74a185d9fe037a424d0401e4ec7c126 /include/linux/ftrace.h
parent5767cfeaa9ec7b67c802143394f3ad9f8b174eb8 (diff)
downloadlinux-4740974a6844156c14d741b0080b59d275679a23.tar.xz
ftrace: Add default recursion protection for function tracing
As more users of the function tracer utility are being added, they do not always add the necessary recursion protection. To protect from function recursion due to tracing, if the callback ftrace_ops does not specifically specify that it protects against recursion (by setting the FTRACE_OPS_FL_RECURSION_SAFE flag), the list operation will be called by the mcount trampoline which adds recursion protection. If the flag is set, then the function will be called directly with no extra protection. Note, the list operation is called if more than one function callback is registered, or if the arch does not support all of the function tracer features. Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Diffstat (limited to 'include/linux/ftrace.h')
-rw-r--r--include/linux/ftrace.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/include/linux/ftrace.h b/include/linux/ftrace.h
index ab39990cc43f..65a14e47a0db 100644
--- a/include/linux/ftrace.h
+++ b/include/linux/ftrace.h
@@ -85,6 +85,10 @@ typedef void (*ftrace_func_t)(unsigned long ip, unsigned long parent_ip,
* passing regs to the handler.
* Note, if this flag is set, the SAVE_REGS flag will automatically
* get set upon registering the ftrace_ops, if the arch supports it.
+ * RECURSION_SAFE - The ftrace_ops can set this to tell the ftrace infrastructure
+ * that the call back has its own recursion protection. If it does
+ * not set this, then the ftrace infrastructure will add recursion
+ * protection for the caller.
*/
enum {
FTRACE_OPS_FL_ENABLED = 1 << 0,
@@ -93,6 +97,7 @@ enum {
FTRACE_OPS_FL_CONTROL = 1 << 3,
FTRACE_OPS_FL_SAVE_REGS = 1 << 4,
FTRACE_OPS_FL_SAVE_REGS_IF_SUPPORTED = 1 << 5,
+ FTRACE_OPS_FL_RECURSION_SAFE = 1 << 6,
};
struct ftrace_ops {