This commit is contained in:
spiritlhl
2024-05-06 08:06:36 +00:00
parent 1899106322
commit a9b357ef0c

View File

@@ -86,7 +86,7 @@ func getCpuInfo(ret *model.SystemInfo, cpuType string) (*model.SystemInfo, error
} else if strings.Contains(fields[0], "cache size") { } else if strings.Contains(fields[0], "cache size") {
ret.CpuCache = strings.TrimSpace(strings.Join(fields[1:], " ")) ret.CpuCache = strings.TrimSpace(strings.Join(fields[1:], " "))
} else if strings.Contains(fields[0], "cpu MHz") { } else if strings.Contains(fields[0], "cpu MHz") {
ret.CpuCache += " @ " + strings.TrimSpace(strings.Join(fields[1:], " ")) + " MHz" ret.CpuModel += " @ " + strings.TrimSpace(strings.Join(fields[1:], " ")) + " MHz"
} }
} }
} }
@@ -104,6 +104,8 @@ func getCpuInfo(ret *model.SystemInfo, cpuType string) (*model.SystemInfo, error
if len(fields) >= 2 { if len(fields) >= 2 {
if strings.Contains(fields[0], "Model name") { if strings.Contains(fields[0], "Model name") {
ret.CpuModel = strings.TrimSpace(strings.Join(fields[1:], " ")) ret.CpuModel = strings.TrimSpace(strings.Join(fields[1:], " "))
} else if strings.Contains(fields[0], "CPU MHz") {
ret.CpuModel += " @ " + strings.TrimSpace(strings.Join(fields[1:], " ")) + " MHz"
} else if strings.Contains(fields[0], "L1d cache") { } else if strings.Contains(fields[0], "L1d cache") {
L1dcache = strings.TrimSpace(strings.Join(fields[1:], " ")) L1dcache = strings.TrimSpace(strings.Join(fields[1:], " "))
} else if strings.Contains(fields[0], "L1i cache") { } else if strings.Contains(fields[0], "L1i cache") {