Using a struct to store all NVM-related information

Signed-off-by: Maciej "Iwan" Iwanowski <maciej.iwanowski@intel.com>
This commit is contained in:
Maciej "Iwan" Iwanowski 2020-03-12 09:17:21 +01:00
parent 920cb80d65
commit 338904e6ed
No known key found for this signature in database
GPG Key ID: 2484258A4DD3EE84
2 changed files with 23 additions and 19 deletions

View File

@ -176,8 +176,7 @@ type MachineInfo struct {
// Memory capacity and number of DIMMs by memory type // Memory capacity and number of DIMMs by memory type
MemoryByType map[string]*MemoryInfo `json:"memory_by_type"` MemoryByType map[string]*MemoryInfo `json:"memory_by_type"`
// Average power budget for NVM devices configured in BIOS. NVMInfo NVMInfo `json:"nvm_info"`
NVMAvgPowerBudget uint `json:"nvm_avg_power_budget"`
// HugePages on this machine. // HugePages on this machine.
HugePages []HugePagesInfo `json:"hugepages"` HugePages []HugePagesInfo `json:"hugepages"`
@ -222,6 +221,11 @@ type MemoryInfo struct {
DimmCount uint `json:"dimm_count"` DimmCount uint `json:"dimm_count"`
} }
type NVMInfo struct {
// Average power budget for NVM devices configured in BIOS.
AvgPowerBudget uint `json:"avg_power_budget"`
}
type VersionInfo struct { type VersionInfo struct {
// Kernel version. // Kernel version.
KernelVersion string `json:"kernel_version"` KernelVersion string `json:"kernel_version"`

View File

@ -125,7 +125,7 @@ func Info(sysFs sysfs.SysFs, fsInfo fs.FsInfo, inHostNamespace bool) (*info.Mach
CpuFrequency: clockSpeed, CpuFrequency: clockSpeed,
MemoryCapacity: memoryCapacity, MemoryCapacity: memoryCapacity,
MemoryByType: memoryByType, MemoryByType: memoryByType,
NVMAvgPowerBudget: nvmPowerBudget, NVMInfo: info.NVMInfo{AvgPowerBudget: nvmPowerBudget},
HugePages: hugePagesInfo, HugePages: hugePagesInfo,
DiskMap: diskMap, DiskMap: diskMap,
NetworkDevices: netDevices, NetworkDevices: netDevices,