aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/cpu
diff options
context:
space:
mode:
authorAvi Kivity <avi@redhat.com>2011-06-29 11:42:36 -0400
committerIngo Molnar <mingo@elte.hu>2011-07-01 05:06:39 -0400
commit0af3ac1fdb9d5c297b4b07c9e0172531d42b6716 (patch)
treefb32f768bce1c3bd8772d52d87d30ab63d2ebaaa /arch/x86/kernel/cpu
parent4dc0da86967d5463708631d02a70cfed5b104884 (diff)
x86, perf: Add constraints for architectural PMU
The v1 PMU does not have any fixed counters. Using the v2 constraints, which do have fixed counters, causes an additional choice to be present in the weight calculation, but not when actually scheduling the event, leading to an event being not scheduled at all. Signed-off-by: Avi Kivity <avi@redhat.com> Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl> Link: http://lkml.kernel.org/r/1309362157-6596-3-git-send-email-avi@redhat.com Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch/x86/kernel/cpu')
-rw-r--r--arch/x86/kernel/cpu/perf_event_intel.c23
1 files changed, 18 insertions, 5 deletions
diff --git a/arch/x86/kernel/cpu/perf_event_intel.c b/arch/x86/kernel/cpu/perf_event_intel.c
index bf6f92f7c19d..45fbb8f7f549 100644
--- a/arch/x86/kernel/cpu/perf_event_intel.c
+++ b/arch/x86/kernel/cpu/perf_event_intel.c
@@ -112,6 +112,11 @@ static struct extra_reg intel_westmere_extra_regs[] __read_mostly =
112 EVENT_EXTRA_END 112 EVENT_EXTRA_END
113}; 113};
114 114
115static struct event_constraint intel_v1_event_constraints[] __read_mostly =
116{
117 EVENT_CONSTRAINT_END
118};
119
115static struct event_constraint intel_gen_event_constraints[] __read_mostly = 120static struct event_constraint intel_gen_event_constraints[] __read_mostly =
116{ 121{
117 FIXED_EVENT_CONSTRAINT(0x00c0, 0), /* INST_RETIRED.ANY */ 122 FIXED_EVENT_CONSTRAINT(0x00c0, 0), /* INST_RETIRED.ANY */
@@ -1606,11 +1611,19 @@ static __init int intel_pmu_init(void)
1606 break; 1611 break;
1607 1612
1608 default: 1613 default:
1609 /* 1614 switch (x86_pmu.version) {
1610 * default constraints for v2 and up 1615 case 1:
1611 */ 1616 x86_pmu.event_constraints = intel_v1_event_constraints;
1612 x86_pmu.event_constraints = intel_gen_event_constraints; 1617 pr_cont("generic architected perfmon v1, ");
1613 pr_cont("generic architected perfmon, "); 1618 break;
1619 default:
1620 /*
1621 * default constraints for v2 and up
1622 */
1623 x86_pmu.event_constraints = intel_gen_event_constraints;
1624 pr_cont("generic architected perfmon, ");
1625 break;
1626 }
1614 } 1627 }
1615 return 0; 1628 return 0;
1616} 1629}