From: Peter Zijlstra <peterz@infradead.org>
To: Vince Weaver <vincent.weaver@maine.edu>
Cc: linux-kernel@vger.kernel.org, Paul Mackerras <paulus@samba.org>,
Ingo Molnar <mingo@redhat.com>,
Arnaldo Carvalho de Melo <acme@kernel.org>
Subject: Re: perf: PERF_FLAG_FD_OUTPUT has been broken since 2.6.35
Date: Fri, 9 Jan 2015 17:00:51 +0100 [thread overview]
Message-ID: <20150109160051.GK29390@twins.programming.kicks-ass.net> (raw)
In-Reply-To: <alpine.DEB.2.11.1501081014460.24664@vincent-weaver-1.umelst.maine.edu>
On Thu, Jan 08, 2015 at 10:22:37AM -0500, Vince Weaver wrote:
> Hello,
>
> I was working on improving the manpage by working out how the
> perf_event_open() PERF_FLAG_FD_OUTPUT flag works.
>
> It turns out it doesn't.
>
> In kernel/events/core.c when opening a file this is done:
>
> if (output_event) {
> err = perf_event_set_output(event, output_event);
> if (err)
> goto err_context;
> }
>
> and perf_event_set_output() does:
>
> if (output_event->cpu == -1 && output_event->ctx != event->ctx) {
> goto out;
> }
>
> But event->ctx is always NULL; it does not get set to ctx until
> after the call to perf_event_set_output().
>
> It looks like this was broken back in 2.6.35 days with the change:
>
> commit ac9721f3f54b27a16c7e1afb2481e7ee95a70318
> Author: Peter Zijlstra <a.p.zijlstra@chello.nl>
> Date: Thu May 27 12:54:41 2010 +0200
>
> perf_events: Fix races and clean up perf_event and perf_mmap_data interaction
>
> So is this worth fixing seeing as apparently no one uses this feature?
I think there's a fair argument for removing it, Ingo, Acme?
> As an aside, added error reporting is *really* needed as I had to sprinkle
> all of events/core.c with printk() calls to even begin to understand why
> I was getting the EINVAL result.
Yes, let me see if I can find someone to work on that :/
next prev parent reply other threads:[~2015-01-09 16:01 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-01-08 15:22 Vince Weaver
2015-01-09 16:00 ` Peter Zijlstra [this message]
2015-01-09 16:26 ` Vince Weaver
2015-01-09 23:17 ` Arnaldo Carvalho de Melo
2015-01-13 9:36 ` Peter Zijlstra
2015-01-13 11:56 ` 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=20150109160051.GK29390@twins.programming.kicks-ass.net \
--to=peterz@infradead.org \
--cc=acme@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=paulus@samba.org \
--cc=vincent.weaver@maine.edu \
/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
Powered by JetHome