Merge pull request #10754 from containerd/dependabot/go_modules/github.com/intel/goresctrl-0.8.0
build(deps): bump github.com/intel/goresctrl from 0.7.0 to 0.8.0
This commit is contained in:
19
vendor/github.com/intel/goresctrl/pkg/utils/sysfs.go
generated
vendored
19
vendor/github.com/intel/goresctrl/pkg/utils/sysfs.go
generated
vendored
@@ -34,6 +34,10 @@ func setCPUFreqValue(cpu ID, setting string, value int) error {
|
||||
return writeFileInt(cpuFreqPath(cpu, setting), value)
|
||||
}
|
||||
|
||||
func SetCPUScalingGovernor(cpu ID, governor string) error {
|
||||
return writeFileStr(cpuFreqPath(cpu, "scaling_governor"), governor)
|
||||
}
|
||||
|
||||
// GetCPUFreqValue returns information of the currently used CPU frequency
|
||||
func GetCPUFreqValue(cpu ID, setting string) (int, error) {
|
||||
raw, err := os.ReadFile(cpuFreqPath(cpu, setting))
|
||||
@@ -63,6 +67,17 @@ func SetCPUScalingMaxFreq(cpu ID, freq int) error {
|
||||
return setCPUFreqValue(cpu, "scaling_max_freq", freq)
|
||||
}
|
||||
|
||||
// SetScalingGovernorForCPUs sets the scaling_governor of a given set of CPUs
|
||||
func SetScalingGovernorForCPUs(cpus []ID, governor string) error {
|
||||
for _, cpu := range cpus {
|
||||
if err := SetCPUScalingGovernor(cpu, governor); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// SetCPUsScalingMinFreq sets the scaling_min_freq value of a given set of CPUs
|
||||
func SetCPUsScalingMinFreq(cpus []ID, freq int) error {
|
||||
for _, cpu := range cpus {
|
||||
@@ -129,6 +144,10 @@ func writeFileInt(path string, value int) error {
|
||||
return os.WriteFile(path, []byte(strconv.Itoa(value)), 0644)
|
||||
}
|
||||
|
||||
func writeFileStr(path string, value string) error {
|
||||
return os.WriteFile(path, []byte(value), 0644)
|
||||
}
|
||||
|
||||
func readFileInt(path string) (int, error) {
|
||||
data, err := os.ReadFile(path)
|
||||
if err != nil {
|
||||
|
||||
2
vendor/modules.txt
vendored
2
vendor/modules.txt
vendored
@@ -317,7 +317,7 @@ github.com/grpc-ecosystem/grpc-gateway/v2/runtime
|
||||
github.com/grpc-ecosystem/grpc-gateway/v2/utilities
|
||||
# github.com/hashicorp/errwrap v1.1.0
|
||||
## explicit
|
||||
# github.com/intel/goresctrl v0.7.0
|
||||
# github.com/intel/goresctrl v0.8.0
|
||||
## explicit; go 1.20
|
||||
github.com/intel/goresctrl/pkg/blockio
|
||||
github.com/intel/goresctrl/pkg/kubernetes
|
||||
|
||||
Reference in New Issue
Block a user