From patchwork Tue Oct 24 08:04:08 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kim Phillips X-Patchwork-Id: 10023629 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 2EE2860381 for ; Tue, 24 Oct 2017 08:13:39 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2282B28757 for ; Tue, 24 Oct 2017 08:13:39 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1733A289AC; Tue, 24 Oct 2017 08:13:39 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 92CE128757 for ; Tue, 24 Oct 2017 08:13:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Mime-Version:Message-Id:Subject:To:From :Date:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=owU86QRNWP33KkgXKE2OV49QJpSw15Xtby7TinmLBXY=; b=Vog5tCGvYaZN1X nDMJNZfWdyv/IGMYq+npWX0La5+/VSMD9/KW0hR7xC/eqSVJSFB5Zg80ZVPSM4kXBB0XS8UCGCoLW Bj02gVllFkLP/Uzsg0wyaSq88lCvSS0r7+WSbHsS2nmds/0lVxHMZoF+rdWZAOPi0m7V0Vg/8HBxo vK34nbqCJbWNaE/iVUG7EkR+yGR8A8KQQTicr3SJB1KB8UJiYiztV0A7C3y9Gv5W85SiInEdxKcGR JuERZ0V12Qk5bkSPqbqaE8MTCtV+gekbFwBfzg3KkDsS45ZAzTw6YA5OmSwoveI8hUYPk4vpY8naK 9PxwN5vcl5GgoNBSZI1Q==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1e6uLB-0005t7-RZ; Tue, 24 Oct 2017 08:13:37 +0000 Received: from foss.arm.com ([217.140.101.70]) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1e6uCK-0000mP-4A for linux-arm-kernel@lists.infradead.org; Tue, 24 Oct 2017 08:04:33 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 1B46E1596; Tue, 24 Oct 2017 01:04:11 -0700 (PDT) Received: from dupont (usa-sjc-mx-foss1.foss.arm.com [217.140.101.70]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id D689D3F3E1; Tue, 24 Oct 2017 01:04:09 -0700 (PDT) Date: Tue, 24 Oct 2017 03:04:08 -0500 From: Kim Phillips To: Arnaldo Carvalho de Melo Subject: [RFC 2/3] perf tool: stat: say more about why event is not supported by the kernel Message-Id: <20171024030408.d29c81d6134bf63df18ae618@arm.com> Organization: Arm X-Mailer: Sylpheed 3.5.1 (GTK+ 2.24.31; x86_64-pc-linux-gnu) Mime-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20171024_010428_177473_8C4A56D8 X-CRM114-Status: GOOD ( 10.01 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: mark.rutland@arm.com, robh@kernel.org, mathieu.poirier@linaro.org, pawel.moll@arm.com, suzuki.poulose@arm.com, marc.zyngier@arm.com, Will Deacon , linux-kernel@vger.kernel.org, alexander.shishkin@linux.intel.com, peterz@infradead.org, mingo@redhat.com, tglx@linutronix.de, linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Call perf_evsel__open_strerror() to potentially expand upon why the event was "not supported by the kernel." See the enhanced '-v' example output messages in the next patch. Signed-off-by: Kim Phillips --- tools/perf/builtin-stat.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tools/perf/builtin-stat.c b/tools/perf/builtin-stat.c index 69523ed55894..8f0323db3c00 100644 --- a/tools/perf/builtin-stat.c +++ b/tools/perf/builtin-stat.c @@ -625,9 +625,13 @@ static int __run_perf_stat(int argc, const char **argv) if (errno == EINVAL || errno == ENOSYS || errno == ENOENT || errno == EOPNOTSUPP || errno == ENXIO) { - if (verbose > 0) + if (verbose > 0) { ui__warning("%s event is not supported by the kernel.\n", perf_evsel__name(counter)); + perf_evsel__open_strerror(counter, &target, + errno, msg, sizeof(msg)); + ui__error("%s\n", msg); + } counter->supported = false; if ((counter->leader != counter) ||