Merge pull request #274 from leitao/master
Improve CPU identification for POWER processors
This commit is contained in:
commit
6f43e5d707
|
@ -144,10 +144,22 @@ func Info() ([]InfoStat, error) {
|
|||
c.Family = value
|
||||
case "model":
|
||||
c.Model = value
|
||||
case "model name":
|
||||
case "model name", "cpu":
|
||||
c.ModelName = value
|
||||
case "stepping":
|
||||
t, err := strconv.ParseInt(value, 10, 64)
|
||||
if strings.Contains(value, "POWER8") ||
|
||||
strings.Contains(value, "POWER7") {
|
||||
c.Model = strings.Split(value, " ")[0]
|
||||
c.Family = "POWER"
|
||||
c.VendorID = "IBM"
|
||||
}
|
||||
case "stepping", "revision":
|
||||
val := value
|
||||
|
||||
if key == "revision" {
|
||||
val = strings.Split(value, ".")[0]
|
||||
}
|
||||
|
||||
t, err := strconv.ParseInt(val, 10, 64)
|
||||
if err != nil {
|
||||
return ret, err
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue