Documentation
¶
Index ¶
- Constants
- func ParseFileEntries(path string, values map[string]interface{}, pickFn PickEntryFn) error
- func SstSupported() bool
- type CPPriorityType
- type CPU
- type CPUFreq
- type CPUPackage
- type Cache
- type CacheType
- type DiscoveryFlag
- type EPP
- type ID
- type IDSet
- func (s IDSet) Add(ids ...ID)
- func (s IDSet) CPUSet() cpuset.CPUSet
- func (s IDSet) Clone() IDSet
- func (s IDSet) Del(ids ...ID)
- func (s IDSet) Has(ids ...ID) bool
- func (s IDSet) MarshalJSON() ([]byte, error)
- func (s IDSet) Members() []ID
- func (s IDSet) Size() int
- func (s IDSet) SortedMembers() []ID
- func (s IDSet) String() string
- func (s IDSet) StringWithSeparator(args ...string) string
- func (s *IDSet) UnmarshalJSON(data []byte) error
- type MemInfo
- type MemoryType
- type Node
- type PickEntryFn
- type SstClosInfo
- type SstPackageInfo
- type System
Constants ¶
const ( M = (int64(1) << 20) G = (int64(1) << 30) T = (int64(1) << 40) )
unit multipliers
const ( ISST_IF_GET_PHY_ID = 0xc008fe01 ISST_IF_IO_CMD = 0x4008fe02 ISST_IF_MBOX_COMMAND = 0xc008fe03 )
const ( CONFIG_TDP = 0x7f CONFIG_TDP_GET_LEVELS_INFO = 0x0 CONFIG_TDP_GET_TDP_CONTROL = 0x1 CONFIG_TDP_SET_TDP_CONTROL = 0x2 CONFIG_TDP_GET_TDP_INFO = 0x3 CONFIG_TDP_GET_PWR_INFO = 0x4 CONFIG_TDP_GET_TJMAX_INFO = 0x5 CONFIG_TDP_GET_CORE_MASK = 0x6 CONFIG_TDP_GET_TURBO_LIMIT_RATIOS = 0x7 CONFIG_TDP_SET_LEVEL = 0x8 CONFIG_TDP_GET_UNCORE_P0_P1_INFO = 0x9 CONFIG_TDP_GET_P1_INFO = 0xa CONFIG_TDP_GET_MEM_FREQ = 0xb CONFIG_TDP_GET_FACT_HP_TURBO_LIMIT_NUMCORES = 0x10 CONFIG_TDP_GET_FACT_HP_TURBO_LIMIT_RATIOS = 0x11 CONFIG_TDP_GET_FACT_LP_CLIPPING_RATIO = 0x12 CONFIG_TDP_PBF_GET_CORE_MASK_INFO = 0x20 CONFIG_TDP_PBF_GET_P1HI_P1LO_INFO = 0x21 CONFIG_TDP_PBF_GET_TJ_MAX_INFO = 0x22 CONFIG_TDP_PBF_GET_TDP_INFO = 0x23 CONFIG_CLOS = 0xd0 CLOS_PM_QOS_CONFIG = 0x2 READ_PM_CONFIG = 0x94 WRITE_PM_CONFIG = 0x95 PM_FEATURE = 0x3 PM_QOS_INFO_OFFSET = 0x0 PM_QOS_CONFIG_OFFSET = 0x4 PM_CLOS_OFFSET = 0x8 PQR_ASSOC_OFFSET = 0x20 )
const NumClos = 4
NumClos is the number of CLOSes suported by SST-CP
const (
// SysfsRootPath is the mount path of sysfs.
SysfsRootPath = "/sys"
)
Variables ¶
This section is empty.
Functions ¶
func ParseFileEntries ¶
func ParseFileEntries(path string, values map[string]interface{}, pickFn PickEntryFn) error
ParseFileEntries parses a sysfs files for the given entries.
func SstSupported ¶ added in v0.5.0
func SstSupported() bool
SstSupported returns true if Intel Speed Select Technologies (SST) is supported by the system and can be interfaced via the Linux kernel device
Types ¶
type CPPriorityType ¶ added in v0.5.0
type CPPriorityType int
CPPriorityType denotes the type CLOS priority ordering used in SST-CP
const ( Proportional CPPriorityType = 0 Ordered CPPriorityType = 1 )
type CPU ¶
type CPU interface {
ID() ID
PackageID() ID
DieID() ID
NodeID() ID
CoreID() ID
ThreadCPUSet() cpuset.CPUSet
BaseFrequency() uint64
FrequencyRange() CPUFreq
EPP() EPP
Online() bool
Isolated() bool
SetFrequencyLimits(min, max uint64) error
SstClos() int
}
CPU is a CPU core.
type CPUFreq ¶
type CPUFreq struct {
// contains filtered or unexported fields
}
CPUFreq is a CPU frequency scaling range
type CPUPackage ¶
type CPUPackage interface {
ID() ID
CPUSet() cpuset.CPUSet
DieIDs() []ID
NodeIDs() []ID
DieNodeIDs(ID) []ID
DieCPUSet(ID) cpuset.CPUSet
SstInfo() SstPackageInfo
}
CPUPackage is a physical package (a collection of CPUs).
type Cache ¶
type Cache struct {
// contains filtered or unexported fields
}
Cache has details about cache.
type DiscoveryFlag ¶
type DiscoveryFlag uint
DiscoveryFlag controls what hardware details to discover.
const ( // DiscoverCPUTopology requests discovering CPU topology details. DiscoverCPUTopology DiscoveryFlag = 1 << iota // DiscoverMemTopology requests discovering memory topology details. DiscoverMemTopology // DiscoverCache requests discovering CPU cache details. DiscoverCache // DiscoverSst requests discovering details of Intel Speed Select Technology DiscoverSst // DiscoverNone is the zero value for discovery flags. DiscoverNone DiscoveryFlag = 0 // DiscoverAll requests full supported discovery. DiscoverAll DiscoveryFlag = 0xffffffff // DiscoverDefault is the default set of discovery flags. DiscoverDefault DiscoveryFlag = (DiscoverCPUTopology | DiscoverMemTopology | DiscoverSst) )
type EPP ¶ added in v0.5.0
type EPP int
EPP represents the value of a CPU energy performance profile
func EPPFromString ¶ added in v0.5.0
EPPFromString converts string to EPP value
type ID ¶
type ID int
ID is nn integer id, used to identify packages, CPUs, nodes, etc.
const ( // Unknown represents an unknown id. Unknown ID = -1 )
type IDSet ¶
type IDSet map[ID]struct{}
IDSet is an unordered set of integer ids.
func FromCPUSet ¶
FromCPUSet returns an id set corresponding to a cpuset.CPUSet.
func NewIDSetFromIntSlice ¶
NewIDSetFromIntSlice creates a new unordered set from an integer slice.
func (IDSet) MarshalJSON ¶
MarshalJSON is the JSON marshaller for IDSet.
func (IDSet) SortedMembers ¶
SortedMembers returns all ids in the set as a sorted slice.
func (IDSet) StringWithSeparator ¶
StringWithSeparator returns the set as a string, separated with the given separator.
func (*IDSet) UnmarshalJSON ¶
UnmarshalJSON is the JSON unmarshaller for IDSet.
type MemoryType ¶
type MemoryType int
MemoryType is an enum for the Node memory
const ( // MemoryTypeDRAM means that the node has regular DRAM-type memory MemoryTypeDRAM MemoryType = iota // MemoryTypePMEM means that the node has persistent memory MemoryTypePMEM // MemoryTypeHBM means that the node has high bandwidth memory MemoryTypeHBM )
type Node ¶
type Node interface {
ID() ID
PackageID() ID
DieID() ID
CPUSet() cpuset.CPUSet
Distance() []int
DistanceFrom(id ID) int
MemoryInfo() (*MemInfo, error)
GetMemoryType() MemoryType
HasNormalMemory() bool
}
Node represents a NUMA node.
type PickEntryFn ¶
PickEntryFn picks a given input line apart into an entry of key and value.
type SstClosInfo ¶ added in v0.5.0
type SstClosInfo struct {
EPP int
ProportionalPriority int
MinFreq int
MaxFreq int
DesiredFreq int
}
SstClosInfo contains parameters of one CLOS of SST-CP
type SstPackageInfo ¶ added in v0.5.0
type SstPackageInfo struct {
// Gereric PP info
PPSupported bool
PPLocked bool
PPVersion int
PPCurrentLevel int
PPMaxLevel int
// Information about the currently active PP level
CPSupported bool
CPEnabled bool
CPPriority CPPriorityType
BFSupported bool
BFEnabled bool
BFCores IDSet
TFSupported bool
TFEnabled bool
ClosInfo [NumClos]SstClosInfo
}
SstPackageInfo contains status of Intel Speed Select Technologies (SST) for one CPU package
type System ¶
type System interface {
Discover(flags DiscoveryFlag) error
SetCpusOnline(online bool, cpus IDSet) (IDSet, error)
SetCPUFrequencyLimits(min, max uint64, cpus IDSet) error
PackageIDs() []ID
NodeIDs() []ID
CPUIDs() []ID
PackageCount() int
SocketCount() int
CPUCount() int
NUMANodeCount() int
ThreadCount() int
CPUSet() cpuset.CPUSet
Package(id ID) CPUPackage
Node(id ID) Node
NodeDistance(from, to ID) int
CPU(id ID) CPU
Offlined() cpuset.CPUSet
Isolated() cpuset.CPUSet
}
System devices
func DiscoverSystem ¶
func DiscoverSystem(args ...DiscoveryFlag) (System, error)
DiscoverSystem performs discovery of the running systems details.
func DiscoverSystemAt ¶
func DiscoverSystemAt(path string, args ...DiscoveryFlag) (System, error)
DiscoverSystemAt performs discovery of the running systems details from sysfs mounted at path.