File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -90,11 +90,6 @@ func GetSockets(procInfo []byte) int {
90
90
91
91
// GetClockSpeed returns the CPU clock speed, given a []byte formatted as the /proc/cpuinfo file.
92
92
func GetClockSpeed (procInfo []byte ) (uint64 , error ) {
93
- // s390/s390x, mips64, riscv64, aarch64 and arm32 changes
94
- if isMips64 () || isSystemZ () || isAArch64 () || isArm32 () || isRiscv64 () {
95
- return 0 , nil
96
- }
97
-
98
93
// First look through sys to find a max supported cpu frequency.
99
94
if utils .FileExists (maxFreqFile ) {
100
95
val , err := ioutil .ReadFile (maxFreqFile )
@@ -108,6 +103,11 @@ func GetClockSpeed(procInfo []byte) (uint64, error) {
108
103
}
109
104
return maxFreq , nil
110
105
}
106
+ // s390/s390x, mips64, riscv64, aarch64 and arm32 changes
107
+ if isMips64 () || isSystemZ () || isAArch64 () || isArm32 () || isRiscv64 () {
108
+ return 0 , nil
109
+ }
110
+
111
111
// Fall back to /proc/cpuinfo
112
112
matches := cpuClockSpeedMHz .FindSubmatch (procInfo )
113
113
if len (matches ) != 2 {
You can’t perform that action at this time.
0 commit comments