OSDN Git Service

ftrace: Add default recursion protection for function tracing
authorSteven Rostedt <srostedt@redhat.com>
Fri, 20 Jul 2012 15:04:44 +0000 (11:04 -0400)
committerSteven Rostedt <rostedt@goodmis.org>
Tue, 31 Jul 2012 14:29:52 +0000 (10:29 -0400)
commit4740974a6844156c14d741b0080b59d275679a23
tree7272f577c74a185d9fe037a424d0401e4ec7c126
parent5767cfeaa9ec7b67c802143394f3ad9f8b174eb8
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>
include/linux/ftrace.h
kernel/trace/ftrace.c
kernel/trace/trace_events.c
kernel/trace/trace_functions.c
kernel/trace/trace_irqsoff.c
kernel/trace/trace_sched_wakeup.c
kernel/trace/trace_selftest.c
kernel/trace/trace_stack.c