Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 210351
b: refs/heads/master
c: fa66f07
h: refs/heads/master
i:
  210349: 880646e
  210347: 2c6ec2e
  210343: 2ad3c80
  210335: 1a1c134
v: v3
  • Loading branch information
Stephane Eranian authored and Ingo Molnar committed Aug 30, 2010
1 parent f84168b commit 0de7f98
Show file tree
Hide file tree
Showing 2 changed files with 23 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: 5225c45899e872383ca39f5533d28ec63c54b39e
refs/heads/master: fa66f07aa1f0950e1dc78b7ab39728b3f8aa77a1
26 changes: 22 additions & 4 deletions trunk/kernel/perf_event.c
Original file line number Diff line number Diff line change
Expand Up @@ -402,11 +402,31 @@ static void perf_group_detach(struct perf_event *event)
}
}

static inline int
event_filter_match(struct perf_event *event)
{
return event->cpu == -1 || event->cpu == smp_processor_id();
}

static void
event_sched_out(struct perf_event *event,
struct perf_cpu_context *cpuctx,
struct perf_event_context *ctx)
{
u64 delta;
/*
* An event which could not be activated because of
* filter mismatch still needs to have its timings
* maintained, otherwise bogus information is return
* via read() for time_enabled, time_running:
*/
if (event->state == PERF_EVENT_STATE_INACTIVE
&& !event_filter_match(event)) {
delta = ctx->time - event->tstamp_stopped;
event->tstamp_running += delta;
event->tstamp_stopped = ctx->time;
}

if (event->state != PERF_EVENT_STATE_ACTIVE)
return;

Expand All @@ -432,9 +452,7 @@ group_sched_out(struct perf_event *group_event,
struct perf_event_context *ctx)
{
struct perf_event *event;

if (group_event->state != PERF_EVENT_STATE_ACTIVE)
return;
int state = group_event->state;

event_sched_out(group_event, cpuctx, ctx);

Expand All @@ -444,7 +462,7 @@ group_sched_out(struct perf_event *group_event,
list_for_each_entry(event, &group_event->sibling_list, group_entry)
event_sched_out(event, cpuctx, ctx);

if (group_event->attr.exclusive)
if (state == PERF_EVENT_STATE_ACTIVE && group_event->attr.exclusive)
cpuctx->exclusive = 0;
}

Expand Down

0 comments on commit 0de7f98

Please sign in to comment.