File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -54,8 +54,8 @@ const nodePath = "/sys/devices/system/node"
5454
5555// GetClockSpeed returns the CPU clock speed, given a []byte formatted as the /proc/cpuinfo file.
5656func GetClockSpeed (procInfo []byte ) (uint64 , error ) {
57- // s390/s390x, aarch64 and arm32 changes
58- if isSystemZ () || isAArch64 () || isArm32 () {
57+ // s390/s390x, riscv64, aarch64 and arm32 changes
58+ if isSystemZ () || isAArch64 () || isArm32 () || isRiscv64 () {
5959 return 0 , nil
6060 }
6161
@@ -448,6 +448,15 @@ func isSystemZ() bool {
448448 return false
449449}
450450
451+ // riscv64 changes
452+ func isRiscv64 () bool {
453+ arch , err := getMachineArch ()
454+ if err == nil {
455+ return strings .Contains (arch , "riscv64" )
456+ }
457+ return false
458+ }
459+
451460// s390/s390x changes
452461func getNumCores () int {
453462 maxProcs := runtime .GOMAXPROCS (0 )
You can’t perform that action at this time.
0 commit comments