cpu: Expose CPU microcode information

This commit exposes the CPU microcode information.

Signed-off-by: Simarpreet Singh <simar@opendns.com>
pull/325/head
Simarpreet Singh 8 years ago
parent 23f4b7eb14
commit 5a4c90ad5f

@ -133,6 +133,7 @@ Several methods have been added which are not present in psutil, but will provid
- Mhz - Mhz
- CacheSize - CacheSize
- Flags (ex: "fpu vme de pse tsc msr pae mce cx8 ...") - Flags (ex: "fpu vme de pse tsc msr pae mce cx8 ...")
- Microcode
- load/LoadAvg() (linux, freebsd) - load/LoadAvg() (linux, freebsd)
@ -262,6 +263,7 @@ hostname x x x x x
CoreID x CoreID x
Cores x x Cores x x
ModelName x x x x x ModelName x x x x x
Microcode x
**LoadAvg** **LoadAvg**
Load1 x x x x Load1 x x x x
Load5 x x x x Load5 x x x x

@ -40,6 +40,7 @@ type InfoStat struct {
Mhz float64 `json:"mhz"` Mhz float64 `json:"mhz"`
CacheSize int32 `json:"cacheSize"` CacheSize int32 `json:"cacheSize"`
Flags []string `json:"flags"` Flags []string `json:"flags"`
Microcode string `json:"microcode"`
} }
type lastPercent struct { type lastPercent struct {

@ -186,6 +186,8 @@ func Info() ([]InfoStat, error) {
c.Flags = strings.FieldsFunc(value, func(r rune) bool { c.Flags = strings.FieldsFunc(value, func(r rune) bool {
return r == ',' || r == ' ' return r == ',' || r == ' '
}) })
case "microcode":
c.Microcode = value
} }
} }
if c.CPU >= 0 { if c.CPU >= 0 {

Loading…
Cancel
Save