Re: [PATCHv2 4/5] perf stat: Add -a as a default target

From: Jiri Olsa
Date: Tue Feb 21 2017 - 02:55:05 EST

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):
> >
> > <not supported in workload only mode, try system wide, using -a>
> 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