cpu

package
v0.0.0-...-8365721 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2017 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// SysCPU is the path to cpu devices in linux
	SysCPU = "/sys/devices/system/cpu"
	// CPUInfoPath is the path to cpu info in /proc
	CPUInfoPath = "/proc/cpuinfo"
)

Variables

This section is empty.

Functions

func GetMicroArch

func GetMicroArch(sig uint32) string

GetMicroArch returns micro arch

func GetSignature

func GetSignature() uint32

GetSignature returns Signature of the processor ignore stepping and processor type. NOTE, Guess all cpus in one hose are same microarch

func HostCPUNum

func HostCPUNum() int

HostCPUNum returns the total cpu number of host REF: https://www.kernel.org/doc/Documentation/cputopology.txt another way is call sysconf via cgo, like libpqos

func IsolatedCPUs

func IsolatedCPUs() string

IsolatedCPUs returns isolated CPUs. The result will be as follow: 2-21,24-43,46-65,68-87 This result can generate a Bitmap

func LocateOnNode

func LocateOnNode(cpuid string) string

LocateOnNode return the cpus on which node.

func LocateOnSocket

func LocateOnSocket(cpuid string) (id string, err error)

LocateOnSocket return the cpus on which socket.

func NewCPUMap

func NewCPUMap() map[uint32]string

NewCPUMap init internal cpu map Concurrency safe.

Types

This section is empty.

Jump to

Keyboard shortcuts

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