Skip to content

Commit 24cf846

Browse files
Stephane EranianIngo Molnar
authored andcommitted
perf/x86/intel/uncore: Handle non-standard counter offset
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 <[email protected]> Signed-off-by: Kan Liang <[email protected]> Signed-off-by: Peter Zijlstra (Intel) <[email protected]> Cc: Alexander Shishkin <[email protected]> Cc: Arnaldo Carvalho de Melo <[email protected]> Cc: Jiri Olsa <[email protected]> Cc: Linus Torvalds <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Thomas Gleixner <[email protected]> Cc: Vince Weaver <[email protected]> Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Ingo Molnar <[email protected]>
1 parent 68ce4a0 commit 24cf846

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

arch/x86/events/intel/uncore.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,7 @@ struct intel_uncore_box {
120120
};
121121

122122
#define UNCORE_BOX_FLAG_INITIATED 0
123+
#define UNCORE_BOX_FLAG_CTL_OFFS8 1 /* event config registers are 8-byte apart */
123124

124125
struct uncore_event_desc {
125126
struct kobj_attribute attr;
@@ -172,6 +173,9 @@ static inline unsigned uncore_pci_fixed_ctr(struct intel_uncore_box *box)
172173
static inline
173174
unsigned uncore_pci_event_ctl(struct intel_uncore_box *box, int idx)
174175
{
176+
if (test_bit(UNCORE_BOX_FLAG_CTL_OFFS8, &box->flags))
177+
return idx * 8 + box->pmu->type->event_ctl;
178+
175179
return idx * 4 + box->pmu->type->event_ctl;
176180
}
177181

0 commit comments

Comments
 (0)