Skip to content

Commit

Permalink
perf/x86/intel/uncore: Add box_offsets for free-running counters
Browse files Browse the repository at this point in the history
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 <kan.liang@linux.intel.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://lkml.kernel.org/r/1584470314-46657-1-git-send-email-kan.liang@linux.intel.com
  • Loading branch information
Kan Liang authored and Peter Zijlstra committed Mar 20, 2020
1 parent a676362 commit bc88a2f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion arch/x86/events/intel/uncore.h
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ struct freerunning_counters {
unsigned int box_offset;
unsigned int num_counters;
unsigned int bits;
unsigned *box_offsets;
};

struct pci2phy_map {
Expand Down Expand Up @@ -310,7 +311,9 @@ unsigned int uncore_freerunning_counter(struct intel_uncore_box *box,

return pmu->type->freerunning[type].counter_base +
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
Expand Down

0 comments on commit bc88a2f

Please sign in to comment.