CPU (Linux): fixes speed detection on s390x

Fixes #2129
This commit is contained in:
Carter Li
2026-01-05 10:50:55 +08:00
parent b21f35e914
commit 18c3cd2e66
+3 -4
View File
@@ -469,9 +469,9 @@ static const char* parseCpuInfo(
(cpuIsa->length == 0 && ffParsePropLine(line, "isa :", cpuIsa)) ||
(cpuUarch->length == 0 && ffParsePropLine(line, "uarch :", cpuUarch)) ||
#elif __s390x__
(cpu->name.length == 0 && ffParsePropLine(line, "processor 0:", &cpu->name)) ||
(cpu->name.length == 0 && ffParsePropLine(line, "machine :", &cpu->name)) ||
(cpu->vendor.length == 0 && ffParsePropLine(line, "vendor_id :", &cpu->vendor)) ||
(cpuMHz->length == 0 && ffParsePropLine(line, "cpu MHz static :", cpuMHz)) || // This one cannot be detected because of early return
(cpuMHz->length == 0 && ffParsePropLine(line, "cpu MHz static :", cpuMHz)) ||
#elif __ia64__
(cpu->name.length == 0 && ffParsePropLine(line, "model name :", &cpu->name)) ||
(cpu->vendor.length == 0 && ffParsePropLine(line, "vendor :", &cpu->vendor)) ||
@@ -931,8 +931,7 @@ FF_MAYBE_UNUSED static const char* detectCPUOthers(const FFCPUOptions* options,
cpu->coresPhysical = getLoongarchPropCount(&cpuinfo, "\ncore\t\t\t:");
if (cpu->packages > 1) cpu->coresPhysical *= cpu->packages;
#elif __s390x__
if (ffStrbufSubstrAfterFirstS(&cpu->name, "machine = "))
ffStrbufPrependS(&cpu->name, "Machine ");
if (cpu->name.length) ffStrbufPrependS(&cpu->name, "Machine ");
#endif
}