diff options
author | Kan Liang <kan.liang@linux.intel.com> | 2024-06-14 06:46:26 -0700 |
---|---|---|
committer | Peter Zijlstra <peterz@infradead.org> | 2024-06-17 17:57:56 +0200 |
commit | 585463fee64270d4b4d80b1e433d2105ef555bec (patch) | |
tree | 1c00ce90a74eb70707d2a42a4327284b86dfe4aa | |
parent | c74443d92f68f07c03ae242ced554b749e6c6736 (diff) |
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
-rw-r--r-- | arch/x86/events/intel/uncore.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/arch/x86/events/intel/uncore.c b/arch/x86/events/intel/uncore.c index f699606cf5fc..08e85dbabd49 100644 --- a/arch/x86/events/intel/uncore.c +++ b/arch/x86/events/intel/uncore.c @@ -862,6 +862,9 @@ static const struct attribute_group uncore_pmu_attr_group = { static inline int uncore_get_box_id(struct intel_uncore_type *type, struct intel_uncore_pmu *pmu) { + if (type->boxes) + return intel_uncore_find_discovery_unit_id(type->boxes, -1, pmu->pmu_idx); + return type->box_ids ? type->box_ids[pmu->pmu_idx] : pmu->pmu_idx; } |