Allow clock field in /proc/cpuinfo as cpu MHz fallback value

Needed on ppc64le debian porter boxes atleast.

See #230
pull/269/head
Andreas Henriksson 9 years ago committed by Andreas Henriksson
parent fc800d3fb4
commit 9d51bfe3bb

@ -152,9 +152,9 @@ func Info() ([]InfoStat, error) {
return ret, err
}
c.Stepping = int32(t)
case "cpu MHz":
case "cpu MHz", "clock":
// treat this as the fallback value, thus we ignore error
if t, err := strconv.ParseFloat(value, 64); err == nil {
if t, err := strconv.ParseFloat(strings.Replace(value, "MHz", "", 1), 64); err == nil {
c.Mhz = t
}
case "cache size":

Loading…
Cancel
Save