Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 121058
b: refs/heads/master
c: 07695fa
h: refs/heads/master
v: v3
  • Loading branch information
Frederic Weisbecker authored and Ingo Molnar committed Nov 4, 2008
1 parent 3fdc25a commit 3631b1f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 71566a0d161edec70361b7f90f6e54af6a6d5d05
refs/heads/master: 07695fa04e8a3384b0c855398ce1f7885bd7dc3b
5 changes: 5 additions & 0 deletions trunk/kernel/trace/trace_sched_switch.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
static struct trace_array *ctx_trace;
static int __read_mostly tracer_enabled;
static atomic_t sched_ref;
static DEFINE_MUTEX(tracepoint_mutex);

static void
probe_sched_switch(struct rq *__rq, struct task_struct *prev,
Expand Down Expand Up @@ -125,18 +126,22 @@ static void tracing_start_sched_switch(void)
{
long ref;

mutex_lock(&tracepoint_mutex);
ref = atomic_inc_return(&sched_ref);
if (ref == 1)
tracing_sched_register();
mutex_unlock(&tracepoint_mutex);
}

static void tracing_stop_sched_switch(void)
{
long ref;

mutex_lock(&tracepoint_mutex);
ref = atomic_dec_and_test(&sched_ref);
if (ref)
tracing_sched_unregister();
mutex_unlock(&tracepoint_mutex);
}

void tracing_start_cmdline_record(void)
Expand Down

0 comments on commit 3631b1f

Please sign in to comment.