lkml.org 
[lkml]   [2015]   [Aug]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH v2 6/6] perf/x86/intel/bts: Use extended error reporting in event initialization
Date
If intel_bts events would conflict with other events that are active in
the system, provide an extended error message to the user along with the
usual EBUSY.

Signed-off-by: Alexander Shishkin <alexander.shishkin@linux.intel.com>
---
arch/x86/kernel/cpu/perf_event_intel_bts.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/arch/x86/kernel/cpu/perf_event_intel_bts.c b/arch/x86/kernel/cpu/perf_event_intel_bts.c
index 54690e8857..c6a8da8f5a 100644
--- a/arch/x86/kernel/cpu/perf_event_intel_bts.c
+++ b/arch/x86/kernel/cpu/perf_event_intel_bts.c
@@ -16,6 +16,8 @@

#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt

+#define PERF_MODNAME "perf/x86/intel/bts"
+
#include <linux/bitops.h>
#include <linux/types.h>
#include <linux/slab.h>
@@ -492,7 +494,7 @@ static int bts_event_init(struct perf_event *event)
return -ENOENT;

if (x86_add_exclusive(x86_lbr_exclusive_bts))
- return -EBUSY;
+ return perf_err(-EBUSY, "BTS conflicts with active events");

ret = x86_reserve_hardware();
if (ret) {
--
2.5.0


\
 
 \ /
  Last update: 2015-08-24 17:01    [W:0.341 / U:0.256 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site