ftrace: Have ftrace_ops_get_func() handle RCU and PER_CPU flags too
authorSteven Rostedt (Red Hat) <rostedt@goodmis.org>
Tue, 1 Dec 2015 18:28:16 +0000 (13:28 -0500)
committerSteven Rostedt <rostedt@goodmis.org>
Wed, 23 Dec 2015 19:27:19 +0000 (14:27 -0500)
commitc68c0fa29341754de86b6e5317b6074f1e334581
treeacfe15ff427d6b21a3b347cf81376fa938cd3e83
parentba27f2bc731135a0396f3968bdddb54f3bc72e64
ftrace: Have ftrace_ops_get_func() handle RCU and PER_CPU flags too

Jiri Olsa noted that the change to replace the control_ops did not update
the trampoline for when running perf on a single CPU and with CONFIG_PREEMPT
disabled (where dynamic ops, like perf, can use trampolines directly). The
result was that perf function could be called when RCU is not watching as
well as not handle the ftrace_local_disable().

Modify the ftrace_ops_get_func() to also check the RCU and PER_CPU ops flags
and use the recursive function if they are set. The recursive function is
modified to check those flags and execute the appropriate checks if they are
set.

Link: http://lkml.kernel.org/r/20151201134213.GA14155@krava.brq.redhat.com
Reported-by: Jiri Olsa <jolsa@redhat.com>
Patch-fixed-up-by: Jiri Olsa <jolsa@redhat.com>
Tested-by: Jiri Olsa <jolsa@kernel.org>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
kernel/trace/ftrace.c