build(deps): bump github.com/intel/goresctrl from 0.7.0 to 0.8.0
Bumps [github.com/intel/goresctrl](https://github.com/intel/goresctrl) from 0.7.0 to 0.8.0. - [Release notes](https://github.com/intel/goresctrl/releases) - [Commits](https://github.com/intel/goresctrl/compare/v0.7.0...v0.8.0) --- updated-dependencies: - dependency-name: github.com/intel/goresctrl dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com>
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 {
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user