Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 169723
b: refs/heads/master
c: 2b8988c
h: refs/heads/master
i:
  169721: 327b65d
  169719: 655bc99
v: v3
  • Loading branch information
Peter Zijlstra authored and Ingo Molnar committed Nov 21, 2009
1 parent 9d3eea5 commit 1d1ae69
Show file tree
Hide file tree
Showing 2 changed files with 10 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: 58e5ad1de3d6ad931c84f0cc8ef0655c922f30ad
refs/heads/master: 2b8988c9f7defe319cffe0cd362a7cd356c86f62
9 changes: 9 additions & 0 deletions trunk/kernel/perf_event.c
Original file line number Diff line number Diff line change
Expand Up @@ -1526,8 +1526,11 @@ static void __perf_event_read(void *info)
if (ctx->task && cpuctx->task_ctx != ctx)
return;

spin_lock(&ctx->lock);
update_context_time(ctx);
update_event_times(event);
spin_unlock(&ctx->lock);

event->pmu->read(event);
}

Expand All @@ -1541,7 +1544,13 @@ static u64 perf_event_read(struct perf_event *event)
smp_call_function_single(event->oncpu,
__perf_event_read, event, 1);
} else if (event->state == PERF_EVENT_STATE_INACTIVE) {
struct perf_event_context *ctx = event->ctx;
unsigned long flags;

spin_lock_irqsave(&ctx->lock, flags);
update_context_time(ctx);
update_event_times(event);
spin_unlock_irqrestore(&ctx->lock, flags);
}

return atomic64_read(&event->count);
Expand Down

0 comments on commit 1d1ae69

Please sign in to comment.