Skip to content

Commit

Permalink
ftrace: Add check of sched_stopped for probe_sched_wakeup
Browse files Browse the repository at this point in the history
The wakeup tracing in sched_switch does not stop when a user
disables tracing. This is because the probe_sched_wakeup() is missing
the check to prevent the wakeup from being traced.

Signed-off-by: Zhao Lei <zhaolei@cn.fujitsu.com>
LKML-Reference: <49D1C543.3010307@cn.fujitsu.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
  • Loading branch information
Zhaolei authored and Ingo Molnar committed Apr 7, 2009
1 parent 5ac9f62 commit 8bcae09
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions kernel/trace/trace_sched_switch.c
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,9 @@ probe_sched_wakeup(struct rq *__rq, struct task_struct *wakee, int success)
pc = preempt_count();
tracing_record_cmdline(current);

if (sched_stopped)
return;

local_irq_save(flags);
cpu = raw_smp_processor_id();
data = ctx_trace->data[cpu];
Expand Down

0 comments on commit 8bcae09

Please sign in to comment.