public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andi Kleen <ak@linux.intel.com>
To: Stephane Eranian <eranian@google.com>
Cc: linux-kernel@vger.kernel.org, peterz@infradead.org,
	mingo@elte.hu, acme@ghostprotocols.net, jolsa@redhat.com,
	jmario@redhat.com, dzickus@redhat.com
Subject: Re: [PATCH] perf/x86: fix Haswell precise store data source encoding
Date: Thu, 15 May 2014 07:32:58 -0700	[thread overview]
Message-ID: <20140515143258.GA19657@tassilo.jf.intel.com> (raw)
In-Reply-To: <20140515115337.GA2855@quad>

On Thu, May 15, 2014 at 01:53:37PM +0200, Stephane Eranian wrote:
> 
> This patches fixes a bug in  precise_store_data_hsw() whereby
> it would set the data source memory level to the wrong value.
> 
> As per the the SDM Vol 3b Table 18-41 (Layout of Data Linear
> Address Information in PEBS Record), when status bit 0 is set
> this is a L1 hit, otherwise this is a L1 miss. 
> 
> This patch encodes the memory level according to the specification.

It's not enough. as I said it needs more fixes.

For most events it should be _NA, _STORE can be only specified
for the explicit _STORE events.

-Andi

> 
> Signed-off-by: Stephane Eranian <eranian@google.com>
> 
> diff --git a/arch/x86/kernel/cpu/perf_event_intel_ds.c b/arch/x86/kernel/cpu/perf_event_intel_ds.c
> index ae96cfa..81424f6 100644
> --- a/arch/x86/kernel/cpu/perf_event_intel_ds.c
> +++ b/arch/x86/kernel/cpu/perf_event_intel_ds.c
> @@ -114,9 +114,13 @@ static u64 precise_store_data_hsw(u64 status)
>  
>  	dse.val = 0;
>  	dse.mem_op = PERF_MEM_OP_STORE;
> -	dse.mem_lvl = PERF_MEM_LVL_NA;
> +	dse.mem_lvl = PERF_MEM_LVL_L1;
> +
>  	if (status & 1)
> -		dse.mem_lvl = PERF_MEM_LVL_L1;
> +		dse.mem_lvl |= PERF_MEM_LVL_HIT;
> +	else
> +		dse.mem_lvl |= PERF_MEM_LVL_MISS;
> +
>  	/* Nothing else supported. Sorry. */
>  	return dse.val;
>  }

-- 
ak@linux.intel.com -- Speaking for myself only

  reply	other threads:[~2014-05-15 14:33 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-15 11:53 [PATCH] perf/x86: fix Haswell precise store data source encoding Stephane Eranian
2014-05-15 14:32 ` Andi Kleen [this message]
2014-05-15 14:43   ` 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=20140515143258.GA19657@tassilo.jf.intel.com \
    --to=ak@linux.intel.com \
    --cc=acme@ghostprotocols.net \
    --cc=dzickus@redhat.com \
    --cc=eranian@google.com \
    --cc=jmario@redhat.com \
    --cc=jolsa@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --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