diff options
-rw-r--r-- | arch/x86/kernel/cpu/perf_event.c | 18 |
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 | ||
1372 | static struct attribute_group x86_pmu_format_group = { | 1372 | static struct attribute_group x86_pmu_format_group = { |