Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753127AbcD0PN5 (ORCPT ); Wed, 27 Apr 2016 11:13:57 -0400 Received: from smtprelay4.synopsys.com ([198.182.47.9]:59035 "EHLO smtprelay.synopsys.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752615AbcD0PNz (ORCPT ); Wed, 27 Apr 2016 11:13:55 -0400 From: Lada Trimasova To: "linux-perf-users@vger.kernel.org" CC: "linux-kernel@vger.kernel.org" , "peterz@infradead.org" , Alexey Brodkin , "linux-snps-arc@lists.infradead.org" Subject: Re: Misleading hint to select CONFIG_PERF_EVENTS if driver sets PERF_PMU_CAP_NO_INTERRUPT Thread-Topic: Misleading hint to select CONFIG_PERF_EVENTS if driver sets PERF_PMU_CAP_NO_INTERRUPT Thread-Index: AQHRnJpsTIMVptKVlEi1yzoTFOg9a5+d1BIA Date: Wed, 27 Apr 2016 15:13:50 +0000 Message-ID: <1461770030.5970.8.camel@synopsys.com> References: <1461331523.3403.11.camel@synopsys.com> In-Reply-To: Reply-To: Lada Trimasova Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.121.8.149] Content-Type: text/plain; charset="utf-8" Content-ID: <27C393F7879594458302245078D48E8D@internal.synopsys.com> MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from base64 to 8bit by mail.home.local id u3RFE24s018695 Content-Length: 1983 Lines: 60 On Tue, 2016-04-26 at 12:42 +0000, Vineet Gupta wrote: On Friday 22 April 2016 06:56 PM, Lada Trimasova wrote: I think what we have now is sufficient - but u seem to want a prettier failure output. Anyhow, this print is coming from util/evsel.c: perf_evsel__open_strerror() At the very least you want another entry in switch case for ENOTSUPP and then check if event was sampling one ( evsel->attr.sample_period) - use that as a hint for saying sampling events not supported. ENOTSUPP is not visible for user programs. So it's impossible to add this entry to mentioned switch. I think that there is no good way to make error message more understandable without breaking existing api. But this will print the same even if CONFIG_PERF_EVENTS=n. To really fix this you would want to change the error code returned by SYSCALL_DEFINE5(perf_event_open for PERF_PMU_CAP_NO_INTERRUPT to say -EOPNOTSUPP and use the sample_period to say this was for samplign events! However this is an ABI change and might not be acceptable as some existing scripts etc might break. /bin/dmesg may provide additional information. No CONFIG_PERF_EVENTS=y kernel support configured? --------------------------------->8----------------------------------- As you can see the root cause of this error message is not obvious. CONFIG_PERF_EVENTS is selected but still there's a problem while existing suggestion barely makes any sense. So probably there could be a way to determine if CONFIG_PERF_EVENTS was selected or not. I am not sure about the correct way of solving this problem. Maybe I should add some checks of syscalls return values and give user a warning when not PMU interrupts are available. Any suggestions are appreciated. Regards, Lada Trimasova. _______________________________________________ linux-snps-arc mailing list linux-snps-arc@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-snps-arc Regards, Lada.