config_tools: capture the IOError exception

If no TURBO_RATIO_LIMIT and TURBO_ACTIVATION_RATIO MSRs info
on target, board inspector will crash because of the IOError exception.

This patch captures the IOError exception to handle this error.

Tracked-On: #8380
Signed-off-by: Kunhui-Li <kunhuix.li@intel.com>
Reviewed-by: Junjie Mao <junjie.mao@intel.com>
This commit is contained in:
Kunhui-Li 2023-04-26 13:13:08 +08:00 committed by acrnsi-robot
parent d83d0fed47
commit de188258f6
1 changed files with 6 additions and 3 deletions

View File

@ -72,9 +72,12 @@ def extract_model(processors_node, cpu_id, family_id, model_id, core_type, nativ
msr_regs = [MSR_TURBO_RATIO_LIMIT, MSR_TURBO_ACTIVATION_RATIO]
for msr_reg in msr_regs:
msr_data = msr_reg.rdmsr(cpu_id)
for attr in msr_data.attribute_bits:
add_child(n, "attribute", str(getattr(msr_data, attr)), id=attr)
try:
msr_data = msr_reg.rdmsr(cpu_id)
for attr in msr_data.attribute_bits:
add_child(n, "attribute", str(getattr(msr_data, attr)), id=attr)
except IOError:
logging.debug(f"No {msr_reg} MSR info for CPU {cpu_id}.")
def extract_topology(processors_node):
cpu_ids = get_online_cpu_ids()