From b5b22bf98b6fa820c4117a1cfeb253c5714c16de Mon Sep 17 00:00:00 2001 From: Junjie Mao Date: Sat, 29 Jan 2022 17:40:25 +0800 Subject: [PATCH] board_inspector: avoid hard-coded topo level names While the terms to refer to CPU topology levels are originally borrowed from MSR listings in SDMs (i.e. thread, core, die and package), we now align the topology information with the CPUID topology enumeration leaf (which does not have a "package" level) in the implementation. However, some hard-coded level types are not updated accordingly, leading to strangely organized nodes in the generated board XML. This patch refines the CPU extractor of the board inspector by removing such hard code. Also the XPATH counting the total number of threads is refined to tolerate the variance of reported intermediate levels. Tracked-On: #6689 Signed-off-by: Junjie Mao --- misc/config_tools/board_inspector/extractors/10-processors.py | 4 ++-- misc/config_tools/xforms/board_info.h.xsl | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/misc/config_tools/board_inspector/extractors/10-processors.py b/misc/config_tools/board_inspector/extractors/10-processors.py index 77612bd32..e6c504bce 100644 --- a/misc/config_tools/board_inspector/extractors/10-processors.py +++ b/misc/config_tools/board_inspector/extractors/10-processors.py @@ -74,8 +74,8 @@ def extract_topology(processors_node): while True: leaf_topo = parse_cpuid(topo_leaf, subleaf, cpu_id) if leaf_topo.level_type == 0: - if last_node.tag != "package": - n, _ = get_or_create_parent(processors_node, "die", "0") + if last_node.tag != level_types[-1]: + n, _ = get_or_create_parent(processors_node, level_types[-1], "0x0") n.append(last_node) last_node = n processors_node.append(last_node) diff --git a/misc/config_tools/xforms/board_info.h.xsl b/misc/config_tools/xforms/board_info.h.xsl index 87da38ce4..5018aeef6 100644 --- a/misc/config_tools/xforms/board_info.h.xsl +++ b/misc/config_tools/xforms/board_info.h.xsl @@ -61,7 +61,7 @@ - +