Skip to content

Commit 585463f

Browse files
Kan LiangPeter Zijlstra
authored andcommitted
perf/x86/uncore: Retrieve the unit ID from the unit control RB tree
The box_ids only save the unit ID for the first die. If a unit, e.g., a CXL unit, doesn't exist in the first die. The unit ID cannot be retrieved. The unit control RB tree also stores the unit ID information. Retrieve the unit ID from the unit control RB tree Signed-off-by: Kan Liang <kan.liang@linux.intel.com> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Tested-by: Yunying Sun <yunying.sun@intel.com> Link: https://lore.kernel.org/r/20240614134631.1092359-4-kan.liang@linux.intel.com
1 parent c74443d commit 585463f

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

arch/x86/events/intel/uncore.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -862,6 +862,9 @@ static const struct attribute_group uncore_pmu_attr_group = {
862862
static inline int uncore_get_box_id(struct intel_uncore_type *type,
863863
struct intel_uncore_pmu *pmu)
864864
{
865+
if (type->boxes)
866+
return intel_uncore_find_discovery_unit_id(type->boxes, -1, pmu->pmu_idx);
867+
865868
return type->box_ids ? type->box_ids[pmu->pmu_idx] : pmu->pmu_idx;
866869
}
867870

0 commit comments

Comments
 (0)