From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751110AbdBUHys (ORCPT ); Tue, 21 Feb 2017 02:54:48 -0500 Received: from mx1.redhat.com ([209.132.183.28]:37124 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750951AbdBUHyo (ORCPT ); Tue, 21 Feb 2017 02:54:44 -0500 Date: Tue, 21 Feb 2017 08:54:37 +0100 From: Jiri Olsa To: Borislav Petkov Cc: Arnaldo Carvalho de Melo , Jiri Olsa , David Ahern , Namhyung Kim , Peter Zijlstra , lkml , Ingo Molnar Subject: Re: [PATCHv2 4/5] perf stat: Add -a as a default target Message-ID: <20170221075437.GB7384@krava> References: <20170217143327.GA11281@krava> <20170217144128.GF4109@kernel.org> <20170217170034.GB15389@krava> <20170218175225.5cylpqti7oluqehv@pd.tnic> <20170220071300.GA12002@krava> <20170220134433.GI4109@kernel.org> <20170220203149.yxietgdzi5lxdk5n@pd.tnic> <20170220212254.GC4071@kernel.org> <20170220224716.q6r3awztsf6t3k5a@pd.tnic> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170220224716.q6r3awztsf6t3k5a@pd.tnic> User-Agent: Mutt/1.7.1 (2016-10-04) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Tue, 21 Feb 2017 07:54:41 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Feb 20, 2017 at 11:47:16PM +0100, Borislav Petkov wrote: > On Mon, Feb 20, 2017 at 06:22:54PM -0300, Arnaldo Carvalho de Melo wrote: > > Well, this one should be read (and written in the tool output as): > > > > > > Do you want to change that CNTR_NOT_SUPPORTED string unconditionally to > something like above? > > Because perf_evsel.supported seems like it means that counter is not > supported but not necessarily only because of the missing -a for an > uncore event, AFAICT. I could be wrong. > > > Right, the ENOTSUPP in this case needs to be properly expanded into > > something meaningful, as suggested above. > > I dumped errno in __run_perf_stat(): > > ./perf stat -v -e amd_nb/event=0xe0,umask=0x1f/ sleep 1 > Using CPUID AuthenticAMD-21-2 > Warning: > amd_nb/event=0xe0,umask=0x1f/ event is not supported by the kernel: 22. > > It is -EINVAL and the syscall returns -EINVAL in bunch of places so I'm > guessing this might not be a good way to match the retval to the proper > error message. > > Peterz said something about scanning all events supplied by -e and if > all are uncore, to set -a automatically. Can we do that? right, so that's different from what we actually did.. ;-) I'll check on this one.. might not be as straight forward, because some uncore events might have already cpumask limit jirka