Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 188253
b: refs/heads/master
c: c08053e
h: refs/heads/master
i:
  188251: ae4908c
v: v3
  • Loading branch information
Peter Zijlstra authored and Ingo Molnar committed Mar 10, 2010
1 parent ad02555 commit ab53db1
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 14 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: 34538ee77b39a12702e0f4c3ed9e8fa2dd5eb92c
refs/heads/master: c08053e627d23490a03431285b78b7a5b617fbad
23 changes: 10 additions & 13 deletions trunk/arch/x86/kernel/cpu/perf_event.c
Original file line number Diff line number Diff line change
Expand Up @@ -785,6 +785,7 @@ static inline int match_prev_assignment(struct hw_perf_event *hwc,
hwc->last_tag == cpuc->tags[i];
}

static int x86_pmu_start(struct perf_event *event);
static void x86_pmu_stop(struct perf_event *event);

void hw_perf_enable(void)
Expand Down Expand Up @@ -833,20 +834,10 @@ void hw_perf_enable(void)
event = cpuc->event_list[i];
hwc = &event->hw;

if (hwc->idx == -1) {
if (hwc->idx == -1)
x86_assign_hw_event(event, cpuc, i);
x86_perf_event_set_period(event);
}
/*
* need to mark as active because x86_pmu_disable()
* clear active_mask and events[] yet it preserves
* idx
*/
__set_bit(hwc->idx, cpuc->active_mask);
cpuc->events[hwc->idx] = event;

x86_pmu.enable(event);
perf_event_update_userpage(event);
x86_pmu_start(event);
}
cpuc->n_added = 0;
perf_events_lapic_init();
Expand Down Expand Up @@ -975,11 +966,17 @@ static int x86_pmu_enable(struct perf_event *event)

static int x86_pmu_start(struct perf_event *event)
{
if (event->hw.idx == -1)
struct cpu_hw_events *cpuc = &__get_cpu_var(cpu_hw_events);
int idx = event->hw.idx;

if (idx == -1)
return -EAGAIN;

x86_perf_event_set_period(event);
cpuc->events[idx] = event;
__set_bit(idx, cpuc->active_mask);
x86_pmu.enable(event);
perf_event_update_userpage(event);

return 0;
}
Expand Down

0 comments on commit ab53db1

Please sign in to comment.