Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1461466 > unrolled thread

[PATCH 2/3] perf/x86/intel/uncore: handle non-standard counter offset

Started byKan Liang <kan.liang@intel.com>
First post2016-08-12 23:40 +0200
Last post2016-08-12 23:40 +0200
Articles 1 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH 2/3] perf/x86/intel/uncore: handle non-standard counter offset Kan Liang <kan.liang@intel.com> - 2016-08-12 23:40 +0200

#1461466 — [PATCH 2/3] perf/x86/intel/uncore: handle non-standard counter offset

FromKan Liang <kan.liang@intel.com>
Date2016-08-12 23:40 +0200
Subject[PATCH 2/3] perf/x86/intel/uncore: handle non-standard counter offset
Message-ID<s5slj-7eH-5@gated-at.bofh.it>
From: Stephane Eranian <eranian@google.com>

The offset of the counters for UPI and M2M boxes on Skylake server is
non-standard (8 bytes apart).

This patch introduces a custom flag UNCORE_BOX_FLAG_CTL_OFFS8 to
specially handle it.

Signed-off-by: Stephane Eranian <eranian@google.com>
Signed-off-by: Kan Liang <kan.liang@intel.com>
---
 arch/x86/events/intel/uncore.h | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/arch/x86/events/intel/uncore.h b/arch/x86/events/intel/uncore.h
index 78b9c23..a43175f 100644
--- a/arch/x86/events/intel/uncore.h
+++ b/arch/x86/events/intel/uncore.h
@@ -120,6 +120,7 @@ struct intel_uncore_box {
 };
 
 #define UNCORE_BOX_FLAG_INITIATED	0
+#define UNCORE_BOX_FLAG_CTL_OFFS8	1 /* event config registers are 8-byte apart */
 
 struct uncore_event_desc {
 	struct kobj_attribute attr;
@@ -172,6 +173,9 @@ static inline unsigned uncore_pci_fixed_ctr(struct intel_uncore_box *box)
 static inline
 unsigned uncore_pci_event_ctl(struct intel_uncore_box *box, int idx)
 {
+	if (test_bit(UNCORE_BOX_FLAG_CTL_OFFS8, &box->flags))
+		return idx * 8 + box->pmu->type->event_ctl;
+
 	return idx * 4 + box->pmu->type->event_ctl;
 }
 
-- 
2.5.5

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web