linux-perf-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Nadav Amit <nadav.amit@gmail.com>
To: Peter Zijlstra <peterz@infradead.org>
Cc: kan.liang@linux.intel.com, LKML <linux-kernel@vger.kernel.org>,
	linux-perf-users@vger.kernel.org
Subject: Re: Using perf_event_open() to sample multiple events of a process
Date: Mon, 8 Nov 2021 11:51:04 -0800	[thread overview]
Message-ID: <ED4D20D0-DD1C-48D1-B686-E519EB384429@gmail.com> (raw)
In-Reply-To: <YYlBMmMg0PTV3pED@hirez.programming.kicks-ass.net>


> On Nov 8, 2021, at 7:24 AM, Peter Zijlstra <peterz@infradead.org> wrote:
> 
> On Sat, Nov 06, 2021 at 01:57:23AM +0100, Peter Zijlstra wrote:
> 
>> The problem seems to be that we call perf_event_set_output() before we
>> set event->ctx, which is a bit of a problem.
>> 
>> Now, afaict it's been broken since c3f00c70276d ("perf: Separate
>> find_get_context() from event initialization"), which is ages ago :/
>> 
>> It's waaay too late to try and fix it; I'll be likely to make an even
>> bigger mess if I tried. Perhaps tomorrow.
>> 
>> Clearly FD_OUTPUT isn't much used :-(
> 
> The below seems to fix, it's a bit of a hack, but I couldn't really come
> up with anything saner.

I originally considered doing a similar hack. I assume it should work,
but I moved to using the ioctl workaround that you suggested.

Clearly nobody is using this feature if it is broken for 11 years.
There is always the option to deprecate it if there is an alternative.


  reply	other threads:[~2021-11-08 19:51 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-05  5:57 Using perf_event_open() to sample multiple events of a process Nadav Amit
2021-11-06  0:45 ` Peter Zijlstra
2021-11-06  0:57   ` Peter Zijlstra
2021-11-08 15:24     ` Peter Zijlstra
2021-11-08 19:51       ` Nadav Amit [this message]
2021-11-06  0:59   ` Nadav Amit

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=ED4D20D0-DD1C-48D1-B686-E519EB384429@gmail.com \
    --to=nadav.amit@gmail.com \
    --cc=kan.liang@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=peterz@infradead.org \
    /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).