Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1191748
| Path | csiph.com!aioe.org!bofh.it!news.nic.it!robomod |
|---|---|
| From | Alexander Shishkin <alexander.shishkin@linux.intel.com> |
| Newsgroups | linux.kernel |
| Subject | [PATCH RFC v1 4/4] perf/x86: Annotate some of the error codes with perf_err() |
| Date | Fri, 24 Jul 2015 13:50:01 +0200 |
| Message-ID | <pPJEd-4HJ-19@gated-at.bofh.it> (permalink) |
| References | <pPJEd-4HJ-21@gated-at.bofh.it> |
| X-Original-To | Peter Zijlstra <a.p.zijlstra@chello.nl>, Ingo Molnar <mingo@redhat.com> |
| X-Extloop1 | 1 |
| X-Ironport-Av | E=Sophos;i="5.15,538,1432623600"; d="scan'208";a="770449732" |
| X-Mailer | git-send-email 2.1.4 |
| Sender | robomod@news.nic.it |
| List-ID | <linux-kernel.vger.kernel.org> |
| X-Mailing-List | linux-kernel@vger.kernel.org |
| Approved | robomod@news.nic.it |
| Lines | 59 |
| Organization | linux.* mail to news gateway |
| X-Original-Cc | linux-kernel@vger.kernel.org, adrian.hunter@intel.com, Arnaldo Carvalho de Melo <acme@infradead.org>, Vince Weaver <vince@deater.net>, Stephane Eranian <eranian@google.com>, Alexander Shishkin <alexander.shishkin@linux.intel.com> |
| X-Original-Date | Fri, 24 Jul 2015 14:45:59 +0300 |
| X-Original-Message-ID | <1437738359-23920-5-git-send-email-alexander.shishkin@linux.intel.com> |
| X-Original-References | <1437738359-23920-1-git-send-email-alexander.shishkin@linux.intel.com> |
| X-Original-Sender | linux-kernel-owner@vger.kernel.org |
| Xref | aioe.org linux.kernel:1191748 |
Show key headers only | View raw
This patch annotates a few x86-specific error paths with perf's extended error reporting facility. NYet-Signed-off-by: Alexander Shishkin <alexander.shishkin@linux.intel.com> --- arch/x86/kernel/cpu/perf_event.c | 8 ++++++-- arch/x86/kernel/cpu/perf_event_intel_lbr.c | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/arch/x86/kernel/cpu/perf_event.c b/arch/x86/kernel/cpu/perf_event.c index 3658de4790..2b22e57100 100644 --- a/arch/x86/kernel/cpu/perf_event.c +++ b/arch/x86/kernel/cpu/perf_event.c @@ -12,6 +12,8 @@ * For licencing details see kernel-base/COPYING */ +#define PERF_MODNAME "perf/x86" + #include <linux/perf_event.h> #include <linux/capability.h> #include <linux/notifier.h> @@ -426,11 +428,13 @@ int x86_setup_perfctr(struct perf_event *event) /* BTS is currently only allowed for user-mode. */ if (!attr->exclude_kernel) - return -EOPNOTSUPP; + return perf_err(-EOPNOTSUPP, + "BTS sampling not allowed for kernel space"); /* disallow bts if conflicting events are present */ if (x86_add_exclusive(x86_lbr_exclusive_lbr)) - return -EBUSY; + return perf_err(-EBUSY, + "LBR conflicts with active events"); event->destroy = hw_perf_lbr_event_destroy; } diff --git a/arch/x86/kernel/cpu/perf_event_intel_lbr.c b/arch/x86/kernel/cpu/perf_event_intel_lbr.c index 452a7bd2de..b004fb310f 100644 --- a/arch/x86/kernel/cpu/perf_event_intel_lbr.c +++ b/arch/x86/kernel/cpu/perf_event_intel_lbr.c @@ -577,7 +577,7 @@ int intel_pmu_setup_lbr_filter(struct perf_event *event) * no LBR on this PMU */ if (!x86_pmu.lbr_nr) - return -EOPNOTSUPP; + return perf_err(-EOPNOTSUPP, "LBR is not supported by this cpu"); /* * setup SW LBR filter -- 2.1.4 -- 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/
Back to linux.kernel | Previous | Next | Find similar | Unroll thread
[PATCH RFC v1 4/4] perf/x86: Annotate some of the error codes with perf_err() Alexander Shishkin <alexander.shishkin@linux.intel.com> - 2015-07-24 13:50 +0200
csiph-web