Pull perf fixes from Thomas Gleixner: "Three fixlets for perf: - add a missing NULL pointer check in the intel BTS driver - make BTS an exclusive PMU because BTS can only handle one event at a time - ensure that exclusive events are limited to one PMU so that several exclusive events can be scheduled on different PMU instances" * 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: perf/core: Limit matching exclusive events to one PMU perf/x86/intel/bts: Make it an exclusive PMU perf/x86/intel/bts: Make sure debug store is valid
Unified · Split
| @@ -455,7 +455,7 @@ int intel_bts_interrupt(void) · 454 unmodified lines | |||
| 455 | * The only surefire way of knowing if this NMI is ours is by checking | 455 | * The only surefire way of knowing if this NMI is ours is by checking |
| 456 | * the write ptr against the PMI threshold. | 456 | * the write ptr against the PMI threshold. |
| 457 | */ | 457 | */ |
| 458 | if (ds->bts_index >= ds->bts_interrupt_threshold) | 458 | if (ds && (ds->bts_index >= ds->bts_interrupt_threshold)) |
| 459 | handled = 1; | 459 | handled = 1; |
| 460 | 460 | ||
| 461 | /* | 461 | /* |
| @@ -584,7 +584,8 @@ static __init int bts_init(void) · 122 unmodified lines | |||
| 584 | if (!boot_cpu_has(X86_FEATURE_DTES64) || !x86_pmu.bts) | 584 | if (!boot_cpu_has(X86_FEATURE_DTES64) || !x86_pmu.bts) |
| 585 | return -ENODEV; | 585 | return -ENODEV; |
| 586 | 586 | ||
| 587 | bts_pmu.capabilities = PERF_PMU_CAP_AUX_NO_SG | PERF_PMU_CAP_ITRACE; | 587 | bts_pmu.capabilities = PERF_PMU_CAP_AUX_NO_SG | PERF_PMU_CAP_ITRACE | |
| 588 | PERF_PMU_CAP_EXCLUSIVE; | ||
| 588 | bts_pmu.task_ctx_nr = perf_sw_context; | 589 | bts_pmu.task_ctx_nr = perf_sw_context; |
| 589 | bts_pmu.event_init = bts_event_init; | 590 | bts_pmu.event_init = bts_event_init; |
| 590 | bts_pmu.add = bts_event_add; | 591 | bts_pmu.add = bts_event_add; |
| @@ -3929,7 +3929,7 @@ static void exclusive_event_destroy(struct perf_event *event) · 3928 unmodified lines | |||
| 3929 | 3929 | ||
| 3930 | static bool exclusive_event_match(struct perf_event *e1, struct perf_event *e2) | 3930 | static bool exclusive_event_match(struct perf_event *e1, struct perf_event *e2) |
| 3931 | { | 3931 | { |
| 3932 | if ((e1->pmu->capabilities & PERF_PMU_CAP_EXCLUSIVE) && | 3932 | if ((e1->pmu == e2->pmu) && |
| 3933 | (e1->cpu == e2->cpu || | 3933 | (e1->cpu == e2->cpu || |
| 3934 | e1->cpu == -1 || | 3934 | e1->cpu == -1 || |
| 3935 | e2->cpu == -1)) | 3935 | e2->cpu == -1)) |