diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2015-06-22 15:45:41 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2015-06-22 15:45:41 -0700 |
commit | 6bc4c3ad3619e1bcb4a6330e030007ace8ca465e (patch) | |
tree | dda9505c22e85417ee752ef90ff7848126cca0f0 /arch/x86/kernel/cpu/perf_event_intel_bts.c | |
parent | c58267e9fa7b0345dd9006939254701e3622ca6a (diff) | |
parent | 0f02adaa49af23ab9fa05375f4a237da6014401b (diff) | |
download | linux-6bc4c3ad3619e1bcb4a6330e030007ace8ca465e.tar.gz linux-6bc4c3ad3619e1bcb4a6330e030007ace8ca465e.tar.bz2 linux-6bc4c3ad3619e1bcb4a6330e030007ace8ca465e.zip |
Merge branch 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull perf fixes from Ingo Molnar:
"These are the left over fixes from the v4.1 cycle"
* 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
perf tools: Fix build breakage if prefix= is specified
perf/x86: Honor the architectural performance monitoring version
perf/x86/intel: Fix PMI handling for Intel PT
perf/x86/intel/bts: Fix DS area sharing with x86_pmu events
perf/x86: Add more Broadwell model numbers
perf: Fix ring_buffer_attach() RCU sync, again
Diffstat (limited to 'arch/x86/kernel/cpu/perf_event_intel_bts.c')
-rw-r--r-- | arch/x86/kernel/cpu/perf_event_intel_bts.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/arch/x86/kernel/cpu/perf_event_intel_bts.c b/arch/x86/kernel/cpu/perf_event_intel_bts.c index ac1f0c55f379..7795f3f8b1d5 100644 --- a/arch/x86/kernel/cpu/perf_event_intel_bts.c +++ b/arch/x86/kernel/cpu/perf_event_intel_bts.c @@ -483,17 +483,26 @@ static int bts_event_add(struct perf_event *event, int mode) static void bts_event_destroy(struct perf_event *event) { + x86_release_hardware(); x86_del_exclusive(x86_lbr_exclusive_bts); } static int bts_event_init(struct perf_event *event) { + int ret; + if (event->attr.type != bts_pmu.type) return -ENOENT; if (x86_add_exclusive(x86_lbr_exclusive_bts)) return -EBUSY; + ret = x86_reserve_hardware(); + if (ret) { + x86_del_exclusive(x86_lbr_exclusive_bts); + return ret; + } + event->destroy = bts_event_destroy; return 0; |