From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: Vince Weaver <vince@deater.net>
Cc: Stephane Eranian <eranian@google.com>,
Ingo Molnar <mingo@kernel.org>,
Peter Zijlstra <peterz@infradead.org>,
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, 3 Nov 2014 14:25:48 -0200 [thread overview]
Message-ID: <20141103162548.GB18464@kernel.org> (raw)
In-Reply-To: <alpine.DEB.2.10.1411010130170.6256@pianoman.cluster.toy>
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 <matt@console-pimps.org> 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 help when debugging
> perf_event_open().
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 :-\
> Support would probably get added to PAPI, but PAPI has its own error
> reporting issues and it's not always easy to pass a string the whole way
> back to the user.
Having the last resort being an string instead of EINVAL is indeed much
better than what we have now.
> Also with PAPI many of the users reporting obscure perf_event_open()
> problems are often running 2.6.32-vendor-patched kernels, so sadly it will
> be years before any improved error handling filters down to many of the
> users.
> This proposal also doesn't help with other weird failure modes in the
> interface, the most annoying of which is the watchdog stealing a counter
> so event groups perf_event_open() and start just fine but fail at read
> time.
> > > That may or may not be a problem in practice, Vince can probably comment
> > > on that. I'm just thinking along the lines of making the perf syscall
> > > interface as useful as possible for tools other than tools/perf.
> > Maybe I missed something in the earlier thread, but I am trying to understand
> > why perf_event_open() would need such extended error retrieval system when
> > no other syscall does.
> well perf_event_open() is so complex, with it's 40+ different parameters.
> Having a wrong value in any one of those (or one of the combinations of
> those) can trigger EINVAL and it's not clear where the issue is.
> I think other system calls tend to have slighly more straightforward
> interfaces.
Yes, it is a PITA to figure out which codepath returned -EINVAL.
Its just a "No comprendo", we're left wondering what is it that is not
being understood or accepted...
- Arnaldo
next prev parent reply other threads:[~2014-11-03 16:25 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 [this message]
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
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=20141103162548.GB18464@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).