Merge pull request #2376 from liupeng0518/master
Ignore CPU clock for mips64
This commit is contained in:
commit
f43a87b444
@ -54,8 +54,8 @@ const nodePath = "/sys/devices/system/node"
|
||||
|
||||
// GetClockSpeed returns the CPU clock speed, given a []byte formatted as the /proc/cpuinfo file.
|
||||
func GetClockSpeed(procInfo []byte) (uint64, error) {
|
||||
// s390/s390x, riscv64, aarch64 and arm32 changes
|
||||
if isSystemZ() || isAArch64() || isArm32() || isRiscv64() {
|
||||
// s390/s390x, mips64, riscv64, aarch64 and arm32 changes
|
||||
if isMips64() || isSystemZ() || isAArch64() || isArm32() || isRiscv64() {
|
||||
return 0, nil
|
||||
}
|
||||
|
||||
@ -457,6 +457,15 @@ func isRiscv64() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// mips64 changes
|
||||
func isMips64() bool {
|
||||
arch, err := getMachineArch()
|
||||
if err == nil {
|
||||
return strings.Contains(arch, "mips64")
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
// s390/s390x changes
|
||||
func getNumCores() int {
|
||||
maxProcs := runtime.GOMAXPROCS(0)
|
||||
|
Loading…
Reference in New Issue
Block a user