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

AIX Support Coming? #1490

Open
serak opened this issue Jul 5, 2023 · 5 comments
Open

AIX Support Coming? #1490

serak opened this issue Jul 5, 2023 · 5 comments
Labels

Comments

@serak
Copy link

serak commented Jul 5, 2023

Is your feature request related to a problem? Please describe.
No, but psutil support this os
Describe the solution you'd like
AIX/ppc64 support
Describe alternatives you've considered
psutil

@Lomanic
Copy link
Collaborator

Lomanic commented Jul 6, 2023

We don't have access to this kind of hardware/operating system, we have to rely on external contributions for this (like in #834 (comment)).

We already partially support aix

cpu/cpu_aix.go
cpu/cpu_aix_cgo.go
cpu/cpu_aix_nocgo.go
disk/disk_aix.go
disk/disk_aix_cgo.go
disk/disk_aix_nocgo.go
load/load_aix.go
load/load_aix_cgo.go
load/load_aix_nocgo.go
mem/mem_aix.go
mem/mem_aix_cgo.go
mem/mem_aix_nocgo.go
net/net_aix.go
net/net_aix_cgo.go
net/net_aix_nocgo.go

Can you confirm you are missing the host and process sub-packages? Can you confirm the cpu, disk, load, mem and net sub-packages are functional on aix/ppc64?

@Lomanic Lomanic added the os:aix label Jul 6, 2023
@serak
Copy link
Author

serak commented Jul 6, 2023

Ok the provided example works fine on Power8 (Go Support) .

is there a test bench that i can execute for all functions ?

image

@serak
Copy link
Author

serak commented Jul 6, 2023

image

cpu.Info() is also very expensive, because it is calling prtconf , how is the standard here if i want to make a pull request should i call processes and get values of use native C library?

@Lomanic
Copy link
Collaborator

Lomanic commented Jul 6, 2023

cpu.Info() shells out to an external process only if you disable cgo ( CGO_ENABLED=0), it's defined twice in

out, err := invoke.CommandWithContext(ctx, "prtconf")
and https://github.com/shirou/gopsutil/blob/master/cpu/cpu_aix_cgo.go#L46

If you were to implement the missing packages with cgo, please add nocgo stubs like in https://github.com/shirou/gopsutil/blob/042e63609b4e22a95b6201d48c874b62a976d133/disk/disk_darwin_nocgo.go

There are tests for each packages, you can run all of them with go test github.com/shirou/gopsutil/v3/...

@jxsl13
Copy link

jxsl13 commented Aug 11, 2023

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

No branches or pull requests

3 participants