sysinfo

package
v0.3.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 23, 2021 License: Apache-2.0 Imports: 6 Imported by: 2

Documentation

Index

Constants

View Source
const (
	SysDevicesOnlineCPUs = "/sys/devices/system/cpu/online"
)

Variables

This section is empty.

Functions

func GetCPUResources

func GetCPUResources(resCPUs string, getCPUs func() (cpuset.CPUSet, error)) (cpuset.CPUSet, error)

func GetOnlineCPUs

func GetOnlineCPUs() (cpuset.CPUSet, error)

func GetPCIDevices

func GetPCIDevices() ([]*pci.Device, error)

func GetPCIResources

func GetPCIResources(resourceMap map[string]string, getPCIs func() ([]*pci.Device, error)) (map[string]PerNUMADevices, error)

func ResourceNameForDevice

func ResourceNameForDevice(dev *pci.Device, resourceMap map[string]string) (string, bool)

Types

type Config

type Config struct {
	ReservedCPUs string
	// vendor:device -> resourcename
	ResourceMapping map[string]string
}

func (Config) IsEmpty

func (cfg Config) IsEmpty() bool

type PerNUMADevices

type PerNUMADevices map[int][]string

NUMA Cell -> deviceIDs

type SysInfo

type SysInfo struct {
	CPUs cpuset.CPUSet
	// resource name -> devices
	Resources map[string]PerNUMADevices
}

func NewSysinfo

func NewSysinfo(conf Config) (SysInfo, error)

func (SysInfo) String

func (si SysInfo) String() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL