Skip to content

Commit bc88a2f

Browse files
Kan LiangPeter Zijlstra
authored andcommitted
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: Kan Liang <[email protected]> Signed-off-by: Peter Zijlstra (Intel) <[email protected]> Link: https://lkml.kernel.org/r/[email protected]
1 parent a676362 commit bc88a2f

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

arch/x86/events/intel/uncore.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,7 @@ struct freerunning_counters {
154154
unsigned int box_offset;
155155
unsigned int num_counters;
156156
unsigned int bits;
157+
unsigned *box_offsets;
157158
};
158159

159160
struct pci2phy_map {
@@ -310,7 +311,9 @@ unsigned int uncore_freerunning_counter(struct intel_uncore_box *box,
310311

311312
return pmu->type->freerunning[type].counter_base +
312313
pmu->type->freerunning[type].counter_offset * idx +
313-
pmu->type->freerunning[type].box_offset * pmu->pmu_idx;
314+
(pmu->type->freerunning[type].box_offsets ?
315+
pmu->type->freerunning[type].box_offsets[pmu->pmu_idx] :
316+
pmu->type->freerunning[type].box_offset * pmu->pmu_idx);
314317
}
315318

316319
static inline

0 commit comments

Comments
 (0)