aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/trace
diff options
context:
space:
mode:
authorSteven Rostedt <srostedt@redhat.com>2012-11-02 16:58:56 -0400
committerSteven Rostedt <rostedt@goodmis.org>2013-01-22 23:37:57 -0500
commit6350379452ccaeaa71734adf57dec2ebc9207849 (patch)
tree58873a5c9c3d7c2b9b29d56482a87a4392ecb8a2 /kernel/trace
parent05cbbf643b8eea1be21082c53cdb856d1dc6d765 (diff)
ftrace: Fix global function tracers that are not recursion safe
If one of the function tracers set by the global ops is not recursion safe, it can still be called directly without the added recursion supplied by the ftrace infrastructure. Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Diffstat (limited to 'kernel/trace')
-rw-r--r--kernel/trace/ftrace.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c
index 6e34dc162fe1..789cbec24e81 100644
--- a/kernel/trace/ftrace.c
+++ b/kernel/trace/ftrace.c
@@ -221,10 +221,24 @@ static void update_global_ops(void)
221 * registered callers. 221 * registered callers.
222 */ 222 */
223 if (ftrace_global_list == &ftrace_list_end || 223 if (ftrace_global_list == &ftrace_list_end ||
224 ftrace_global_list->next == &ftrace_list_end) 224 ftrace_global_list->next == &ftrace_list_end) {
225 func = ftrace_global_list->func; 225 func = ftrace_global_list->func;
226 else 226 /*
227 * As we are calling the function directly.
228 * If it does not have recursion protection,
229 * the function_trace_op needs to be updated
230 * accordingly.
231 */
232 if (ftrace_global_list->flags & FTRACE_OPS_FL_RECURSION_SAFE)
233 global_ops.flags |= FTRACE_OPS_FL_RECURSION_SAFE;
234 else
235 global_ops.flags &= ~FTRACE_OPS_FL_RECURSION_SAFE;
236 } else {
227 func = ftrace_global_list_func; 237 func = ftrace_global_list_func;
238 /* The list has its own recursion protection. */
239 global_ops.flags |= FTRACE_OPS_FL_RECURSION_SAFE;
240 }
241
228 242
229 /* If we filter on pids, update to use the pid function */ 243 /* If we filter on pids, update to use the pid function */
230 if (!list_empty(&ftrace_pids)) { 244 if (!list_empty(&ftrace_pids)) {