From patchwork Fri Jun 3 10:51:53 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: 629777 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 3rLjKm1FZ4z9t6g 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-0002br-Pe; 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 1b8mje-0002Qf-0O for linux-snps-arc@bombadil.infradead.org; Fri, 03 Jun 2016 10:53:50 +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 1b8mjb-00077j-JM for linux-snps-arc@lists.infradead.org; Fri, 03 Jun 2016 10:53:49 +0000 Received: from terminus.zytor.com (localhost [127.0.0.1]) by terminus.zytor.com (8.15.2/8.15.2) with ESMTP id u53ApsvN021003; Fri, 3 Jun 2016 03:51:59 -0700 Received: (from tipbot@localhost) by terminus.zytor.com (8.15.2/8.15.2/Submit) id u53AprGA020995; Fri, 3 Jun 2016 03:51:53 -0700 Date: Fri, 3 Jun 2016 03:51:53 -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-3-git-send-email-vgupta@synopsys.com> References: <1462786660-2900-3-git-send-email-vgupta@synopsys.com> To: linux-tip-commits@vger.kernel.org Subject: [tip:perf/core] perf/abi: Change the errno for sampling event not supported in hardware Git-Commit-ID: a1396555abff9ff9b74c2e4da13e27e81fd094b2 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_115347_979657_243E88D5 X-CRM114-Status: GOOD ( 12.00 ) 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: acme@redhat.com, Vineet.Gupta1@synopsys.com, vgupta@synopsys.com, peterz@infradead.org, linux-snps-arc@lists.infradead.org, eranian@google.com, tglx@linutronix.de, vincent.weaver@maine.edu, jolsa@redhat.com, alexander.shishkin@linux.intel.com, linux-kernel@vger.kernel.org, torvalds@linux-foundation.org, hpa@zytor.com, mingo@kernel.org Cc: jolsa@redhat.com, vincent.weaver@maine.edu, peterz@infradead.org, vgupta@synopsys.com, Vineet.Gupta1@synopsys.com, linux-kernel@vger.kernel.org, eranian@google.com, acme@redhat.com, alexander.shishkin@linux.intel.com, hpa@zytor.com, tglx@linutronix.de, linux-snps-arc@lists.infradead.org, torvalds@linux-foundation.org, mingo@kernel.org Sender: "linux-snps-arc" Errors-To: linux-snps-arc-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org Commit-ID: a1396555abff9ff9b74c2e4da13e27e81fd094b2 Gitweb: http://git.kernel.org/tip/a1396555abff9ff9b74c2e4da13e27e81fd094b2 Author: Vineet Gupta AuthorDate: Mon, 9 May 2016 15:07:40 +0530 Committer: Ingo Molnar CommitDate: Fri, 3 Jun 2016 09:40:42 +0200 perf/abi: Change the errno for sampling event not supported in hardware Change the return code for sampling event not supported from -ENOTSUPP to -EOPNOTSUPP. This allows userspace to identify this case specifically, instead of printing the catch-all error message it did previously. Technically this is an ABI change, but we think we can get away with it. Old behavior: ------- | # perf record ls | Error: | The sys_perf_event_open() syscall returned with 524 (Unknown error 524) | for event (cycles:ppp). | /bin/dmesg may provide additional information. | No CONFIG_PERF_EVENTS=y kernel support configured? New behavior: ------- | # perf record ls | Error: | PMU Hardware doesn't support sampling/overflow-interrupts. 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-3-git-send-email-vgupta@synopsys.com Signed-off-by: Ingo Molnar --- kernel/events/core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/events/core.c b/kernel/events/core.c index f94f164..5d48306 100644 --- a/kernel/events/core.c +++ b/kernel/events/core.c @@ -9309,7 +9309,7 @@ SYSCALL_DEFINE5(perf_event_open, if (is_sampling_event(event)) { if (event->pmu->capabilities & PERF_PMU_CAP_NO_INTERRUPT) { - err = -ENOTSUPP; + err = -EOPNOTSUPP; goto err_alloc; } }