Re: [RFD] perf syscall error handling

2014-11-10 Thread Ingo Molnar
* David Ahern wrote: > On 11/10/14, 5:24 AM, Ingo Molnar wrote: > >Programmatic use in user-spaec is very simple - go with my > >initial example, tooling can either just display the error string > >and bail out, or do: > > > > if (unlikely(error)) { > > if (!strcmp(attr->error_str, "x86/bt

Re: [RFD] perf syscall error handling

2014-11-10 Thread David Ahern
On 11/10/14, 5:24 AM, Ingo Molnar wrote: Programmatic use in user-spaec is very simple - go with my initial example, tooling can either just display the error string and bail out, or do: if (unlikely(error)) { if (!strcmp(attr->error_str, "x86/bts: BTS not supported by this CPU archi

Re: [RFD] perf syscall error handling

2014-11-10 Thread Arnaldo Carvalho de Melo
Em Mon, Nov 10, 2014 at 01:24:47PM +0100, Ingo Molnar escreveu: > * Arnaldo Carvalho de Melo wrote: > > Em Mon, Nov 10, 2014 at 11:27:25AM +0100, Ingo Molnar escreveu: > > > * Arnaldo Carvalho de Melo wrote: > > > > Em Mon, Nov 03, 2014 at 05:50:19PM +0100, Peter Zijlstra escreveu: > > > > > OK,

Re: [RFD] perf syscall error handling

2014-11-10 Thread Ingo Molnar
* Arnaldo Carvalho de Melo wrote: > Em Mon, Nov 10, 2014 at 11:27:25AM +0100, Ingo Molnar escreveu: > > > > * Arnaldo Carvalho de Melo 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

Re: [RFD] perf syscall error handling

2014-11-10 Thread Arnaldo Carvalho de Melo
Em Mon, Nov 10, 2014 at 11:27:25AM +0100, Ingo Molnar escreveu: > > * Arnaldo Carvalho de Melo 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 suggest

Re: [RFD] perf syscall error handling

2014-11-10 Thread Ingo Molnar
* Stephane Eranian wrote: > Hi, > > On Fri, Oct 31, 2014 at 1:28 PM, Matt Fleming wrote: > > On Fri, 31 Oct, at 10:27:13AM, Ingo Molnar wrote: > >> > >> - user-space gets back the regular errno (-EOPNOTSUPP or -ENOSYS > >>or -EINVAL, etc.) and a string. Strings are really the most > >>

Re: [RFD] perf syscall error handling

2014-11-10 Thread Ingo Molnar
* Arnaldo Carvalho de Melo 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

Re: [RFD] perf syscall error handling

2014-11-03 Thread Peter Zijlstra
On Mon, Nov 03, 2014 at 12:12:18PM -0500, Vince Weaver wrote: > I don't know if having an offset/mask helps much. Knowing your EINVAL > comes from ->config is nice to know, but if there's 30 different ways > to get an EINVAL from an improper config then you still can waste a lot > of time narrowin

Re: [RFD] perf syscall error handling

2014-11-03 Thread Vince Weaver
On Mon, 3 Nov 2014, Arnaldo Carvalho de Melo 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_at

Re: [RFD] perf syscall error handling

2014-11-03 Thread Arnaldo Carvalho de Melo
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 > >

Re: [RFD] perf syscall error handling

2014-11-03 Thread Peter Zijlstra
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 > s

Re: [RFD] perf syscall error handling

2014-11-03 Thread Arnaldo Carvalho de Melo
Em Sat, Nov 01, 2014 at 01:30:39AM -0400, Vince Weaver escreveu: > On Fri, 31 Oct 2014, Stephane Eranian wrote: > > > On Fri, Oct 31, 2014 at 1:28 PM, Matt Fleming > > wrote: > > > > > > I guess we'd run into a problem if userspace doesn't want to just print > > > the kernel string but instead w

Re: [RFD] perf syscall error handling

2014-11-01 Thread Matt Fleming
On Fri, 31 Oct, at 10:27:13AM, Ingo Molnar wrote: > > - user-space gets back the regular errno (-EOPNOTSUPP or -ENOSYS >or -EINVAL, etc.) and a string. Strings are really the most >helpful information, because tools can just print that. They >can also match on specific strings and p

Re: [RFD] perf syscall error handling

2014-10-31 Thread Vince Weaver
On Fri, 31 Oct 2014, Stephane Eranian wrote: > On Fri, Oct 31, 2014 at 1:28 PM, Matt Fleming wrote: > > > > I guess we'd run into a problem if userspace doesn't want to just print > > the kernel string but instead wants to parse it in some fashion. If the string interface went in it would be a h

Re: [RFD] perf syscall error handling

2014-10-31 Thread Stephane Eranian
Hi, On Fri, Oct 31, 2014 at 1:28 PM, Matt Fleming wrote: > On Fri, 31 Oct, at 10:27:13AM, Ingo Molnar wrote: >> >> - user-space gets back the regular errno (-EOPNOTSUPP or -ENOSYS >>or -EINVAL, etc.) and a string. Strings are really the most >>helpful information, because tools can just

Re: [RFD] perf syscall error handling

2014-10-31 Thread Arnaldo Carvalho de Melo
Em Thu, Oct 30, 2014 at 09:16:36PM -0400, Vince Weaver escreveu: > On Thu, 30 Oct 2014, Peter Zijlstra wrote: > > > So would something simple, like an offset into the struct > > perf_event_attr pointing at the current field we're trying to process > > make sense? Maybe with negative offsets to ind

Re: [RFD] perf syscall error handling

2014-10-31 Thread Ingo Molnar
* Peter Zijlstra wrote: > On Thu, Oct 30, 2014 at 09:16:36PM -0400, Vince Weaver wrote: > > On Thu, 30 Oct 2014, Peter Zijlstra wrote: > > > > > So would something simple, like an offset into the struct > > > perf_event_attr pointing at the current field we're trying > > > to process make sen

Re: [RFD] perf syscall error handling

2014-10-31 Thread Peter Zijlstra
On Thu, Oct 30, 2014 at 09:16:36PM -0400, Vince Weaver wrote: > On Thu, 30 Oct 2014, Peter Zijlstra wrote: > > > So would something simple, like an offset into the struct > > perf_event_attr pointing at the current field we're trying to process > > make sense? Maybe with negative offsets to indica

Re: [RFD] perf syscall error handling

2014-10-30 Thread Vince Weaver
On Thu, 30 Oct 2014, Peter Zijlstra wrote: > So would something simple, like an offset into the struct > perf_event_attr pointing at the current field we're trying to process > make sense? Maybe with negative offsets to indicate the syscall > arguments? > > That would narrow down the 'WTF is wron