lkml.org 
[lkml]   [2015]   [Aug]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2 0/6] perf: Introduce extended syscall error reporting

* Johannes Berg <johannes@sipsolutions.net> wrote:

> On Mon, 2015-08-24 at 17:32 +0300, Alexander Shishkin wrote:
>
> > This time around, I employed a linker trick to convert the structures
> > containing extended error information into integers, which are then
> > made to look just like normal error codes so that IS_ERR_VALUE() and
> > friends would still work correctly on them. So no extra pointers in
> > the struct perf_event or anywhere else; the extended error codes are
> > passed around like normal error codes. They only need to be converted
> > in syscalls' topmost return statements. This is done in 1/6.
>
> For the record, as we discussed separately, I'd love to see this move to more
> general infrastructure. In wireless (nl80211), for example, we have a few
> hundred (!) callsites returning -EINVAL, mostly based on malformed netlink
> attributes, and it can be very difficult to figure out what went wrong;
> debugging mostly employs a variation of Hugh's trick.

Absolutely, I suggested this as well earlier today, as the scheduler would like to
make use of it in syscalls with extensible ABIs, such as sched_setattr().

If people really like this then we could go farther as well and add a standalone
'extended errors system call' as well (SyS_errno_extended_get()), which would
allow the recovery of error strings even for system calls that are not easily
extensible. We could cache the last error description in the task struct.

Thanks,

Ingo


\
 
 \ /
  Last update: 2015-08-25 11:21    [W:0.105 / U:1.020 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site