Update sst-compare-redfish-os.py for TPMI based CPUs
The output of `intel-speed-select` is slightly different for TPMI-based
CPUs. Filter out some unnecessary info and check two possible JSON keys
for the SSE turbo buckets.
Change-Id: Ia6ceadf36cfafcdd5f3c3eb4a759ea8bacd5763c
Signed-off-by: Jonathan Doman <jonathan.doman@intel.com>
diff --git a/tools/sst-compare-redfish-os.py b/tools/sst-compare-redfish-os.py
index 6318550..96d0ea0 100755
--- a/tools/sst-compare-redfish-os.py
+++ b/tools/sst-compare-redfish-os.py
@@ -25,6 +25,16 @@
success = True
+def filter_powerdomains(sst_data):
+ # For TPMI-based CPUs, we only care about powerdomain-0
+ cpus = list(sst_data.keys())
+ for proc in cpus:
+ match = re.search("powerdomain-(\\d+)", proc)
+ if not match or match.group(1) == "0":
+ continue
+ del sst_data[proc]
+
+
def get_linux_output():
cmd = [
"/usr/bin/env",
@@ -37,6 +47,7 @@
process = subprocess.run(cmd, capture_output=True, text=True)
process.check_returncode()
result = json.loads(process.stderr)
+ filter_powerdomains(result)
global linux_cpu_map
linux_cpu_map = dict()
@@ -57,6 +68,7 @@
]
process = subprocess.run(cmd, capture_output=True, text=True)
current_level = json.loads(process.stderr)
+ filter_powerdomains(current_level)
for proc, data in current_level.items():
result[proc].update(data)
@@ -149,7 +161,10 @@
(x["ActiveCoreCount"], x["MaxSpeedMHz"])
for x in redfish_config["TurboProfile"]
]
- linux_turbo = linux_config["turbo-ratio-limits-sse"]
+ linux_turbo = (
+ linux_config.get("turbo-ratio-limits-sse")
+ or linux_config["turbo-ratio-limits-level-0"]
+ )
exp_turbo = []
for bucket_key in sorted(linux_turbo.keys()):
bucket = linux_turbo[bucket_key]