Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1213590

Re: [PATCH v2 0/6] perf: Introduce extended syscall error reporting

From Ingo Molnar <mingo@kernel.org>
Newsgroups linux.kernel
Subject Re: [PATCH v2 0/6] perf: Introduce extended syscall error reporting
Date 2015-08-26 09:10 +0200
Message-ID <q1D0m-71b-13@gated-at.bofh.it> (permalink)
References (4 earlier) <q1iRZ-2x2-17@gated-at.bofh.it> <q1jkZ-3k4-7@gated-at.bofh.it> <q1jEm-3GJ-5@gated-at.bofh.it> <q1AYx-3Q5-1@gated-at.bofh.it> <q1D0l-71b-9@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


* Linus Torvalds <torvalds@linux-foundation.org> wrote:

> On Aug 25, 2015 21:49, "Ingo Molnar" <mingo@kernel.org> wrote:
> >
> > No, the current MAX_ERRNO is probably not big enough if this scheme is 
> > successful, and I don't see any reason why it wouldn't be successful: I think 
> > this feature would be the biggest usability feature added to Linux system 
> > calls and to Linux system tooling in the last 10 years or so.
> 
> Don't be silly. It's a horrible idea. People would want to internationalize the 
> strings etc, and nobody would use the extended versions anyway, since nobody 
> uses raw system calls.

So the prctl() suggestion would address that worry, which would make it available 
essentially immediately, for any tool that cares. (And this would IMHO be a 
prctl() that kind of fits the interface, it does not feelt bolted on.)

Internationalization could be done easily in a user-space library, by hash-tabling 
the English strings - for anyone who cares. It could be a simple free-form 
string->string translation library that gets strings added, it doesn't have to 
know about any context.

> We've had this before. Some extension that is Linux-specific, and improved on 
> some small detail, and never gets used, and just cause pain.

I think this time is different, especially with another interface variant we could 
use that I think addresses (most of your) concerns:

> And the extended errors would be painful even in the kernel. We do compare for 
> specific error values. As does user space. There is a reason those values are 
> limited to a fairly small set of standard values, and system calls come with 
> documentation on which errors they can return.

So my very first interface suggestion two years ago when this first came up was to 
decouple the error code from the string, i.e. to allow:

	return err_code(-EINVAL, "x86/perf: CPU does not support precise sampling");

... which would return -EINVAL all the way - but would side-store the error 
string, for user-space that requests it. There would be no 'extended errno' space 
at all, dynamic or static, just the regular errno, and an optional string for 
user-space that wants to use it.

This would make error codes still tightly clustered around a handful of main 
categories and there would be no change whatsoever to current error codes.

Would you be fine with such an approach?

> It may work for perf, but don't start thinking it works anywhere else

Ok, will keep it perf (and scheduler) only.

Thanks,

	Ingo
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH v2 0/6] perf: Introduce extended syscall error reporting Alexander Shishkin <alexander.shishkin@linux.intel.com> - 2015-08-24 16:40 +0200
  [PATCH v2 5/6] perf/x86/intel/pt: Use extended error reporting in event initialization Alexander Shishkin <alexander.shishkin@linux.intel.com> - 2015-08-24 16:40 +0200
  [PATCH v2 6/6] perf/x86/intel/bts: Use extended error reporting in event initialization Alexander Shishkin <alexander.shishkin@linux.intel.com> - 2015-08-24 16:40 +0200
  [PATCH v2 1/6] perf: Introduce extended syscall error reporting Alexander Shishkin <alexander.shishkin@linux.intel.com> - 2015-08-24 16:40 +0200
    Re: [PATCH v2 1/6] perf: Introduce extended syscall error reporting Andy Shevchenko <andy.shevchenko@gmail.com> - 2015-08-31 20:50 +0200
      Re: [PATCH v2 1/6] perf: Introduce extended syscall error reporting Alexander Shishkin <alexander.shishkin@linux.intel.com> - 2015-09-01 08:40 +0200
  [PATCH v2 3/6] perf: Annotate some of the error codes with perf_err() Alexander Shishkin <alexander.shishkin@linux.intel.com> - 2015-08-24 16:40 +0200
  [PATCH v2 2/6] perf: Add file name and line number to perf extended error reports Alexander Shishkin <alexander.shishkin@linux.intel.com> - 2015-08-24 16:40 +0200
  [PATCH v2 4/6] perf/x86: Annotate some of the error codes with perf_err() Alexander Shishkin <alexander.shishkin@linux.intel.com> - 2015-08-24 16:40 +0200
  Re: [PATCH v2 0/6] perf: Introduce extended syscall error reporting Ingo Molnar <mingo@kernel.org> - 2015-08-25 10:30 +0200
  Re: [PATCH v2 0/6] perf: Introduce extended syscall error reporting Johannes Berg <johannes@sipsolutions.net> - 2015-08-25 11:00 +0200
    Re: [PATCH v2 0/6] perf: Introduce extended syscall error reporting Ingo Molnar <mingo@kernel.org> - 2015-08-25 11:10 +0200
      Re: [PATCH v2 0/6] perf: Introduce extended syscall error reporting Ingo Molnar <mingo@kernel.org> - 2015-08-25 11:20 +0200
        Re: [PATCH v2 0/6] perf: Introduce extended syscall error reporting Johannes Berg <johannes@sipsolutions.net> - 2015-08-25 11:40 +0200
          Re: [PATCH v2 0/6] perf: Introduce extended syscall error reporting Ingo Molnar <mingo@kernel.org> - 2015-08-25 12:10 +0200
            Re: [PATCH v2 0/6] perf: Introduce extended syscall error reporting Johannes Berg <johannes@sipsolutions.net> - 2015-08-25 12:30 +0200
              Re: [PATCH v2 0/6] perf: Introduce extended syscall error reporting Ingo Molnar <mingo@kernel.org> - 2015-08-26 07:00 +0200
                Re: [PATCH v2 0/6] perf: Introduce extended syscall error reporting Johannes Berg <johannes@sipsolutions.net> - 2015-08-26 09:10 +0200
                Re: [PATCH v2 0/6] perf: Introduce extended syscall error reporting Ingo Molnar <mingo@kernel.org> - 2015-08-26 09:30 +0200
                Re: [PATCH v2 0/6] perf: Introduce extended syscall error reporting Alexander Shishkin <alexander.shishkin@linux.intel.com> - 2015-08-26 19:00 +0200
                Re: [PATCH v2 0/6] perf: Introduce extended syscall error reporting Arnaldo Carvalho de Melo <acme@kernel.org> - 2015-08-26 23:00 +0200
                Re: [PATCH v2 0/6] perf: Introduce extended syscall error reporting Andrew Morton <akpm@linux-foundation.org> - 2015-08-26 20:50 +0200
                Re: [PATCH v2 0/6] perf: Introduce extended syscall error reporting Peter Zijlstra <peterz@infradead.org> - 2015-08-26 22:10 +0200
                Re: [PATCH v2 0/6] perf: Introduce extended syscall error reporting Andrew Morton <akpm@linux-foundation.org> - 2015-08-26 22:30 +0200
                Re: [PATCH v2 0/6] perf: Introduce extended syscall error  reporting Vince Weaver <vince@deater.net> - 2015-08-26 23:00 +0200
                Re: [PATCH v2 0/6] perf: Introduce extended syscall error reporting Andrew Morton <akpm@linux-foundation.org> - 2015-08-26 23:00 +0200
                Re: [PATCH v2 0/6] perf: Introduce extended syscall error  reporting Vince Weaver <vince@deater.net> - 2015-08-26 23:20 +0200
                Re: [PATCH v2 0/6] perf: Introduce extended syscall error reporting Ingo Molnar <mingo@kernel.org> - 2015-08-28 12:10 +0200
                Re: [PATCH v2 0/6] perf: Introduce extended syscall error reporting Arnaldo Carvalho de Melo <acme@infradead.org> - 2015-08-26 23:10 +0200
                Re: [PATCH v2 0/6] perf: Introduce extended syscall error reporting Ingo Molnar <mingo@kernel.org> - 2015-08-26 09:30 +0200
                Re: [PATCH v2 0/6] perf: Introduce extended syscall error reporting Johannes Berg <johannes@sipsolutions.net> - 2015-08-26 09:40 +0200
                Re: [PATCH v2 0/6] perf: Introduce extended syscall error reporting Ingo Molnar <mingo@kernel.org> - 2015-08-26 09:10 +0200
        Re: [PATCH v2 0/6] perf: Introduce extended syscall error reporting Alexander Shishkin <alexander.shishkin@linux.intel.com> - 2015-08-26 13:40 +0200

csiph-web