From: Frederic Weisbecker Date: Thu, 4 Dec 2008 22:49:47 +0000 (+0100) Subject: tracing/ftrace: fix the check of ftrace_trace_task X-Git-Tag: v2.6.29-rc1~586^2~23 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=77d683f3e0258d522c5506e7b5fd05c9411184d9;p=linux-2.6-omap-h63xx.git 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: Frederic Weisbecker Acke-dby: Steven Rostedt Signed-off-by: Ingo Molnar --- diff --git a/kernel/trace/trace.h b/kernel/trace/trace.h index a71bbe0a363..5ac697065a4 100644 --- a/kernel/trace/trace.h +++ b/kernel/trace/trace.h @@ -551,7 +551,7 @@ extern struct pid *ftrace_pid_trace; static inline int ftrace_trace_task(struct task_struct *task) { - if (ftrace_pid_trace) + if (!ftrace_pid_trace) return 1; return test_tsk_trace_trace(task);