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

Kazuhisa Takakuri ktakakuri at openjdk.org
Mon Apr 8 12:17:28 UTC 2024


> 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 = null 1
> hsdb> flags OnError
> OnError = null 1
> hsdb> flags Max...

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

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

Changes:
  - all: https://git.openjdk.org/jdk8u-dev/pull/431/files
  - new: https://git.openjdk.org/jdk8u-dev/pull/431/files/554b8da9..465ea187

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk8u-dev&pr=431&range=01
 - incr: https://webrevs.openjdk.org/?repo=jdk8u-dev&pr=431&range=00-01

  Stats: 9273 lines in 512 files changed: 4235 ins; 3728 del; 1310 mod
  Patch: https://git.openjdk.org/jdk8u-dev/pull/431.diff
  Fetch: git fetch https://git.openjdk.org/jdk8u-dev.git pull/431/head:pull/431

PR: https://git.openjdk.org/jdk8u-dev/pull/431


More information about the jdk8u-dev mailing list