[jdk8u-dev] RFR: 8217612: (CL)HSDB cannot show some JVM flags [v2]

Kazuhisa Takakuri ktakakuri at openjdk.org
Wed Apr 10 11:47:16 UTC 2024


On Mon, 8 Apr 2024 12:17:28 GMT, Kazuhisa Takakuri <ktakakuri at openjdk.org> wrote:

>> Hi all, this is a backport of JDK-8217612: (CL)HSDB cannot show some JVM flags.
>> The bug reported is reproducible in JDK8, so this patch should be applied.
>> This patch requires the follow-up patch JDK-8217850 and the correspoding pull request has been submitted.
>> The original patch does not apply cleanly, and the following modifications are needed:
>> 
>> hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/VM.java
>> 
>> * Long.toUnsignedString method was introduced in JDK8, and the build fails with JDK7 as the boot-jdk when using this method. Consequently, an alternative private method to Long.toUnsignedString(long i, 10) is required in VM.java.
>> * The size_t type was introduced in JDK9, so the related fix is skipped.
>> * To return a String value in the getValue method, the original fix uses a static method, whereas this fix creates a new instance each time. The use of a static method was introduced to JDK-9 in the enhancement JDK-8145061. This enhancement has not been backported, so the same format as the other part of the getValue() method should be used.
>> * Replace var with String.
>> 
>> hotspot/src/share/vm/runtime/globals.hpp
>> 
>> * A comment on the flag type double and uint64_t is added, which matches teh implementation. This comment was added in JDK-8059847, but this fix is an enhancement and not necessary to backport, so I believe it is valid to fix the comment in this PR.
>> 
>> hotspot/test/serviceability/sa/ClhsdbFlags.java
>> 
>> * This test is backported from the original commit with `@test` removed. This test will not function because the serviceability/sa test framework has not been backported. This follows the discussion in backporting JDK-8196969 to JDK8 (https://mail.openjdk.org/pipermail/jdk8u-dev/2020-May/011785.html ). Backporting SA-related tests is excessive and may require some follow-up test fixes, but it is beneficial to indicate that this test append should be integrated when the test framework is backported in the future.
>> 
>> Testing
>> 
>> * manually check the behaviour  
>>   Consider Running java program with option `-XX:NativeMemoryTracking=off -XX:OnError=echo -XX:MaxRAMPercentage=20.0 -XX:MaxRAM=10000000`. The flag types correspond to ccstr, ccstrlist, double, and uint64_t, respectively. When attaching the process using clhsdb, the value is corrected by this patch as follows. Note that the default value of MaxMetaspaceSize is max_uintx.  
>> 
>> without patch
>> 
>> 
>> hsdb> flags NativeMemoryTracking
>> NativeMemoryTracking =...
>
> Kazuhisa Takakuri has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains two additional commits since the last revision:
> 
>  - Merge branch 'master' into 8217612
>  - d6a75a0f86d4c84132a3794c432b34068163fa60

Could anyone review this backport please?
Failure of gc/metaspace/CompressedClassSpaceSizeInJmapHeap.java in GHA will be resolved in https://github.com/openjdk/jdk8u-dev/pull/433.

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

PR Comment: https://git.openjdk.org/jdk8u-dev/pull/431#issuecomment-2047310058


More information about the jdk8u-dev mailing list