mirror of
https://github.com/weaveworks/scope.git
synced 2026-03-03 02:00:43 +00:00
Merge pull request #547 from weaveworks/arm-build
Make Scope build on arm
This commit is contained in:
@@ -12,18 +12,6 @@ import (
|
||||
// Uname is swappable for mocking in tests.
|
||||
var Uname = syscall.Uname
|
||||
|
||||
func charsToString(ca [65]int8) string {
|
||||
s := make([]byte, len(ca))
|
||||
var lens int
|
||||
for ; lens < len(ca); lens++ {
|
||||
if ca[lens] == 0 {
|
||||
break
|
||||
}
|
||||
s[lens] = uint8(ca[lens])
|
||||
}
|
||||
return string(s[0:lens])
|
||||
}
|
||||
|
||||
// GetKernelVersion returns the kernel version as reported by uname.
|
||||
var GetKernelVersion = func() (string, error) {
|
||||
var utsname syscall.Utsname
|
||||
|
||||
15
probe/host/system_utils_linux.go
Normal file
15
probe/host/system_utils_linux.go
Normal file
@@ -0,0 +1,15 @@
|
||||
// +build !arm
|
||||
|
||||
package host
|
||||
|
||||
func charsToString(ca [65]int8) string {
|
||||
s := make([]byte, len(ca))
|
||||
var lens int
|
||||
for ; lens < len(ca); lens++ {
|
||||
if ca[lens] == 0 {
|
||||
break
|
||||
}
|
||||
s[lens] = uint8(ca[lens])
|
||||
}
|
||||
return string(s[0:lens])
|
||||
}
|
||||
13
probe/host/system_utils_linux_arm.go
Normal file
13
probe/host/system_utils_linux_arm.go
Normal file
@@ -0,0 +1,13 @@
|
||||
package host
|
||||
|
||||
func charsToString(ca [65]uint8) string {
|
||||
s := make([]byte, len(ca))
|
||||
var lens int
|
||||
for ; lens < len(ca); lens++ {
|
||||
if ca[lens] == 0 {
|
||||
break
|
||||
}
|
||||
s[lens] = uint8(ca[lens])
|
||||
}
|
||||
return string(s[0:lens])
|
||||
}
|
||||
Reference in New Issue
Block a user