Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 140978
b: refs/heads/master
c: 5fec6dd
h: refs/heads/master
v: v3
  • Loading branch information
Steven Rostedt committed Mar 18, 2009
1 parent 6553988 commit 335a3c1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 97e7e4f391cac2b00417b581b432533d245d4fd0
refs/heads/master: 5fec6ddcb43a91aa9a254c8ecf174c803de6f07e
9 changes: 5 additions & 4 deletions trunk/kernel/trace/trace_sched_switch.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ static struct trace_array *ctx_trace;
static int __read_mostly tracer_enabled;
static int sched_ref;
static DEFINE_MUTEX(sched_register_mutex);
static int sched_stopped;

static void
probe_sched_switch(struct rq *__rq, struct task_struct *prev,
Expand All @@ -28,7 +29,7 @@ probe_sched_switch(struct rq *__rq, struct task_struct *prev,
int cpu;
int pc;

if (!sched_ref)
if (!sched_ref || sched_stopped)
return;

tracing_record_cmdline(prev);
Expand Down Expand Up @@ -193,6 +194,7 @@ static void stop_sched_trace(struct trace_array *tr)
static int sched_switch_trace_init(struct trace_array *tr)
{
ctx_trace = tr;
tracing_reset_online_cpus(tr);
tracing_start_sched_switch_record();
return 0;
}
Expand All @@ -205,13 +207,12 @@ static void sched_switch_trace_reset(struct trace_array *tr)

static void sched_switch_trace_start(struct trace_array *tr)
{
tracing_reset_online_cpus(tr);
tracing_start_sched_switch();
sched_stopped = 0;
}

static void sched_switch_trace_stop(struct trace_array *tr)
{
tracing_stop_sched_switch();
sched_stopped = 1;
}

static struct tracer sched_switch_trace __read_mostly =
Expand Down

0 comments on commit 335a3c1

Please sign in to comment.