From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752783AbcFCLCa (ORCPT ); Fri, 3 Jun 2016 07:02:30 -0400 Received: from terminus.zytor.com ([198.137.202.10]:56392 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932176AbcFCKyH (ORCPT ); Fri, 3 Jun 2016 06:54:07 -0400 Date: Fri, 3 Jun 2016 03:52:18 -0700 From: tip-bot for Vineet Gupta Message-ID: Cc: linux-snps-arc@lists.infradead.org, peterz@infradead.org, jolsa@redhat.com, alexander.shishkin@linux.intel.com, hpa@zytor.com, tglx@linutronix.de, Vineet.Gupta1@synopsys.com, torvalds@linux-foundation.org, mingo@kernel.org, eranian@google.com, vincent.weaver@maine.edu, linux-kernel@vger.kernel.org, vgupta@synopsys.com, acme@redhat.com Reply-To: tglx@linutronix.de, alexander.shishkin@linux.intel.com, hpa@zytor.com, eranian@google.com, mingo@kernel.org, Vineet.Gupta1@synopsys.com, torvalds@linux-foundation.org, peterz@infradead.org, linux-snps-arc@lists.infradead.org, jolsa@redhat.com, acme@redhat.com, vincent.weaver@maine.edu, vgupta@synopsys.com, linux-kernel@vger.kernel.org In-Reply-To: <1462786660-2900-2-git-send-email-vgupta@synopsys.com> References: <1462786660-2900-2-git-send-email-vgupta@synopsys.com> To: linux-tip-commits@vger.kernel.org Subject: [tip:perf/core] tools/perf: Handle -EOPNOTSUPP for sampling events Git-Commit-ID: dc89e75a9412db5b1105a140182ec1e35a8351b4 X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: dc89e75a9412db5b1105a140182ec1e35a8351b4 Gitweb: http://git.kernel.org/tip/dc89e75a9412db5b1105a140182ec1e35a8351b4 Author: Vineet Gupta AuthorDate: Mon, 9 May 2016 15:07:39 +0530 Committer: Ingo Molnar CommitDate: Fri, 3 Jun 2016 09:41:11 +0200 tools/perf: Handle -EOPNOTSUPP for sampling events This allows (with a previous change to the perf error return ABI) for calling out in userspace the exact reason for perf record failing when PMU doesn't support overflow interrupts. Note that this needs to be put ahead of existing precise_ip check as that gets hit otherwise for the sampling fail case as well. Signed-off-by: Vineet Gupta Signed-off-by: Peter Zijlstra (Intel) Cc: Cc: Cc: Cc: Alexander Shishkin Cc: Arnaldo Carvalho de Melo Cc: Jiri Olsa Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Stephane Eranian Cc: Thomas Gleixner Cc: Vince Weaver Cc: Vineet Gupta Link: http://lkml.kernel.org/r/1462786660-2900-2-git-send-email-vgupta@synopsys.com Signed-off-by: Ingo Molnar --- tools/perf/util/evsel.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tools/perf/util/evsel.c b/tools/perf/util/evsel.c index 245ac50..8d30cbd 100644 --- a/tools/perf/util/evsel.c +++ b/tools/perf/util/evsel.c @@ -2384,6 +2384,9 @@ int perf_evsel__open_strerror(struct perf_evsel *evsel, struct target *target, "No such device - did you specify an out-of-range profile CPU?"); break; case EOPNOTSUPP: + if (evsel->attr.sample_period != 0) + return scnprintf(msg, size, "%s", + "PMU Hardware doesn't support sampling/overflow-interrupts."); if (evsel->attr.precise_ip) return scnprintf(msg, size, "%s", "\'precise\' request may not be supported. Try removing 'p' modifier.");