From patchwork Fri Jun 3 10:52:18 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "tip-bot for Paul E. McKenney" X-Patchwork-Id: 629778 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2001:1868:205::9]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3rLjKm1HRJz9t7t for ; Fri, 3 Jun 2016 21:58:36 +1000 (AEST) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1b8nkG-0002c0-UR; Fri, 03 Jun 2016 11:58:32 +0000 Received: from casper.infradead.org ([2001:770:15f::2]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1b8mji-0002RM-F7 for linux-snps-arc@bombadil.infradead.org; Fri, 03 Jun 2016 10:53:54 +0000 Received: from [2001:1868:205::12] (helo=terminus.zytor.com) by casper.infradead.org with esmtps (Exim 4.85_2 #1 (Red Hat Linux)) id 1b8mjg-00077t-JZ for linux-snps-arc@lists.infradead.org; Fri, 03 Jun 2016 10:53:53 +0000 Received: from terminus.zytor.com (localhost [127.0.0.1]) by terminus.zytor.com (8.15.2/8.15.2) with ESMTP id u53AqI1v021051; Fri, 3 Jun 2016 03:52:23 -0700 Received: (from tipbot@localhost) by terminus.zytor.com (8.15.2/8.15.2/Submit) id u53AqIVU021048; Fri, 3 Jun 2016 03:52:18 -0700 Date: Fri, 3 Jun 2016 03:52:18 -0700 X-Authentication-Warning: terminus.zytor.com: tipbot set sender to tipbot@zytor.com using -f From: tip-bot for Vineet Gupta Message-ID: 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-Disposition: inline Precedence: bulk X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00 autolearn=ham autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on terminus.zytor.com X-Bad-Reply: References and In-Reply-To but no 'Re:' in Subject. X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160603_115352_990882_6FA8A14C X-CRM114-Status: GOOD ( 11.29 ) X-Spam-Score: -1.1 (-) X-Spam-Report: SpamAssassin version 3.4.0 on casper.infradead.org summary: Content analysis details: (-1.1 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] 0.8 RDNS_NONE Delivered to internal network by a host with no rDNS X-Mailman-Approved-At: Fri, 03 Jun 2016 04:58:32 -0700 X-BeenThere: linux-snps-arc@lists.infradead.org X-Mailman-Version: 2.1.20 List-Id: Linux on Synopsys ARC Processors List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , 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 Cc: vincent.weaver@maine.edu, peterz@infradead.org, torvalds@linux-foundation.org, Vineet.Gupta1@synopsys.com, linux-kernel@vger.kernel.org, eranian@google.com, acme@redhat.com, alexander.shishkin@linux.intel.com, vgupta@synopsys.com, hpa@zytor.com, tglx@linutronix.de, linux-snps-arc@lists.infradead.org, jolsa@redhat.com, mingo@kernel.org Sender: "linux-snps-arc" Errors-To: linux-snps-arc-bounces+incoming=patchwork.ozlabs.org@lists.infradead.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.");