From: Peter Zijlstra <peterz@infradead.org>
To: "Metzger, Markus T" <markus.t.metzger@intel.com>
Cc: "mingo@elte.hu" <mingo@elte.hu>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
Frederic Weisbecker <fweisbec@gmail.com>,
Oleg Nesterov <oleg@redhat.com>
Subject: Re: [question] perf_event, ptrace
Date: Mon, 11 Apr 2011 15:21:21 +0200 [thread overview]
Message-ID: <1302528081.2388.103.camel@twins> (raw)
In-Reply-To: <928CFBE8E7CB0040959E56B4EA41A77E0132FFD8DC@irsmsx504.ger.corp.intel.com>
On Mon, 2011-04-11 at 14:12 +0100, Metzger, Markus T wrote:
> Hi Ingo, Peter,
>
>
>
> When I use perf_event together with ptrace (i.e. when the ptracer is the
> event owner), are there any guarantees whether events have been drained when
> the ptracer is notified?
>
>
>
> When I look at the signal handling code (kernel/signal.c:ptrace_stop(), line
> 1682), it appears as if the ptracee first wakes up the ptracer and then
> calls schedule().
>
>
>
> Thus, if ptracer and ptracee run on different cpus, the ptracer might
> already be looking at the event buffer when the ptracee is scheduled out and
> the last events are drained.
>
>
>
> Am I reading this correctly?
>
>
>
> Is the ptracer expected to check ->data_head to see if there had been any
> updates?
I've got absolutely no clue about ptrace anything. One would expect
ptrace to provide proper notification of when the ptracee is stopped, at
which point staring at ->data_head seems like the right thing to do if
you want to figure out if new events have happened.
parent reply other threads:[~2011-04-11 13:21 UTC|newest]
Thread overview: expand[flat|nested] mbox.gz Atom feed
[parent not found: <928CFBE8E7CB0040959E56B4EA41A77E0132FFD8DC@irsmsx504.ger.corp.intel.com>]
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=1302528081.2388.103.camel@twins \
--to=peterz@infradead.org \
--cc=fweisbec@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=markus.t.metzger@intel.com \
--cc=mingo@elte.hu \
--cc=oleg@redhat.com \
/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