Documentation ¶
Index ¶
- Constants
- Variables
- func GetCPUAffinity(Pid string) (*util.Bitmap, error)
- func IsCdpAvailiable() (bool, error)
- func IsCqmAvailiable() (bool, error)
- func IsEnableCat() bool
- func IsEnableCdp() bool
- func IsEnableRdt() bool
- func IsRdtAvailiable() (bool, error)
- func SetCPUAffinity(Pid string, cpus *util.Bitmap) error
- type Process
Constants ¶
View Source
const ( // CPUInfoPath is the patch to cpuinfo CPUInfoPath = "/proc/cpuinfo" // MountInfoPath is the mount info path MountInfoPath = "/proc/self/mountinfo" // ResctrlPath is the patch to resctrl ResctrlPath = "/sys/fs/resctrl" )
Variables ¶
View Source
var ListProcesses = func() map[string]Process { processes := make(map[string]Process) files, _ := filepath.Glob("/proc/[0-9]*/cmdline") for _, file := range files { listfs := strings.Split(file, "/") if pid, err := strconv.Atoi(listfs[2]); err == nil { cmd, _ := ioutil.ReadFile(file) cmdString := strings.Join(strings.Split(string(cmd), "\x00"), " ") processes[listfs[2]] = Process{pid, cmdString} } } return processes }
ListProcesses returns all process on the host
Functions ¶
func GetCPUAffinity ¶
GetCPUAffinity returns the affinity of a given task id
func IsCdpAvailiable ¶
IsCdpAvailiable returns CDP feature available or not
func IsCqmAvailiable ¶
IsCqmAvailiable returns CMT feature available or not
func IsRdtAvailiable ¶
IsRdtAvailiable returns RDT feature available or not
Types ¶
Click to show internal directories.
Click to hide internal directories.