aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86
diff options
context:
space:
mode:
authorVince Weaver <vincent.weaver@maine.edu>2014-05-16 17:18:07 -0400
committerIngo Molnar <mingo@kernel.org>2014-06-05 06:30:03 -0400
commitc184c980de30dc5f6fec4b281928aa6743708da9 (patch)
treece5c7a76858eaa1a902acfd2148c9cc72531edf3 /arch/x86
parentedcb4d3c36a6429caa03ddfeab4cbb153c7002b2 (diff)
perf/x86: Use common PMU interrupt disabled code
Make the x86 perf code use the new common PMU interrupt disabled code. Typically most x86 machines have working PMU interrupts, although some older p6-class machines had this problem. Signed-off-by: Vince Weaver <vincent.weaver@maine.edu> Signed-off-by: Peter Zijlstra <peterz@infradead.org> Cc: Arnaldo Carvalho de Melo <acme@kernel.org> Cc: Linus Torvalds <torvalds@linux-foundation.org> Link: http://lkml.kernel.org/r/alpine.DEB.2.10.1405161715560.11099@vincent-weaver-1.umelst.maine.edu Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'arch/x86')
-rw-r--r--arch/x86/kernel/cpu/perf_event.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/arch/x86/kernel/cpu/perf_event.c b/arch/x86/kernel/cpu/perf_event.c
index 32029e35f2b9..2bdfbff8a4f6 100644
--- a/arch/x86/kernel/cpu/perf_event.c
+++ b/arch/x86/kernel/cpu/perf_event.c
@@ -303,15 +303,6 @@ int x86_setup_perfctr(struct perf_event *event)
303 hwc->sample_period = x86_pmu.max_period; 303 hwc->sample_period = x86_pmu.max_period;
304 hwc->last_period = hwc->sample_period; 304 hwc->last_period = hwc->sample_period;
305 local64_set(&hwc->period_left, hwc->sample_period); 305 local64_set(&hwc->period_left, hwc->sample_period);
306 } else {
307 /*
308 * If we have a PMU initialized but no APIC
309 * interrupts, we cannot sample hardware
310 * events (user-space has to fall back and
311 * sample via a hrtimer based software event):
312 */
313 if (!x86_pmu.apic)
314 return -EOPNOTSUPP;
315 } 306 }
316 307
317 if (attr->type == PERF_TYPE_RAW) 308 if (attr->type == PERF_TYPE_RAW)
@@ -1367,6 +1358,15 @@ static void __init pmu_check_apic(void)
1367 x86_pmu.apic = 0; 1358 x86_pmu.apic = 0;
1368 pr_info("no APIC, boot with the \"lapic\" boot parameter to force-enable it.\n"); 1359 pr_info("no APIC, boot with the \"lapic\" boot parameter to force-enable it.\n");
1369 pr_info("no hardware sampling interrupt available.\n"); 1360 pr_info("no hardware sampling interrupt available.\n");
1361
1362 /*
1363 * If we have a PMU initialized but no APIC
1364 * interrupts, we cannot sample hardware
1365 * events (user-space has to fall back and
1366 * sample via a hrtimer based software event):
1367 */
1368 pmu.capabilities |= PERF_PMU_CAP_NO_INTERRUPT;
1369
1370} 1370}
1371 1371
1372static struct attribute_group x86_pmu_format_group = { 1372static struct attribute_group x86_pmu_format_group = {