Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compiling Telegraf on pine64 (arm64) errors includes gopsutil undefined PageSize, ClockTicks #213

Open
DazWilkin opened this issue Jun 13, 2016 · 5 comments

Comments

@DazWilkin
Copy link

Telegraf: github.com/influxdata/telegraf

Trying to build on a pine64 (arm64) unsuccessfully:

go version go1.6.1 linux/arm64

Regular make on Telegraf does not work, working through errors. Trying to just build as:

go build -ldflags "-X main.version=$VERSION" ./cmd/telegraf/telegraf.go

Requires $VERSION (1.0.0-beta1-6-g06cb5a0), grab this from the Makefile

VERSION := $(shell sh -c 'git describe --always --tags')
# github.com/shirou/gopsutil/process
../../shirou/gopsutil/process/process_linux.go:559: undefined: PageSize
../../shirou/gopsutil/process/process_linux.go:560: undefined: PageSize
../../shirou/gopsutil/process/process_linux.go:581: undefined: PageSize
../../shirou/gopsutil/process/process_linux.go:582: undefined: PageSize
../../shirou/gopsutil/process/process_linux.go:583: undefined: PageSize
../../shirou/gopsutil/process/process_linux.go:584: undefined: PageSize
../../shirou/gopsutil/process/process_linux.go:585: undefined: PageSize
../../shirou/gopsutil/process/process_linux.go:586: undefined: PageSize
../../shirou/gopsutil/process/process_linux.go:723: undefined: ClockTicks
../../shirou/gopsutil/process/process_linux.go:724: undefined: ClockTicks
../../shirou/gopsutil/process/process_linux.go:724: too many errors

So, I then tried building gopsutil directly:

go/src/github.com/shirou/gopsutil$ make build_test
GOOS=linux go test ./... | grep -v "exec format error"
?       github.com/shirou/gopsutil  [no test files]
--- FAIL: TestCpuInfo (0.00s)
    cpu_test.go:60: could not get CPU Info: {"cpu":0,"vendorId":"","family":"","model":"","stepping":0,"physicalId":"","coreId":"","cores":1,"modelName":"","mhz":1.344e+06,"cacheSize":0,"flags":null}
    cpu_test.go:60: could not get CPU Info: {"cpu":1,"vendorId":"","family":"","model":"","stepping":0,"physicalId":"","coreId":"","cores":1,"modelName":"","mhz":1.344e+06,"cacheSize":0,"flags":null}
    cpu_test.go:60: could not get CPU Info: {"cpu":2,"vendorId":"","family":"","model":"","stepping":0,"physicalId":"","coreId":"","cores":1,"modelName":"","mhz":1.344e+06,"cacheSize":0,"flags":null}
    cpu_test.go:60: could not get CPU Info: {"cpu":3,"vendorId":"","family":"","model":"","stepping":0,"physicalId":"","coreId":"","cores":1,"modelName":"","mhz":1.344e+06,"cacheSize":0,"flags":["fp","asimd","aes","pmull","sha1","sha2","crc32"]}
FAIL
FAIL    github.com/shirou/gopsutil/cpu  0.518s
ok      github.com/shirou/gopsutil/disk 0.081s
ok      github.com/shirou/gopsutil/docker   0.045s
--- FAIL: TestUsers (0.00s)
    host_test.go:36: Users is empty
FAIL
FAIL    github.com/shirou/gopsutil/host 0.022s
ok      github.com/shirou/gopsutil/internal/common  0.043s
ok      github.com/shirou/gopsutil/load 0.019s
# github.com/shirou/gopsutil/process
process/process_linux.go:559: undefined: PageSize
process/process_linux.go:560: undefined: PageSize
process/process_linux.go:581: undefined: PageSize
process/process_linux.go:582: undefined: PageSize
process/process_linux.go:583: undefined: PageSize
process/process_linux.go:584: undefined: PageSize
process/process_linux.go:585: undefined: PageSize
process/process_linux.go:586: undefined: PageSize
process/process_linux.go:723: undefined: ClockTicks
process/process_linux.go:724: undefined: ClockTicks
process/process_linux.go:724: too many errors
ok      github.com/shirou/gopsutil/mem  0.022s
--- FAIL: TestGetProcInodesAll (0.01s)
        Error Trace:    net_linux_test.go:20
    Error:      Should NOT be empty, but was map[]

FAIL
FAIL    github.com/shirou/gopsutil/net  0.046s
FAIL    github.com/shirou/gopsutil/process [build failed]
GOOS=freebsd go test ./... | grep -v "exec format error"
# runtime
/usr/lib/go-1.6/src/runtime/runtime2.go:287: undefined: sigset
Makefile:14: recipe for target 'build_test' failed
make: *** [build_test] Error 1

Apologies for my ignorance here and if I'm my question is obvious.

I'm happy to try solutions.

@shirou
Copy link
Owner

shirou commented Jun 13, 2016

It seems process_linux_arm64.go is required explicitly. I added the file on c916da2. Could you check it out?

@DazWilkin
Copy link
Author

Thank you for such a prompt response!

Here's the result:

make build_test
GOOS=linux go test ./... | grep -v "exec format error"
?       github.com/shirou/gopsutil  [no test files]
--- FAIL: TestCpuInfo (0.00s)
    cpu_test.go:60: could not get CPU Info: {"cpu":0,"vendorId":"","family":"","model":"","stepping":0,"physicalId":"","coreId":"","cores":1,"modelName":"","mhz":1.344e+06,"cacheSize":0,"flags":null}
    cpu_test.go:60: could not get CPU Info: {"cpu":1,"vendorId":"","family":"","model":"","stepping":0,"physicalId":"","coreId":"","cores":1,"modelName":"","mhz":1.344e+06,"cacheSize":0,"flags":null}
    cpu_test.go:60: could not get CPU Info: {"cpu":2,"vendorId":"","family":"","model":"","stepping":0,"physicalId":"","coreId":"","cores":1,"modelName":"","mhz":1.344e+06,"cacheSize":0,"flags":null}
    cpu_test.go:60: could not get CPU Info: {"cpu":3,"vendorId":"","family":"","model":"","stepping":0,"physicalId":"","coreId":"","cores":1,"modelName":"","mhz":1.344e+06,"cacheSize":0,"flags":["fp","asimd","aes","pmull","sha1","sha2","crc32"]}
FAIL
FAIL    github.com/shirou/gopsutil/cpu  0.553s
ok      github.com/shirou/gopsutil/disk 0.080s
ok      github.com/shirou/gopsutil/docker   0.031s
--- FAIL: TestUsers (0.00s)
    host_test.go:49: Users is empty
FAIL
FAIL    github.com/shirou/gopsutil/host 0.021s
ok      github.com/shirou/gopsutil/internal/common  0.032s
ok      github.com/shirou/gopsutil/load 0.028s
ok      github.com/shirou/gopsutil/mem  0.023s
--- FAIL: TestGetProcInodesAll (0.01s)
        Error Trace:    net_linux_test.go:20
    Error:      Should NOT be empty, but was map[]

--- FAIL: TestNetIOCountersAll (0.00s)
    net_test.go:78: invalid sum value: 6998, 6999
FAIL
FAIL    github.com/shirou/gopsutil/net  0.051s
--- FAIL: Test_Process_IOCounters (0.00s)
    process_test.go:180: geting iocounter error open /proc/7414/io: no such file or directory
FAIL
FAIL    github.com/shirou/gopsutil/process  0.296s
GOOS=freebsd go test ./... | grep -v "exec format error"
# runtime
/usr/lib/go-1.6/src/runtime/runtime2.go:287: undefined: sigset
Makefile:14: recipe for target 'build_test' failed
make: *** [build_test] Error 1

@shirou
Copy link
Owner

shirou commented Jun 15, 2016

make build_test is an internal test for just checking compile error. So, exec format error is expected. However, there are several errors on Linux while getting information from system. Perhaps, arm64 has an different format, but I can not confirm because I don't have an instance... hmm.

@DazWilkin
Copy link
Author

Thank you!

I completely understand that this is challenging.

I don't want to waste more of your time.

If you do wish to continue, I'm happy to run tests for you to help you determine the format.

@shirou
Copy link
Owner

shirou commented Jun 15, 2016

I ordered PINE A64+ Board 1GB just now. After international shipping (it takes a few weeks?), I will try to fix it. Please be patient.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants