Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions machine/machine.go
Original file line number Diff line number Diff line change
Expand Up @@ -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, aarch64 and arm32 changes
if isSystemZ() || isAArch64() || isArm32() {
// s390/s390x, riscv64, aarch64 and arm32 changes
if isSystemZ() || isAArch64() || isArm32() || isRiscv64() {
return 0, nil
}

Expand Down Expand Up @@ -448,6 +448,15 @@ func isSystemZ() bool {
return false
}

// riscv64 changes
func isRiscv64() bool {
arch, err := getMachineArch()
if err == nil {
return strings.Contains(arch, "riscv64")
}
return false
}

// s390/s390x changes
func getNumCores() int {
maxProcs := runtime.GOMAXPROCS(0)
Expand Down