Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 218637
b: refs/heads/master
c: d7842da
h: refs/heads/master
i:
  218635: 8ee6340
v: v3
  • Loading branch information
Stephane Eranian authored and Ingo Molnar committed Oct 22, 2010
1 parent 502f7b2 commit 8cf7556
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 3 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: 9ffcfa6f1f63eeac15555b745c292eb9f59130f6
refs/heads/master: d7842da470f244d258f21c5f72cd8388b3541d04
22 changes: 20 additions & 2 deletions trunk/kernel/perf_event.c
Original file line number Diff line number Diff line change
Expand Up @@ -691,6 +691,8 @@ group_sched_in(struct perf_event *group_event,
{
struct perf_event *event, *partial_group = NULL;
struct pmu *pmu = group_event->pmu;
u64 now = ctx->time;
bool simulate = false;

if (group_event->state == PERF_EVENT_STATE_OFF)
return 0;
Expand Down Expand Up @@ -719,11 +721,27 @@ group_sched_in(struct perf_event *group_event,
/*
* Groups can be scheduled in as one unit only, so undo any
* partial group before returning:
* The events up to the failed event are scheduled out normally,
* tstamp_stopped will be updated.
*
* The failed events and the remaining siblings need to have
* their timings updated as if they had gone thru event_sched_in()
* and event_sched_out(). This is required to get consistent timings
* across the group. This also takes care of the case where the group
* could never be scheduled by ensuring tstamp_stopped is set to mark
* the time the event was actually stopped, such that time delta
* calculation in update_event_times() is correct.
*/
list_for_each_entry(event, &group_event->sibling_list, group_entry) {
if (event == partial_group)
break;
event_sched_out(event, cpuctx, ctx);
simulate = true;

if (simulate) {
event->tstamp_running += now - event->tstamp_stopped;
event->tstamp_stopped = now;
} else {
event_sched_out(event, cpuctx, ctx);
}
}
event_sched_out(group_event, cpuctx, ctx);

Expand Down

0 comments on commit 8cf7556

Please sign in to comment.