From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756714AbcEENVc (ORCPT ); Thu, 5 May 2016 09:21:32 -0400 Received: from smtprelay.synopsys.com ([198.182.60.111]:46968 "EHLO smtprelay.synopsys.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752622AbcEENV1 (ORCPT ); Thu, 5 May 2016 09:21:27 -0400 Subject: Re: Misleading hint to select CONFIG_PERF_EVENTS if driver sets PERF_PMU_CAP_NO_INTERRUPT To: Vineet Gupta , Lada Trimasova , "linux-perf-users@vger.kernel.org" References: <1461331523.3403.11.camel@synopsys.com> CC: "peterz@infradead.org" , "linux-snps-arc@lists.infradead.org" , Alexey Brodkin , "linux-kernel@vger.kernel.org" , Arnaldo Carvalho de Melo , Vince Weaver , Will Deacon , Ingo Molnar From: Vineet Gupta Message-ID: <572B48C5.6090401@synopsys.com> Date: Thu, 5 May 2016 18:51:09 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.7.2 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.12.197.158] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tuesday 26 April 2016 06:12 PM, Vineet Gupta wrote: > On Friday 22 April 2016 06:56 PM, Lada Trimasova wrote: >> I have a question about user-space perf handling error numbers. >> The problem is that PMU interrupts are not supported in arc700 >> architecture and it is impossible to evaluate `perf record` command. >> In our perf implementation we set PERF_PMU_CAP_NO_INTERRUPT flag so >> core perf infrastructure knows we don't have interrupts. >> >> Kernel `sys_perf_event_open` handler checks if PMU interrupts are >> supported and returns ENOTSUPP (524) error code. >> I'd expect that perf implementation checks the return value of syscalls >> and gives the user understandable error message. >> But now I see: >> --------------------------------->8----------------------------------- >> # perf record ls >> 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? >> --------------------------------->8----------------------------------- Guys, is the ABI change for returning -EOPNOTSUPP vs. -ENOTSUPP for is_sampling_event() && (event->pmu->capabilities & PERF_PMU_CAP_NO_INTERRUPT) acceptable ? We could use this in userspace to print pretty rather than half cooked error msg above ! -Vineet