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

gccgo compile fix and support for perfstat_cpu_util #1

Merged
merged 2 commits into from
Feb 16, 2022

Conversation

chbuescher
Copy link

when compiling with gccgo - for cpus < power8 i've got an error:
vendor/github.com/power-devops/perfstat/types_fs.go:130:22: error: integer constant overflow
130 | case f.Flags&VFS_DIO != 0:

The other commit is a feature: To get the correct cpu usage of an lpar i had to call perfstat_cpu_util()
I implemented only the TotalStat, not the usage per cpu

@aklyachkin
Copy link
Contributor

thank you very much for the fix and the pull request!

regarding your feature request, I think it repeats the same functionality as in CpuUtilStat(). If we split CpuUtilStat() in 2 functions - one gets old CPU data (what you've done in init()) and the second calculates the difference (your CpuUtilTotalStat()), and then you can use the first function whenever you need it to start counting, would it suit your needs?

Not everyone uses libperfstat to get CPU data from it and that is my problem with init(). Why should we save some data in a global variable for a possible future use?

@aklyachkin aklyachkin merged commit c35f1ee into power-devops:main Feb 16, 2022
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

Successfully merging this pull request may close these issues.

2 participants