Commit 77d683f3 authored by Frederic Weisbecker's avatar Frederic Weisbecker Committed by Ingo Molnar

tracing/ftrace: fix the check of ftrace_trace_task

Impact: fix default empty traces on function-graph-tracer

The actual ftrace_trace_task() checks if ftrace_pid_trace is allocated
and return 1 if it is true.
If it is NULL, it will check the bit of pid tracing flag for the current
task (which are not set by default).
So by default, a task is not traced.
Actually all tasks should be traced by default and filter_by_pid when
ftrace_pid_trace is allocated.

The appropriate condition should be to return 1 if filter_by_pid is
set.
Signed-off-by: default avatarFrederic Weisbecker <fweisbec@gmail.com>
Acke-dby: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
parent ff32504f
...@@ -551,7 +551,7 @@ extern struct pid *ftrace_pid_trace; ...@@ -551,7 +551,7 @@ extern struct pid *ftrace_pid_trace;
static inline int ftrace_trace_task(struct task_struct *task) static inline int ftrace_trace_task(struct task_struct *task)
{ {
if (ftrace_pid_trace) if (!ftrace_pid_trace)
return 1; return 1;
return test_tsk_trace_trace(task); return test_tsk_trace_trace(task);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment