From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: Ingo Molnar <mingo@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>,
Vince Weaver <vince@deater.net>,
Stephane Eranian <eranian@google.com>,
Jiri Olsa <jolsa@redhat.com>,
Andy Lutomirski <luto@amacapital.net>,
Thomas Gleixner <tglx@linutronix.de>,
LKML <linux-kernel@vger.kernel.org>
Subject: Re: [RFD] perf syscall error handling
Date: Mon, 10 Nov 2014 10:54:09 -0300 [thread overview]
Message-ID: <20141110135409.GR18464@kernel.org> (raw)
In-Reply-To: <20141110122446.GA21503@gmail.com>
Em Mon, Nov 10, 2014 at 01:24:47PM +0100, Ingo Molnar escreveu:
> * Arnaldo Carvalho de Melo <acme@kernel.org> wrote:
> > Em Mon, Nov 10, 2014 at 11:27:25AM +0100, Ingo Molnar escreveu:
> > > * Arnaldo Carvalho de Melo <acme@kernel.org> wrote:
> > > > Em Mon, Nov 03, 2014 at 05:50:19PM +0100, Peter Zijlstra escreveu:
> > > > > OK, so how about we do both, the offset+mask for the tools
> > > > > and the string for the humans?
It looks like machines don't have problems with strings 8-)
> > > > 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...
> > I don't have a problem with the order of introduction of new
> > error reporting mechanisms, or at least I can't think of one
> > right now.
> > So if we introduce strings now then tools/perf/ will trow them
> > to the user when it still don't have fallbacks or any other UI
> > indication of such an error.
> > I wonder tho if we have any previous experience on some other
> > project (or even in the kernel?) and how userspace ended up
> > using it, if just presenting those strings to the user or if
> > trying to parse it, etc, anybody?
> I'm not aware of any such efforts in the Linux space - subsystems
> with administrative interfaces generally just tend to printk() a
> reason - that's obviously suboptimal in several ways.
> 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 architecture")) {
> fprintf(stderr, "x86/BTS: No hardware support falling back to branch sampling\n");
> activate_x86_bts_fallback_code();
> goto out;
> }
> if (!strcmp(attr->error_str, "x86/lbr: LBR not supported by this CPU architecture"))
> goto out_err;
> }
> or it may do any number of other things, such as convert it to
> its internal error code. Note that the error messages should have
> some minimal structure (the 'x86/bts:' and 'x86/lbr' prefixes) to
> organize things nicely and to make string clashes less likely.
Right, focus on the string format: Can we just have this two level
thing, first part separated by a slash, followed by colon, to identify
the origin of the message, and then a message, that can have further,
unspecified at this time, parser tokens as the need arises?
> as this is a slowpath the performance of strcmp() doesn't matter,
> and in any case it's hardware accelerated or optimized well on
> most platforms.
- Arnaldo
next prev parent reply other threads:[~2014-11-10 13:54 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-10-30 22:28 [RFD] perf syscall error handling Peter Zijlstra
2014-10-31 1:16 ` Vince Weaver
2014-10-31 7:21 ` Peter Zijlstra
2014-10-31 9:27 ` Ingo Molnar
2014-10-31 12:28 ` Matt Fleming
2014-10-31 21:22 ` Stephane Eranian
2014-11-01 5:30 ` Vince Weaver
2014-11-03 16:25 ` Arnaldo Carvalho de Melo
2014-11-03 16:50 ` Peter Zijlstra
2014-11-03 17:00 ` Arnaldo Carvalho de Melo
2014-11-03 17:12 ` Vince Weaver
2014-11-03 17:39 ` Peter Zijlstra
2014-11-10 10:27 ` Ingo Molnar
2014-11-10 12:15 ` Arnaldo Carvalho de Melo
2014-11-10 12:24 ` Ingo Molnar
2014-11-10 13:54 ` Arnaldo Carvalho de Melo [this message]
2014-11-10 14:14 ` David Ahern
2014-11-10 14:47 ` Ingo Molnar
2014-11-10 10:38 ` Ingo Molnar
2014-10-31 10:00 ` Arnaldo Carvalho de Melo
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20141110135409.GR18464@kernel.org \
--to=acme@kernel.org \
--cc=eranian@google.com \
--cc=jolsa@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=luto@amacapital.net \
--cc=mingo@kernel.org \
--cc=peterz@infradead.org \
--cc=tglx@linutronix.de \
--cc=vince@deater.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.