package utils
import "github.com/intel/goresctrl/pkg/utils"
Index ¶
- Constants
- func DumpJSON(r interface{}) string
- func GetCPUFreqValue(cpu ID, setting string) (int, error)
- func ReadMSR(cpu ID, msr int64) (uint64, error)
- func SetCPUScalingGovernor(cpu ID, governor string) error
- func SetCPUScalingMaxFreq(cpu ID, freq int) error
- func SetCPUScalingMinFreq(cpu ID, freq int) error
- func SetCPUsScalingMaxFreq(cpus []ID, freq int) error
- func SetCPUsScalingMinFreq(cpus []ID, freq int) error
- func SetScalingGovernorForCPUs(cpus []ID, governor string) error
- func SetUncoreMaxFreq(pkg, die ID, freqKhz int) error
- func SetUncoreMinFreq(pkg, die ID, freqKhz int) error
- func SortUint64s(a []uint64)
- func UncoreFreqAvailable() bool
- type ID
- type IDSet
- func NewIDSet(ids ...ID) IDSet
- func NewIDSetFromIntSlice(ids ...int) IDSet
- func (s IDSet) Add(ids ...ID)
- 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 Uint64Slice
Constants ¶
const ( SysfsUncoreBasepath = "sys/devices/system/cpu/intel_uncore_frequency" SysfsCpuBasepath = "sys/devices/system/cpu" )
Functions ¶
func DumpJSON ¶
func DumpJSON(r interface{}) string
DumpJSON dumps a json-compatible struct in human-readable form
func GetCPUFreqValue ¶
GetCPUFreqValue returns information of the currently used CPU frequency
func ReadMSR ¶
func SetCPUScalingGovernor ¶
func SetCPUScalingMaxFreq ¶
SetCPUScalingMaxFreq sets the scaling_max_freq value of a given CPU
func SetCPUScalingMinFreq ¶
SetCPUScalingMinFreq sets the scaling_min_freq value of a given CPU
func SetCPUsScalingMaxFreq ¶
SetCPUsScalingMaxFreq sets the scaling_max_freq value of a given set of CPUs
func SetCPUsScalingMinFreq ¶
SetCPUsScalingMinFreq sets the scaling_min_freq value of a given set of CPUs
func SetScalingGovernorForCPUs ¶
SetScalingGovernorForCPUs sets the scaling_governor of a given set of CPUs
func SetUncoreMaxFreq ¶
SetUncoreMaxFreq sets the maximum uncore frequency of a CPU die. Frequency is specified in kHz.
func SetUncoreMinFreq ¶
SetUncoreMinFreq sets the minimum uncore frequency of a CPU die. Frequency is specified in kHz.
func SortUint64s ¶
func SortUint64s(a []uint64)
SortUint64s sorts a slice of uint64 in increasing order.
func UncoreFreqAvailable ¶
func UncoreFreqAvailable() bool
UncoreFreqAvailable returns true if the uncore frequency control functions are available.
Types ¶
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 NewIDSet ¶
NewIDSet creates a new unordered set of (integer) ids.
func NewIDSetFromIntSlice ¶
NewIDSetFromIntSlice creates a new unordered set from an integer slice.
func (IDSet) Add ¶
Add adds the given ids into the set.
func (IDSet) Clone ¶
Clone returns a copy of this IdSet.
func (IDSet) Del ¶
Del deletes the given ids from the set.
func (IDSet) Has ¶
Has tests if all the ids are present in the set.
func (IDSet) MarshalJSON ¶
MarshalJSON is the JSON marshaller for IDSet.
func (IDSet) Members ¶
Members returns all ids in the set as a randomly ordered slice.
func (IDSet) Size ¶
Size returns the number of ids in the set.
func (IDSet) SortedMembers ¶
SortedMembers returns all ids in the set as a sorted slice.
func (IDSet) String ¶
String returns the set as a string.
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 Uint64Slice ¶
type Uint64Slice []uint64
Uint64Slice implmenents sort.Interface for a slice of uint64.
func (Uint64Slice) Len ¶
func (s Uint64Slice) Len() int
Len returns the length of an UintSlice
func (Uint64Slice) Less ¶
func (s Uint64Slice) Less(i, j int) bool
Less returns true if element at 'i' is less than the element at 'j'
func (Uint64Slice) Swap ¶
func (s Uint64Slice) Swap(i, j int)
Swap swaps the values of two elements
Source Files ¶
idset.go json.go msr.go sort.go sysfs.go
- Version
- v0.8.0 (latest)
- Published
- Sep 19, 2024
- Platform
- linux/amd64
- Imports
- 9 packages
- Last checked
- 2 days ago –
Tools for package owners.