mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Stephane Eranian <eranian@google.com>
To: "Drongowski, Paul" <paul.drongowski@amd.com>
Cc: eranian@gmail.com, Peter Zijlstra <peterz@infradead.org>,
	perfmon2-devel@lists.sf.net, fweisbec@gmail.com,
	linux-kernel@vger.kernel.org, paulus@samba.org, mingo@elte.hu,
	davem@davemloft.net
Subject: Re: [perfmon2] [PATCH] perf_events: AMD event scheduling (v3)
Date: Wed, 10 Feb 2010 17:07:13 +0100	[thread overview]
Message-ID: <bd4cb8901002100807y7b142f02ofb8cecb507ddf681@mail.gmail.com> (raw)
In-Reply-To: <6096959DEF5C9447A6BF80BDC7EB9EDC14913E8B@SBOSEXMB1.amd.com>

On Wed, Feb 10, 2010 at 4:59 PM, Drongowski, Paul
<paul.drongowski@amd.com> wrote:
> Good catch!
>
> Historically, AMD has treated the bit field EventSelect<7:5>
> in model specific register MSRC001_00[03:00] Performance Event
> Select Register (PERF_CTL[3:0]) like an "event group selector".
> Please see the "BIOS and Kernel Developer's Guide for AMD
> Family 10h Processors."
>
> Typically, EventSelect<7:5> == 0x7 selects Northbridge
> events.
>
> Yes, when the event select value was extended to twelve bits,
> it placed this field somewhere in the middle of the full
> twelve bit value. ;-)
>
> Please consider AMD Family 10h event 0x1C0 Retired x87
> Floating Point Operations. This is not a Northbridge event.
> If the test is greater than or equal to (e.g., 0x1C0 >= 0x0E0),
> then this event will be incorrectly identified as a
> Northbridge event. (There are other similar examples.)
>
Good example.

> So, I would recommend testing EventSelect<7:5> == 0x7
> in order to detect AMD Northbridge events.
>
Ok, so something like the following would do it:

static inline int amd_is_nb_event(struct hw_perf_event *hwc)
{
   return (hwc->config >> 5) & 0x7 == 0x7;
}

  reply	other threads:[~2010-02-10 16:07 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-02-08 15:17 Stephane Eranian
2010-02-10 11:59 ` Peter Zijlstra
2010-02-10 13:04   ` Stephane Eranian
2010-02-10 13:17     ` Peter Zijlstra
2010-02-10 13:28       ` Peter Zijlstra
2010-02-10 13:58         ` stephane eranian
2010-02-10 15:59           ` [perfmon2] " Drongowski, Paul
2010-02-10 16:07             ` Stephane Eranian [this message]
2010-02-10 16:17               ` Peter Zijlstra
2010-02-10 16:09   ` Robert Richter
2010-02-10 16:14     ` Peter Zijlstra
2010-02-26 10:25 ` [tip:perf/core] perf_events, x86: AMD event scheduling tip-bot for 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=bd4cb8901002100807y7b142f02ofb8cecb507ddf681@mail.gmail.com \
    --to=eranian@google.com \
    --cc=davem@davemloft.net \
    --cc=eranian@gmail.com \
    --cc=fweisbec@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=paul.drongowski@amd.com \
    --cc=paulus@samba.org \
    --cc=perfmon2-devel@lists.sf.net \
    --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

all inboxes | Powered by JetHome®