RFR: 8309671: Avoid using jvmci.Compiler property to determine if Graal is enabled
Yudi Zheng
yzheng at openjdk.org
Thu Jun 8 18:32:55 UTC 2023
On Thu, 8 Jun 2023 17:19:46 GMT, Doug Simon <dnsimon at openjdk.org> wrote:
>> HeapMonitor checks if System.getProperty("jvmci.Compiler") is graal and will not enforce checking line number derived from uncommon trap debug info. However, Graal does not set this property explicitly.
>
> test/hotspot/jtreg/serviceability/jvmti/HeapMonitor/MyPackage/HeapMonitor.java line 257:
>
>> 255:
>> 256: checkLines = !(enableJVMCI.getValue().equals("true")
>> 257: && useJVMCICompiler.getValue().equals("true"));
>
> Is it possible to use `jdk.test.whitebox.code.Compiler.isGraalEnabled()` here instead?
To use whitebox I will have to update the config of every test here, which I think is too verbose:
diff --git a/test/hotspot/jtreg/serviceability/jvmti/HeapMonitor/MyPackage/HeapMonitorStatIntervalTest.java b/test/hotspot/jtreg/serviceability/jvmti/HeapMonitor/MyPackage/HeapMonitorStatIntervalTest.java
index e08454a4857..f086f744965 100644
--- a/test/hotspot/jtreg/serviceability/jvmti/HeapMonitor/MyPackage/HeapMonitorStatIntervalTest.java
+++ b/test/hotspot/jtreg/serviceability/jvmti/HeapMonitor/MyPackage/HeapMonitorStatIntervalTest.java
@@ -27,11 +27,15 @@ package MyPackage;
/**
* @test
* @summary Verifies the JVMTI Heap Monitor sampling interval average.
- * @build Frame HeapMonitor
+ * @library /test/lib
+ * @build Frame HeapMonitor jdk.test.whitebox.WhiteBox
* @compile HeapMonitorStatIntervalTest.java
* @requires vm.jvmti
* @requires vm.compMode != "Xcomp"
- * @run main/othervm/native -agentlib:HeapMonitorTest MyPackage.HeapMonitorStatIntervalTest
+ * @run driver jdk.test.lib.helpers.ClassFileInstaller jdk.test.whitebox.WhiteBox
+ * @run main/othervm/native -agentlib:HeapMonitorTest -Xbootclasspath/a:.
+ * -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI
+ * MyPackage.HeapMonitorStatIntervalTest
*/
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/14381#discussion_r1223411115
More information about the serviceability-dev
mailing list