Re: [PATCHv2 4/5] perf stat: Add -a as a default target
From: Arnaldo Carvalho de Melo
Date: Tue Feb 21 2017 - 09:20:33 EST
Em Tue, Feb 21, 2017 at 03:05:44PM +0100, Borislav Petkov escreveu:
> On Tue, Feb 21, 2017 at 10:34:26AM -0300, Arnaldo Carvalho de Melo wrote:
> > It _is_ supported by the kernel, and by the hardware, its just that it
> > is not supported in system wide mode, that BTW, in the case above, the
> > user doesn't even asked for (-a wasn't in the command line).
>
> Well, that warning is issued for a bunch of errno's. Lumping them all
> together is probably not what you want.
>
> Also, EINVAL for example, as I noted earlier, can be issued for a
> variety of conditions...
That is well understood, but it doesn't prevents us from trying to, with
the context in mind, disambiguate that value into meaningful messages,
that ends up being possible to a great degree, see, for instance:
perf_evsel__open_strerror()
It will take the errno and internal evsel state to try to provide a
better error message. So, if it is a uncore event and it the error
when trying to open it is EINVAL and it evsel->system_wide is not set...
- Arnaldo