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

Closed
serak opened this issue Jul 5, 2023 · 9 comments
Closed

AIX Support Coming? #1490

serak opened this issue Jul 5, 2023 · 9 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

@Dylan-M
Copy link
Contributor

Dylan-M commented May 15, 2024

I'll be working on this here:
https://github.com/Dylan-M/gopsutil/tree/aix_support

However, it will likely only be for nocgo support, since my software using it doesn't enable cgo. I'll make best effort to support it with cgo enabled as well.

@Dylan-M
Copy link
Contributor

Dylan-M commented May 15, 2024

Host version detection: https://github.com/jxsl13/osfacts/blob/master/distro/distro_aix.go#L21

Why specifically did you reference this?

@Dylan-M
Copy link
Contributor

Dylan-M commented May 18, 2024

I've implemented everything that I both have time to do, and is within my capabilities (I'm new at Golang) in #1651

This greatly improves AIX support in general, and covers all of my own use cases except processes. I hope to have time for that later.

@shirou
Copy link
Owner

shirou commented Jun 15, 2024

Close as completed by #1651. Thank you for your contribution!

@shirou shirou closed this as completed Jun 15, 2024
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

5 participants