public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: eranian@google.com
Cc: linux-kernel@vger.kernel.org, mingo@elte.hu, paulus@samba.org,
	davem@davemloft.net, fweisbec@gmail.com, robert.richter@amd.com,
	perfmon2-devel@lists.sf.net, eranian@gmail.com,
	Arjan van de Ven <arjan@linux.intel.com>,
	"H. Peter Anvin" <hpa@zytor.com>
Subject: Re: [PATCH]  perf_events: fix bug in hw_perf_enable()
Date: Mon, 01 Feb 2010 17:04:20 +0100	[thread overview]
Message-ID: <1265040260.24455.200.camel@laptop> (raw)
In-Reply-To: <1265038508.24455.177.camel@laptop>

On Mon, 2010-02-01 at 16:35 +0100, Peter Zijlstra wrote:
> +++ linux-2.6/arch/x86/kernel/cpu/perf_event.c
> @@ -243,8 +243,18 @@ static struct event_constraint intel_cor
>  
>  static struct event_constraint intel_core2_event_constraints[] =
>  {
> -       FIXED_EVENT_CONSTRAINT(0xc0, (0x3|(1ULL<<32))), /* INSTRUCTIONS_RETIRED */
> -       FIXED_EVENT_CONSTRAINT(0x3c, (0x3|(1ULL<<33))), /* UNHALTED_CORE_CYCLES */
> +       FIXED_EVENT_CONSTRAINT(0x00c0, 1ULL << 32), /* INST_RETIRED.ANY */
> +       FIXED_EVENT_CONSTRAINT(0x003c, 1ULL << 33), /* CPU_CLK_UNHALTED.CORE */
> +       /*
> +        * FIXED_EVENT_CONSTRAINT(0x013c, 1ULL << 34),  CPU_CLK_UNHALTED.REF
> +        *
> +        * Core2 has Fixed Counter 2 listed as CPU_CLK_UNHALTED.REF and event
> +        * 0x013c as CPU_CLK_UNHALTED.BUS and specifies there is a fixed
> +        * ratio between these counters.
> +        *
> +        * TODO: find/measure the fixed ratio and apply it so that we can
> +        * enable this fixed purpose counter in a transparent way.
> +        */
>         INTEL_EVENT_CONSTRAINT(0x10, 0x1), /* FP_COMP_OPS_EXE */
>         INTEL_EVENT_CONSTRAINT(0x11, 0x2), /* FP_ASSIST */
>         INTEL_EVENT_CONSTRAINT(0x12, 0x2), /* MUL */ 

>From what I can measure on the available Core2 systems this ratio is
exactly 1, which would be consistent with the Nehalem and Westmere
tables calling this event .REF

Stephane, have you ever observed this ratio to be anything other than 1?

If not, I think we can simply stick this counter back in and not worry
about it.


  reply	other threads:[~2010-02-01 16:04 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-02-01 12:50 [PATCH] perf_events: fix bug in hw_perf_enable() Stephane Eranian
2010-02-01 15:35 ` Peter Zijlstra
2010-02-01 16:04   ` Peter Zijlstra [this message]
2010-02-01 16:14     ` Stephane Eranian
2010-02-01 16:45       ` Peter Zijlstra
2010-02-01 17:23         ` Stephane Eranian
2010-02-01 17:46           ` Peter Zijlstra
2010-02-01 17:56             ` Stephane Eranian
2010-02-01 18:20               ` Peter Zijlstra
2010-02-01 16:12   ` Stephane Eranian
2010-02-01 16:47     ` Peter Zijlstra
2010-02-01 17:22       ` Stephane Eranian
2010-02-04  9:57 ` [tip:perf/core] perf_events, x86: Fix " 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=1265040260.24455.200.camel@laptop \
    --to=peterz@infradead.org \
    --cc=arjan@linux.intel.com \
    --cc=davem@davemloft.net \
    --cc=eranian@gmail.com \
    --cc=eranian@google.com \
    --cc=fweisbec@gmail.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=paulus@samba.org \
    --cc=perfmon2-devel@lists.sf.net \
    --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