Commit bc88a2fe authored by Kan Liang's avatar Kan Liang Committed by Peter Zijlstra

perf/x86/intel/uncore: Add box_offsets for free-running counters

The offset between uncore boxes of free-running counters varies, e.g.
IIO free-running counters on Ice Lake server.

Add box_offsets, an array of offsets between adjacent uncore boxes.
Signed-off-by: default avatarKan Liang <kan.liang@linux.intel.com>
Signed-off-by: default avatarPeter Zijlstra (Intel) <peterz@infradead.org>
Link: https://lkml.kernel.org/r/1584470314-46657-1-git-send-email-kan.liang@linux.intel.com
parent a6763625
...@@ -154,6 +154,7 @@ struct freerunning_counters { ...@@ -154,6 +154,7 @@ struct freerunning_counters {
unsigned int box_offset; unsigned int box_offset;
unsigned int num_counters; unsigned int num_counters;
unsigned int bits; unsigned int bits;
unsigned *box_offsets;
}; };
struct pci2phy_map { struct pci2phy_map {
...@@ -310,7 +311,9 @@ unsigned int uncore_freerunning_counter(struct intel_uncore_box *box, ...@@ -310,7 +311,9 @@ unsigned int uncore_freerunning_counter(struct intel_uncore_box *box,
return pmu->type->freerunning[type].counter_base + return pmu->type->freerunning[type].counter_base +
pmu->type->freerunning[type].counter_offset * idx + pmu->type->freerunning[type].counter_offset * idx +
pmu->type->freerunning[type].box_offset * pmu->pmu_idx; (pmu->type->freerunning[type].box_offsets ?
pmu->type->freerunning[type].box_offsets[pmu->pmu_idx] :
pmu->type->freerunning[type].box_offset * pmu->pmu_idx);
} }
static inline static inline
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment