-
Notifications
You must be signed in to change notification settings - Fork 6.1k
JDK-8030957 - AIX: Implement OperatingSystemMXBean.getSystemCpuLoad() and .getProcessCpuLoad() on AIX #25332
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
base: master
Are you sure you want to change the base?
Conversation
👋 Welcome back sroy! A progress list of the required criteria for merging this PR into |
❗ This change is not yet ready to be integrated. |
@suchismith1993 The following labels will be automatically applied to this pull request:
When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing lists. If you would like to change these labels, use the /label pull request command. |
} | ||
|
||
ret = perfstat_cpu_total(NULL, &cpu_total, sizeof(perfstat_cpu_total_t), 1); | ||
if (ret <= 0) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I noticed that we check for retval < 0 in os_perf_aix.cpp, should we align this in some way ?
Are you sure the perfstat functionality is always available ? |
I tried with a standalone program and did not face any issues. |
@MBaesken would it be possible for you to try this patch once to see if the load values are realistic / accurate ? |
I was more thinking about different AIX machines setups/OS levels/installations. Is the perfstat functionality always there 'these days' ? |
Not 100% sure how, should we compare with values provided by other tools (system tools etc.) ? |
Hi @MBaesken It seems perfstat is available since AIX 5. I see there is dynamic loading done in libperfstat.cpp. How to confirm if that is necessary ? I did not face issues in this program and also standalone C++ program on AIX 7.2 |
We did this not only because of (un)availability of libperfstat , but also to address different versions (with different functionality) of libperfstat at runtime. |
If we only address minimum AIX 7.2 we can probably simplify this approach or even go away from the current dynamic loading approach. |
2c85db9
to
0df6b81
Compare
7b5b0f5
to
283fe5d
Compare
283fe5d
to
10e9471
Compare
There is still an fflush(stdout); in UnixOperatingSystem.c - guess this is not needed any more? |
JBS Issue : JDK-8030957
These two methods should be implemented in src/aix/native/sun/management/AixOperatingSystem.c (which has to be created).
getProcessCpuLoad() can be probably implemented in the same way like on Solaris be reading /proc/self/psinfo
For getSystemCpuLoad() we'll probalby have to use 'perfstat_cpu_total()' from libperf (see http://publib.boulder.ibm.com/infocenter/pseries/v5r3/topic/com.ibm.aix.prftools/doc/prftools/prftools07.htm#wq407)
Once this issue has been resolved you should not forget to remove the two excludes from jdk/test/ProblemList.txt:
com/sun/management/OperatingSystemMXBean/GetProcessCpuLoad.java aix-all
com/sun/management/OperatingSystemMXBean/GetSystemCpuLoad.java aix-all
Progress
Error
Issue
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/25332/head:pull/25332
$ git checkout pull/25332
Update a local copy of the PR:
$ git checkout pull/25332
$ git pull https://git.openjdk.org/jdk.git pull/25332/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 25332
View PR using the GUI difftool:
$ git pr show -t 25332
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/25332.diff