mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "stephane eranian" <eranian@googlemail.com>
To: "Paul Mackerras" <paulus@samba.org>
Cc: "Andi Kleen" <andi@firstfloor.org>, "Ingo Molnar" <mingo@elte.hu>,
	linux-kernel@vger.kernel.org,
	"Thomas Gleixner" <tglx@linutronix.de>,
	linux-arch@vger.kernel.org,
	"Andrew Morton" <akpm@linux-foundation.org>,
	"Eric Dumazet" <dada1@cosmosbay.com>,
	"Robert Richter" <robert.richter@amd.com>,
	"Arjan van de Veen" <arjan@infradead.org>,
	"Peter Anvin" <hpa@zytor.com>,
	"Peter Zijlstra" <a.p.zijlstra@chello.nl>,
	"Steven Rostedt" <rostedt@goodmis.org>,
	"David Miller" <davem@davemloft.net>,
	"Paolo Ciarrocchi" <paolo.ciarrocchi@gmail.com>
Subject: Re: [patch] Performance Counters for Linux, v2
Date: Wed, 10 Dec 2008 06:03:05 +0100	[thread overview]
Message-ID: <7c86c4470812092103geca7df8ge9293de6de3f83ac@mail.gmail.com> (raw)
In-Reply-To: <18751.18735.539555.111549@drongo.ozlabs.ibm.com>

Paul,

On Wed, Dec 10, 2008 at 5:44 AM, Paul Mackerras <paulus@samba.org> wrote:
> Andi Kleen writes:
>
>> When you say counting you should also include "event ring buffers with
>> metadata", like PEBS on Intel x86.
>
> I'm not familiar with PEBS.  Maybe it's something different again,
> neither sampling nor counting, but a third thing?
>
PEBS is an Intel only feature used for sampling. However, this time
the hardware (and microcode) does the sampling for you. You point
the CPU to a structure in memory, called DS, which then points to
a region of memory you can designate, i.e., the sampling buffer.
Buffer can be any size you want.

Then you program counter0 when an event and a sampling period.
When the counter overflows, there is no interrupt, the microcode
records the RIP and full machine state, and reloads the counter with
the period specified in DS. The OS gets an interrupt ONLY when the
buffer fills up. Overhead is thus minimized, but you have no control
over the format of the samples. The precision (P) comes from the fact
that the RIP is guaranteed to point the an instruction that is just after
an instruction which generated the event you're sampling on. The catch
is that no all events support PEBS, and only one counter works with PEBS
on Core 2. Nehalem is better, more events support PEBS, all 4 generic
counters do support PEBS. Furthermore,PEBS can now capture where
cache misses occur, very much like what Itanium can do.

Needless to say all of this is supported by perfmon.

Hope this helps.

  reply	other threads:[~2008-12-10  5:03 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-12-08  1:22 Ingo Molnar
2008-12-08  1:49 ` Arjan van de Ven
2008-12-08 11:49   ` Ingo Molnar
2009-01-07  7:43     ` Zhang, Yanmin
2009-01-09  1:07       ` Zhang, Yanmin
2008-12-08  3:24 ` Paul Mackerras
2008-12-08 11:33   ` Ingo Molnar
2008-12-08 12:02     ` David Miller
2008-12-08 14:41     ` Andi Kleen
2008-12-08 22:03     ` Paul Mackerras
2008-12-09 13:00       ` Ingo Molnar
2008-12-09 23:00         ` Paul Mackerras
2008-12-08  8:32 ` Corey J Ashford
2008-12-09  6:37 ` stephane eranian
2008-12-09 11:02   ` Ingo Molnar
2008-12-09 11:11     ` David Miller
2008-12-09 11:22       ` Ingo Molnar
2008-12-09 11:29         ` David Miller
2008-12-09 12:14           ` Paolo Ciarrocchi
2008-12-09 13:46   ` Ingo Molnar
2008-12-09 16:39     ` Chris Friesen
2008-12-09 19:02       ` Ingo Molnar
2008-12-09 19:51         ` Chris Friesen
2008-12-09 16:46     ` Will Newton
2008-12-09 17:35       ` Chris Friesen
2008-12-09 21:16     ` stephane eranian
2008-12-09 22:19     ` Paul Mackerras
2008-12-09 22:40       ` Andi Kleen
2008-12-10  4:44         ` Paul Mackerras
2008-12-10  5:03           ` stephane eranian [this message]
2008-12-10 10:26           ` Andi Kleen

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=7c86c4470812092103geca7df8ge9293de6de3f83ac@mail.gmail.com \
    --to=eranian@googlemail.com \
    --cc=a.p.zijlstra@chello.nl \
    --cc=akpm@linux-foundation.org \
    --cc=andi@firstfloor.org \
    --cc=arjan@infradead.org \
    --cc=dada1@cosmosbay.com \
    --cc=davem@davemloft.net \
    --cc=eranian@gmail.com \
    --cc=hpa@zytor.com \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=paolo.ciarrocchi@gmail.com \
    --cc=paulus@samba.org \
    --cc=robert.richter@amd.com \
    --cc=rostedt@goodmis.org \
    --cc=tglx@linutronix.de \
    /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