Skip to content

Add implementation of numProcs for AIX with cgo#2022

Merged
shirou merged 3 commits intoshirou:masterfrom
pgimalac:pgimalac/host-add-missing-num-procs-aix
Mar 13, 2026
Merged

Add implementation of numProcs for AIX with cgo#2022
shirou merged 3 commits intoshirou:masterfrom
pgimalac:pgimalac/host-add-missing-num-procs-aix

Conversation

@pgimalac
Copy link
Copy Markdown
Contributor

@pgimalac pgimalac commented Mar 6, 2026

Add an implementation of numProcs on AIX using getprocs64.

https://www.ibm.com/docs/en/aix/7.2.0?topic=g-getprocs-subroutine

Similarly to #2019, it just iterates over processes with getprocs64, one at a time, and could be optimized.

Copy link
Copy Markdown
Owner

@shirou shirou left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we use perfstat.ProcessStat() from github.com/power-devops/perfstat instead of calling getprocs64 directly? All other AIX cgo implementations in this project (cpu, disk, mem, net) use perfstat, and len(perfstat.ProcessStat()) would give the process count without needing direct CGO/unsafe calls. This would also keep the implementation consistent with the rest of the codebase.

@pgimalac
Copy link
Copy Markdown
Contributor Author

@shirou yes good catch ! Updated !

Copy link
Copy Markdown
Owner

@shirou shirou left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the update! LGTM!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants