linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andi Kleen <andi@firstfloor.org>
To: peterz@infradead.org
Cc: linux-kernel@vger.kernel.org, eranian@google.com,
	Andi Kleen <ak@linux.intel.com>
Subject: [PATCH 2/2] perf, x86: Don't mark DataLA addresses as store
Date: Fri, 11 Jul 2014 17:01:25 -0700	[thread overview]
Message-ID: <1405123285-23544-2-git-send-email-andi@firstfloor.org> (raw)
In-Reply-To: <1405123285-23544-1-git-send-email-andi@firstfloor.org>

From: Andi Kleen <ak@linux.intel.com>

Haswell supports reporting the data address for a range
of PEBS events, including:

UOPS_RETIRED.ALL
MEM_UOPS_RETIRED.STLB_MISS_LOADS
MEM_UOPS_RETIRED.STLB_MISS_STORES
MEM_UOPS_RETIRED.LOCK_LOADS
MEM_UOPS_RETIRED.SPLIT_LOADS
MEM_UOPS_RETIRED.SPLIT_STORES
MEM_UOPS_RETIRED.ALL_LOADS
MEM_UOPS_RETIRED.ALL_STORES
MEM_LOAD_UOPS_RETIRED.L1_HIT
MEM_LOAD_UOPS_RETIRED.L2_HIT
MEM_LOAD_UOPS_RETIRED.L3_HIT
MEM_LOAD_UOPS_RETIRED.L1_MISS
MEM_LOAD_UOPS_RETIRED.L2_MISS
MEM_LOAD_UOPS_RETIRED.L3_MISS
MEM_LOAD_UOPS_RETIRED.HIT_LFB
MEM_LOAD_UOPS_L3_HIT_RETIRED.XSNP_MISS
MEM_LOAD_UOPS_L3_HIT_RETIRED.XSNP_HIT
MEM_LOAD_UOPS_L3_HIT_RETIRED.XSNP_HITM
MEM_LOAD_UOPS_L3_HIT_RETIRED.XSNP_NONE
MEM_LOAD_UOPS_L3_MISS_RETIRED.LOCAL_DRAM

This facility was already enabled earlier with the original Haswell
perf changes.

However these addresses were always reports as stores by perf, which is wrong,
as they could be loads too.  The hardware does not distinguish loads and stores
for these instructions, so there's no (cheap) way for the profiler
to find out.

Change the type to PERF_MEM_OP_NA instead.

Signed-off-by: Andi Kleen <ak@linux.intel.com>
---
 arch/x86/kernel/cpu/perf_event_intel_ds.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/kernel/cpu/perf_event_intel_ds.c b/arch/x86/kernel/cpu/perf_event_intel_ds.c
index 64b4be9..13baa7c 100644
--- a/arch/x86/kernel/cpu/perf_event_intel_ds.c
+++ b/arch/x86/kernel/cpu/perf_event_intel_ds.c
@@ -114,7 +114,7 @@ static u64 precise_store_data_hsw(struct perf_event *event, u64 status)
 	u64 cfg = event->hw.config & INTEL_ARCH_EVENT_MASK;
 
 	dse.val = 0;
-	dse.mem_op = PERF_MEM_OP_STORE;
+	dse.mem_op = PERF_MEM_OP_NA;
 	dse.mem_lvl = PERF_MEM_LVL_NA;
 
 	/*
-- 
1.9.3


  reply	other threads:[~2014-07-12  0:01 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-12  0:01 [PATCH 1/2] perf, x86: Revamp PEBS event selection Andi Kleen
2014-07-12  0:01 ` Andi Kleen [this message]
2014-07-14 18:04   ` [PATCH 2/2] perf, x86: Don't mark DataLA addresses as store Stephane Eranian
2014-07-14 19:24     ` Andi Kleen
2014-07-14 22:08       ` Stephane Eranian
2014-07-14 22:39         ` Andi Kleen
2014-07-14 22:49           ` Stephane Eranian
2014-07-14 22:50             ` Stephane Eranian
2014-07-15  4:05               ` Andi Kleen
2014-07-15  8:59                 ` Peter Zijlstra
2014-07-15 18:19                   ` Stephane Eranian
2014-07-17 20:24                     ` Stephane Eranian
2014-07-19  0:49             ` Andi Kleen
2014-07-21 21:15               ` Stephane Eranian
2014-07-14 22:10 ` [PATCH 1/2] perf, x86: Revamp PEBS event selection Stephane Eranian
  -- strict thread matches above, loose matches on Subject: below --
2014-07-07 22:37 [PATCH 1/2] perf, x86: Revamp PEBS event selection v2 Andi Kleen
2014-07-07 22:37 ` [PATCH 2/2] perf, x86: Don't mark DataLA addresses as store Andi Kleen
2014-03-13 21:22 [PATCH 1/2] perf, x86: Disallow setting undefined bits for PEBS events Andi Kleen
2014-03-13 21:22 ` [PATCH 2/2] perf, x86: Don't mark DataLA addresses as store 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=1405123285-23544-2-git-send-email-andi@firstfloor.org \
    --to=andi@firstfloor.org \
    --cc=ak@linux.intel.com \
    --cc=eranian@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --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;
as well as URLs for NNTP newsgroup(s).