summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteven Rostedt (Red Hat) <rostedt@goodmis.org>2014-02-19 15:12:18 -0500
committerSteven Rostedt <rostedt@goodmis.org>2014-02-20 12:32:55 -0500
commit1fcc155351f183e5044180eeb372a8ff47710855 (patch)
tree111b7ee855b3a4bc463e6ac04c5dbad3bcb43ded
parente1e232ca6b8faa210e5509f17d55519b4392524f (diff)
downloadop-kernel-dev-1fcc155351f183e5044180eeb372a8ff47710855.zip
op-kernel-dev-1fcc155351f183e5044180eeb372a8ff47710855.tar.gz
ftrace: Have static function trace clear ENABLED flag on unregister
The ENABLED flag needs to be cleared when a ftrace_ops is unregistered otherwise it wont be able to be registered again. This is only for static tracing and does not affect DYNAMIC_FTRACE at all. Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
-rw-r--r--kernel/trace/ftrace.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c
index dcee546..5313c11 100644
--- a/kernel/trace/ftrace.c
+++ b/kernel/trace/ftrace.c
@@ -4463,7 +4463,13 @@ static inline void ftrace_startup_enable(int command) { }
(ops)->flags |= FTRACE_OPS_FL_ENABLED; \
___ret; \
})
-# define ftrace_shutdown(ops, command) __unregister_ftrace_function(ops)
+# define ftrace_shutdown(ops, command) \
+ ({ \
+ int ___ret = __unregister_ftrace_function(ops); \
+ if (!___ret) \
+ (ops)->flags &= ~FTRACE_OPS_FL_ENABLED; \
+ ___ret; \
+ })
# define ftrace_startup_sysctl() do { } while (0)
# define ftrace_shutdown_sysctl() do { } while (0)
OpenPOWER on IntegriCloud