Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 147444
b: refs/heads/master
c: a08b159
h: refs/heads/master
v: v3
  • Loading branch information
Paul Mackerras authored and Ingo Molnar committed May 11, 2009
1 parent df64c3e commit 3335776
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 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: 6751b71ea2c7ab8c0d65f01973a3fc8ea16992f4
refs/heads/master: a08b159fc243dbfe415250466d24cfc5010deee5
16 changes: 11 additions & 5 deletions trunk/kernel/perf_counter.c
Original file line number Diff line number Diff line change
Expand Up @@ -837,6 +837,14 @@ void perf_counter_task_sched_out(struct task_struct *task, int cpu)
cpuctx->task_ctx = NULL;
}

static void __perf_counter_task_sched_out(struct perf_counter_context *ctx)
{
struct perf_cpu_context *cpuctx = &__get_cpu_var(perf_cpu_context);

__perf_counter_sched_out(ctx, cpuctx);
cpuctx->task_ctx = NULL;
}

static void perf_counter_cpu_sched_out(struct perf_cpu_context *cpuctx)
{
__perf_counter_sched_out(&cpuctx->ctx, cpuctx);
Expand Down Expand Up @@ -943,15 +951,13 @@ int perf_counter_task_disable(void)
struct perf_counter *counter;
unsigned long flags;
u64 perf_flags;
int cpu;

if (likely(!ctx->nr_counters))
return 0;

local_irq_save(flags);
cpu = smp_processor_id();

perf_counter_task_sched_out(curr, cpu);
__perf_counter_task_sched_out(ctx);

spin_lock(&ctx->lock);

Expand Down Expand Up @@ -989,7 +995,7 @@ int perf_counter_task_enable(void)
local_irq_save(flags);
cpu = smp_processor_id();

perf_counter_task_sched_out(curr, cpu);
__perf_counter_task_sched_out(ctx);

spin_lock(&ctx->lock);

Expand Down Expand Up @@ -1054,7 +1060,7 @@ void perf_counter_task_tick(struct task_struct *curr, int cpu)
ctx = &curr->perf_counter_ctx;

perf_counter_cpu_sched_out(cpuctx);
perf_counter_task_sched_out(curr, cpu);
__perf_counter_task_sched_out(ctx);

rotate_ctx(&cpuctx->ctx);
rotate_ctx(ctx);
Expand Down

0 comments on commit 3335776

Please sign in to comment.