File tree 1 file changed +11
-2
lines changed
1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -54,8 +54,8 @@ const nodePath = "/sys/devices/system/node"
54
54
55
55
// GetClockSpeed returns the CPU clock speed, given a []byte formatted as the /proc/cpuinfo file.
56
56
func 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 () {
59
59
return 0 , nil
60
60
}
61
61
@@ -448,6 +448,15 @@ func isSystemZ() bool {
448
448
return false
449
449
}
450
450
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
+
451
460
// s390/s390x changes
452
461
func getNumCores () int {
453
462
maxProcs := runtime .GOMAXPROCS (0 )
You can’t perform that action at this time.
0 commit comments