Skip to content

Commit 6654d34

Browse files
committed
source/cpu: suppress cpufreq related error if driver is not enabled
1 parent c42c8db commit 6654d34

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

source/cpu/pstate_amd64.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,11 @@ func detectPstate() (map[string]string, error) {
7272
cpufreqDir := filepath.Join(sysfsBase, "cpufreq")
7373
policies, err := os.ReadDir(cpufreqDir)
7474
if err != nil {
75-
klog.ErrorS(err, "failed to read cpufreq directory")
75+
if os.IsNotExist(err) {
76+
klog.V(2).InfoS("cpufreq driver not enabled")
77+
} else {
78+
klog.ErrorS(err, "failed to read cpufreq directory")
79+
}
7680
return features, nil
7781
}
7882

0 commit comments

Comments
 (0)