Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 156948
b: refs/heads/master
c: e1ac361
h: refs/heads/master
v: v3
  • Loading branch information
Paul Mackerras authored and Ingo Molnar committed Aug 17, 2009
1 parent f6abb7c commit ff1b2af
Show file tree
Hide file tree
Showing 2 changed files with 12 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: 2932cffc89e9a1476b28a59896fa4f81e0d4f131
refs/heads/master: e1ac3614ff606ae03677f47459113f98a19af63c
11 changes: 11 additions & 0 deletions trunk/kernel/perf_counter.c
Original file line number Diff line number Diff line change
Expand Up @@ -1503,10 +1503,21 @@ static void perf_counter_enable_on_exec(struct task_struct *task)
*/
static void __perf_counter_read(void *info)
{
struct perf_cpu_context *cpuctx = &__get_cpu_var(perf_cpu_context);
struct perf_counter *counter = info;
struct perf_counter_context *ctx = counter->ctx;
unsigned long flags;

/*
* If this is a task context, we need to check whether it is
* the current task context of this cpu. If not it has been
* scheduled out before the smp call arrived. In that case
* counter->count would have been updated to a recent sample
* when the counter was scheduled out.
*/
if (ctx->task && cpuctx->task_ctx != ctx)
return;

local_irq_save(flags);
if (ctx->is_active)
update_context_time(ctx);
Expand Down

0 comments on commit ff1b2af

Please sign in to comment.