]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
ftrace: Fix ftrace_trace_task return value
authorJosef Bacik <josef@toxicpanda.com>
Sat, 25 Jul 2020 00:50:48 +0000 (20:50 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 19 Aug 2020 06:24:06 +0000 (08:24 +0200)
commit6871b1dedce46a38be350bcafa9d3933497f3808
tree95adf8df4ec2d9b2b6d56768eb6ab4112a7defdb
parent68e3b178f2c59258d7285166bd0292d542381e57
ftrace: Fix ftrace_trace_task return value

[ Upstream commit c58b6b0372de0d4cd0536d6585addd1b36b151ae ]

I was attempting to use pid filtering with function_graph, but it wasn't
allowing anything to make it through.  Turns out ftrace_trace_task
returns false if ftrace_ignore_pid is not-empty, which isn't correct
anymore.  We're now setting it to FTRACE_PID_IGNORE if we need to ignore
that pid, otherwise it's set to the pid (which is weird considering the
name) or to FTRACE_PID_TRACE.  Fix the check to check for !=
FTRACE_PID_IGNORE.  With this we can now use function_graph with pid
filtering.

Link: https://lkml.kernel.org/r/20200725005048.1790-1-josef@toxicpanda.com
Fixes: 717e3f5ebc82 ("ftrace: Make function trace pid filtering a bit more exact")
Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
kernel/trace/ftrace.c
kernel/trace/trace.h