RFR: 8315149: Add hsperf counters for CPU time of internal GC threads [v37]

Volker Simonis simonis at openjdk.org
Thu Nov 2 10:46:11 UTC 2023


On Wed, 1 Nov 2023 23:56:25 GMT, Jonathan Joo <jjoo at openjdk.org> wrote:

>> 8315149: Add hsperf counters for CPU time of internal GC threads
>
> Jonathan Joo has updated the pull request incrementally with two additional commits since the last revision:
> 
>  - revert gitignore change
>  - Attempt to fix broken test

@kstefanj , it is a pity that the `sun.management:type=HotspotThreading` MBean is not exported any more. If we move that or a similar functionality to a new MBean under `com.sun.management` (as proposed in the [cited discussion](https://mail.openjdk.org/pipermail/core-libs-dev/2023-September/111397.html)) then we might reuse these new hsperf counters in the same way this is already done by some other MBeans which already use hsperf counters as their information source. I think logging or JFR functionality could also easily be implemented on top of the new hsperf counters.

As for @albertnetymk's proposal to simple use the `/proc` file system to retrieve thread CPU time information, that is not only inconvenient for the reasons detailed by @caoman. It will also not work for compiler threads (which I think should have similar counters in the future) because compiler threads can be created and and destroyed dynamically (due to [`-XX:+UseDynamicNumberOfCompilerThreads`](https://bugs.openjdk.org/browse/JDK-8198756)).

The current PR still looks good to me.

-------------

Marked as reviewed by simonis (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/15082#pullrequestreview-1709943605


More information about the serviceability-dev mailing list