Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 288618
b: refs/heads/master
c: fe4a330
h: refs/heads/master
v: v3
  • Loading branch information
Peter Zijlstra authored and Ingo Molnar committed Dec 21, 2011
1 parent e869159 commit 297b10d
Show file tree
Hide file tree
Showing 2 changed files with 16 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: 365a4038486b57bb2bd516706a80f82f250f5306
refs/heads/master: fe4a330885aee20f233de36085fb15c38094e635
15 changes: 15 additions & 0 deletions trunk/arch/x86/kernel/cpu/perf_event.c
Original file line number Diff line number Diff line change
Expand Up @@ -1210,6 +1210,7 @@ x86_pmu_notifier(struct notifier_block *self, unsigned long action, void *hcpu)
break;

case CPU_STARTING:
set_in_cr4(X86_CR4_PCE);
if (x86_pmu.cpu_starting)
x86_pmu.cpu_starting(cpu);
break;
Expand Down Expand Up @@ -1542,6 +1543,18 @@ static int x86_pmu_event_init(struct perf_event *event)
return err;
}

static int x86_pmu_event_idx(struct perf_event *event)
{
int idx = event->hw.idx;

if (x86_pmu.num_counters_fixed && idx >= X86_PMC_IDX_FIXED) {
idx -= X86_PMC_IDX_FIXED;
idx |= 1 << 30;
}

return idx + 1;
}

static struct pmu pmu = {
.pmu_enable = x86_pmu_enable,
.pmu_disable = x86_pmu_disable,
Expand All @@ -1557,6 +1570,8 @@ static struct pmu pmu = {
.start_txn = x86_pmu_start_txn,
.cancel_txn = x86_pmu_cancel_txn,
.commit_txn = x86_pmu_commit_txn,

.event_idx = x86_pmu_event_idx,
};

/*
Expand Down

0 comments on commit 297b10d

Please sign in to comment.