From: Stephane Eranian <eranian@google.com>
To: Peter Zijlstra <peterz@infradead.org>
Cc: Ingo Molnar <mingo@elte.hu>, Paul Mackerras <paulus@samba.org>,
"Metzger, Markus T" <markus.t.metzger@intel.com>,
lkml <linux-kernel@vger.kernel.org>,
Robert Richter <robert.richter@amd.com>,
"David S. Miller" <davem@davemloft.net>,
Jamie Iles <jamie.iles@picochip.com>,
Paul Mundt <lethal@linux-sh.org>,
Arjan van de Ven <arjan@infradead.org>,
"H. Peter Anvin" <hpa@zytor.com>,
perfmon2-devel@lists.sf.net
Subject: Re: [RFC][PATCH] perf_events, x86: PEBS support
Date: Wed, 3 Feb 2010 15:54:49 +0100 [thread overview]
Message-ID: <bd4cb8901002030654g25026797xff6aa9786f029590@mail.gmail.com> (raw)
In-Reply-To: <1265208012.24455.592.camel@laptop>
On Wed, Feb 3, 2010 at 3:40 PM, Peter Zijlstra <peterz@infradead.org> wrote:
> On Wed, 2010-02-03 at 15:30 +0100, Stephane Eranian wrote:
>> On Wed, Feb 3, 2010 at 3:19 PM, Peter Zijlstra <peterz@infradead.org> wrote:
>> > On Wed, 2010-02-03 at 15:07 +0100, Stephane Eranian wrote:
>> >> >> The only improvement that PEBS provides is that you get an IP and the
>> >> >> machine state at retirement of an instruction that caused the event to
>> >> >> increment. Thus, the IP points to the next dynamic instruction. The instruction
>> >> >> is not the one that cause the P-th occurence of the event, if you set the
>> >> >> period to P. It is at P+N, where N cannot be predicted and varies depending
>> >> >> on the event and executed code. This introduces some bias in the samples..
>> >> >
>> >> > I'm not sure I follow, it records the next event after overflow, doesn't
>> >> > that make it P+1?
>> >> >
>> >> That is not what I wrote. I did not say if records at P+1. I said it records
>> >> at P+N, where N varies from sample to sample and cannot be predicted.
>> >> N is expressed in the unit of the sampling event.
>> >
>> > OK, so I'm confused.
>> >
>> > The manual says it arms the PEBS assist on overflow, and the PEBS thing
>> > will then record the next event. Which to me reads like P+1.
>> >
>> you are assuming arming is instantaneous.
>
> Yes I was, ok that stinks.
>
PEBS is still very useful because it guarantees the state you capture
is at retirement of an instruction which caused the event.
PEBS also gets way more interesting on Nehalem because of the
ability to capture where cache misses occur. That's the load latency
feature. You need to support that.
I believe you would need to abstract this in a generic fashion so it
could be used on other architectures, such as AMD with IBS.
On Nehalem, it requires the following:
- only works if you sample on MEM_INST_RETIRED:LATENCY_ABOVE_THRESHOLD.
- the threshold must be programmed into a dedicated MSR. The extra
difficulty is that this MSR is shared between CPU when HT is on.
> If only they would reset the counter on overflow instead of on record,
> that would solve quite a few issues I imagine.
>
> Then add IP to the actual instruction and you've got yourself a useful
> tool :-)
>
>
next prev parent reply other threads:[~2010-02-03 14:54 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-02-02 16:56 Peter Zijlstra
2010-02-02 18:26 ` Ingo Molnar
2010-02-02 18:33 ` Peter Zijlstra
2010-02-03 13:22 ` Stephane Eranian
2010-02-03 13:56 ` Peter Zijlstra
2010-02-03 14:07 ` Stephane Eranian
2010-02-03 14:19 ` Peter Zijlstra
2010-02-03 14:30 ` Stephane Eranian
2010-02-03 14:40 ` Peter Zijlstra
2010-02-03 14:54 ` Stephane Eranian [this message]
2010-02-03 15:12 ` Peter Zijlstra
2010-02-03 23:50 ` Peter Zijlstra
2010-02-03 23:51 ` Stephane Eranian
2010-02-04 0:03 ` Peter Zijlstra
2010-02-04 0:22 ` Stephane Eranian
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=bd4cb8901002030654g25026797xff6aa9786f029590@mail.gmail.com \
--to=eranian@google.com \
--cc=arjan@infradead.org \
--cc=davem@davemloft.net \
--cc=hpa@zytor.com \
--cc=jamie.iles@picochip.com \
--cc=lethal@linux-sh.org \
--cc=linux-kernel@vger.kernel.org \
--cc=markus.t.metzger@intel.com \
--cc=mingo@elte.hu \
--cc=paulus@samba.org \
--cc=perfmon2-devel@lists.sf.net \
--cc=peterz@infradead.org \
--cc=robert.richter@amd.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
all inboxes | Powered by JetHome®