Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754859AbbHXOfs (ORCPT ); Mon, 24 Aug 2015 10:35:48 -0400 Received: from mga11.intel.com ([192.55.52.93]:8081 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754798AbbHXOfq (ORCPT ); Mon, 24 Aug 2015 10:35:46 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.15,738,1432623600"; d="scan'208";a="547536207" From: Alexander Shishkin To: Peter Zijlstra , Ingo Molnar Cc: linux-kernel@vger.kernel.org, adrian.hunter@intel.com, Arnaldo Carvalho de Melo , Vince Weaver , Stephane Eranian , Johannes Berg , Alexander Shishkin Subject: [PATCH v2 6/6] perf/x86/intel/bts: Use extended error reporting in event initialization Date: Mon, 24 Aug 2015 17:33:00 +0300 Message-Id: <1440426780-27227-7-git-send-email-alexander.shishkin@linux.intel.com> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1440426780-27227-1-git-send-email-alexander.shishkin@linux.intel.com> References: <1440426780-27227-1-git-send-email-alexander.shishkin@linux.intel.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1287 Lines: 39 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 --- 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 #include #include @@ -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 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/