lkml.org 
[lkml]   [2014]   [Nov]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFD] perf syscall error handling

* Arnaldo Carvalho de Melo <acme@kernel.org> wrote:

> Em Mon, Nov 03, 2014 at 05:50:19PM +0100, Peter Zijlstra escreveu:
> > On Mon, Nov 03, 2014 at 02:25:48PM -0200, Arnaldo Carvalho de Melo wrote:
>
> > > The way that peterz suggested, i.e. returning information about which
> > > perf_event_attr and which of the parameters was invalid/had issues could
> > > help with fallbacking/capability querying, i.e. tooling may want to use
> > > some features if available automagically, fallbacking to something else
> > > when that fails.
>
> > > We already do that to some degree in various cases, but for some if the
> > > only way that becomes available to disambiguate some EINVAL return is a
> > > string, code will start having strcmps :-\
>
> > OK, so how about we do both, the offset+mask for the tools
> > and the string for the humans?
>
> Yeah, tooling tries to provide the best it can with the
> offset+mask, and if doesn't manage to do anything smart with
> it, just show the string and hope that helps the user to figure
> out what is happening.

Almost: tooling should generally always consider the string as
well, for the (not so uncommon) case where there can be multiple
problems with the same field.

Really, I think the string will give the most bang for the buck,
because it's really simple and straightforward on the kernel side
(so that we have a good chance of achieving full coverage
relatively quickly), and later on we could still complicate it
all with offset+mask if there's really a need.

So lets start with an error string...

Thanks,

Ingo


\
 
 \ /
  Last update: 2014-11-10 11:41    [W:0.073 / U:3.768 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site