On Thu, 8 Jun 2023 18:29:50 GMT, Yudi Zheng <yzh...@openjdk.org> wrote:

>> 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
>   */

Ok.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/14381#discussion_r1223447124

Reply via email to