]> git.baikalelectronics.ru Git - kernel.git/commit
ftrace: Fix updating of filters for shared global_ops filters
authorSteven Rostedt (Red Hat) <rostedt@goodmis.org>
Tue, 13 Jan 2015 16:20:43 +0000 (11:20 -0500)
committerSteven Rostedt <rostedt@goodmis.org>
Thu, 15 Jan 2015 14:37:07 +0000 (09:37 -0500)
commit56b95d0c5531fc6147801f9dc2c658ad33b504c6
tree75b0f8121268778bc9a0092e3f11a37b541b6edb
parent016bd972173dd45f89745d2c8412fb2b4c30d084
ftrace: Fix updating of filters for shared global_ops filters

As the set_ftrace_filter affects both the function tracer as well as the
function graph tracer, the ops that represent each have a shared
ftrace_ops_hash structure. This allows both to be updated when the filter
files are updated.

But if function graph is enabled and the global_ops (function tracing) ops
is not, then it is possible that the filter could be changed without the
update happening for the function graph ops. This will cause the changes
to not take place and may even cause a ftrace_bug to occur as it could mess
with the trampoline accounting.

The solution is to check if the ops uses the shared global_ops filter and
if the ops itself is not enabled, to check if there's another ops that is
enabled and also shares the global_ops filter. In that case, the
modification still needs to be executed.

Link: http://lkml.kernel.org/r/20150114154329.055980438@goodmis.org
Cc: stable@vger.kernel.org # 3.17+
Reviewed-by: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
kernel/trace/ftrace.c