mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: mingo@kernel.org, tglx@linutronix.de, ak@linux.intel.com,
	eranian@google.com, dzickus@redhat.com, andi@firstfloor.org,
	jmario@redhat.com, acme@kernel.org
Cc: linux-kernel@vger.kernel.org, Peter Zijlstra <peterz@infradead.org>
Subject: [PATCH 2/3] perf,x86: Sanitize HSW offcore events
Date: Tue, 28 Oct 2014 13:30:45 +0100	[thread overview]
Message-ID: <20141028123352.574638596@infradead.org> (raw)
In-Reply-To: <20141028123043.257488788@infradead.org>

[-- Attachment #1: peterz-hsw-offcore-fix-b.patch --]
[-- Type: text/plain, Size: 2589 bytes --]

Based on the actual HSW offcore bits, we can now construct the full LL
event set in a similar manner to the other uarchs (NHM/SNB).

Fixes: 86a349a28b24 ("perf/x86/intel: Add Broadwell core support")
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
---
 arch/x86/kernel/cpu/perf_event_intel.c |   30 ++++++++++++++++--------------
 1 file changed, 16 insertions(+), 14 deletions(-)

--- a/arch/x86/kernel/cpu/perf_event_intel.c
+++ b/arch/x86/kernel/cpu/perf_event_intel.c
@@ -459,20 +459,16 @@ static __initconst const u64 hsw_hw_cach
  },
  [ C(LL  ) ] = {
 	[ C(OP_READ) ] = {
-		/* OFFCORE_RESPONSE:ALL_DATA_RD|ALL_CODE_RD */
 		[ C(RESULT_ACCESS) ] = 0x1b7,
-		/* OFFCORE_RESPONSE:ALL_DATA_RD|ALL_CODE_RD|SUPPLIER_NONE|
-                   L3_MISS|ANY_SNOOP */
 		[ C(RESULT_MISS)   ] = 0x1b7,
 	},
 	[ C(OP_WRITE) ] = {
-		[ C(RESULT_ACCESS) ] = 0x1b7, 	/* OFFCORE_RESPONSE:ALL_RFO */
-		/* OFFCORE_RESPONSE:ALL_RFO|SUPPLIER_NONE|L3_MISS|ANY_SNOOP */
+		[ C(RESULT_ACCESS) ] = 0x1b7,
 		[ C(RESULT_MISS)   ] = 0x1b7,
 	},
 	[ C(OP_PREFETCH) ] = {
-		[ C(RESULT_ACCESS) ] = 0x0,
-		[ C(RESULT_MISS)   ] = 0x0,
+		[ C(RESULT_ACCESS) ] = 0x1b7,
+		[ C(RESULT_MISS)   ] = 0x1b7,
 	},
  },
  [ C(DTLB) ] = {
@@ -580,6 +576,13 @@ static __initconst const u64 hsw_hw_cach
 					 HSW_SNOOP_HIT_WITH_FWD|HSW_SNOOP_HITM|	\
 					 HSW_SNOOP_NON_DRAM)
 
+#define HSW_DMND_READ			(HSW_ALL_DATA_RD)
+#define HSW_DMND_WRITE			(HSW_ALL_RFO)
+#define HSW_DMND_PREFETCH		(HSW_ALL_PF_DATA_RD|HSW_ALL_PF_RFO)
+
+#define HSW_LLC_ACCESS			(HSW_ANY_RESPONSE)
+#define HSW_LLC_MISS			(HSW_L3_MISS)
+
 static __initconst const u64 hsw_hw_cache_extra_regs
 				[PERF_COUNT_HW_CACHE_MAX]
 				[PERF_COUNT_HW_CACHE_OP_MAX]
@@ -587,17 +590,16 @@ static __initconst const u64 hsw_hw_cach
 {
  [ C(LL  ) ] = {
 	[ C(OP_READ) ] = {
-		[ C(RESULT_ACCESS) ] = HSW_ALL_DATA_RD|HSW_ALL_CODE_RD,
-		[ C(RESULT_MISS)   ] = HSW_ALL_DATA_RD|HSW_ALL_CODE_RD|HSW_SUPPLIER_NONE|
-				       HSW_L3_MISS|HSW_ANY_SNOOP,
+		[ C(RESULT_ACCESS) ] = HSW_DMND_READ|HSW_LLC_ACCESS,
+		[ C(RESULT_MISS)   ] = HSW_DMND_READ|HSW_LLC_MISS,
 	},
 	[ C(OP_WRITE) ] = {
-		[ C(RESULT_ACCESS) ] = HSW_ALL_RFO,
-		[ C(RESULT_MISS)   ] = HSW_ALL_RFO|HSW_SUPPLIER_NONE|HSW_L3_MISS|HSW_ANY_SNOOP,
+		[ C(RESULT_ACCESS) ] = HSW_DMND_WRITE|HSW_LLC_ACCESS,
+		[ C(RESULT_MISS)   ] = HSW_DMND_WRITE|HSW_LLC_MISS,
 	},
 	[ C(OP_PREFETCH) ] = {
-		[ C(RESULT_ACCESS) ] = 0x0,
-		[ C(RESULT_MISS)   ] = 0x0,
+		[ C(RESULT_ACCESS) ] = HSW_DMND_PREFETCH|HSW_LLC_ACCESS,
+		[ C(RESULT_MISS)   ] = HSW_DMND_PREFETCH|HSW_LLC_MISS
 	},
  },
 };



  parent reply	other threads:[~2014-10-28 12:41 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-28 12:30 [PATCH 0/3] Cleanup of the HSW offcore bits Peter Zijlstra
2014-10-28 12:30 ` [PATCH 1/3] perf,x86: De-obfuscate " Peter Zijlstra
2014-10-28 13:04   ` Andi Kleen
2014-10-28 12:30 ` Peter Zijlstra [this message]
2014-10-28 12:30 ` [PATCH 3/3] perf,x86: Add HSW offcore NUMA events Peter Zijlstra
2014-10-28 13:10   ` 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=20141028123352.574638596@infradead.org \
    --to=peterz@infradead.org \
    --cc=acme@kernel.org \
    --cc=ak@linux.intel.com \
    --cc=andi@firstfloor.org \
    --cc=dzickus@redhat.com \
    --cc=eranian@google.com \
    --cc=jmario@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.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