From a301faab7e3439046c9eb559861cef4be67f9cb9 Mon Sep 17 00:00:00 2001 From: neugens Date: Mon, 17 Feb 2020 10:32:35 +0100 Subject: [PATCH] 8230707: JFR related tests are failing Reviewed-by: shade, andrew --- src/share/vm/runtime/globals.hpp | 8 ++++++++ test/runtime/EnableTracing/TestEnableTracing.java | 11 ----------- test/testlibrary/whitebox/sun/hotspot/WhiteBox.java | 11 ++++++++++- 3 files changed, 18 insertions(+), 12 deletions(-) diff --git a/src/share/vm/runtime/globals.hpp b/src/share/vm/runtime/globals.hpp index d1e125260..d4306725f 100644 --- a/src/share/vm/runtime/globals.hpp +++ b/src/share/vm/runtime/globals.hpp @@ -3990,6 +3990,14 @@ class CommandLineFlags { "Use the FP register for holding the frame pointer " \ "and not as a general purpose register.") \ \ + product(bool, EnableTracing, false, \ + "Enable event-based tracing" \ + "Deprecated: use FlightRecorder instead") \ + \ + product(bool, UseLockedTracing, false, \ + "Use locked-tracing when doing event-based tracing" \ + "Deprecated: use FlightRecorder instead") \ + \ JFR_ONLY(product(bool, FlightRecorder, false, \ "Enable Flight Recorder")) \ \ diff --git a/test/runtime/EnableTracing/TestEnableTracing.java b/test/runtime/EnableTracing/TestEnableTracing.java index 9b2ad48d5..c2b50cef0 100644 --- a/test/runtime/EnableTracing/TestEnableTracing.java +++ b/test/runtime/EnableTracing/TestEnableTracing.java @@ -33,24 +33,13 @@ import com.oracle.java.testlibrary.ProcessTools; import com.oracle.java.testlibrary.OutputAnalyzer; public class TestEnableTracing { - public static final String OPENJDK_MARK = "OpenJDK"; - public static void main(String[] args) throws Exception { ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-XX:+EnableTracing", "-version"); OutputAnalyzer output = new OutputAnalyzer(pb.start()); - if (output.getStderr().contains(OPENJDK_MARK)) { - output.shouldMatch("^Class Load"); - output.shouldContain("Loaded Class ="); // verify TraceStream print_val Klass* - } output.shouldHaveExitValue(0); pb = ProcessTools.createJavaProcessBuilder("-XX:+EnableTracing", "-XX:+UseLockedTracing", "-Xcomp ", "-version"); output = new OutputAnalyzer(pb.start()); - if (output.getStderr().contains(OPENJDK_MARK)) { - output.shouldMatch("^Class Load"); - output.shouldMatch("^Compilation"); - output.shouldContain("Java Method ="); // verify TraceStream print_val Method* - } output.shouldHaveExitValue(0); } } diff --git a/test/testlibrary/whitebox/sun/hotspot/WhiteBox.java b/test/testlibrary/whitebox/sun/hotspot/WhiteBox.java index 1327bd30d..909e09f9d 100644 --- a/test/testlibrary/whitebox/sun/hotspot/WhiteBox.java +++ b/test/testlibrary/whitebox/sun/hotspot/WhiteBox.java @@ -76,6 +76,7 @@ public class WhiteBox { // Memory public native long getObjectAddress(Object o); public native int getHeapOopSize(); + public native long getHeapAlignment(); public native int getVMPageSize(); public native long getVMLargePageSize(); @@ -160,7 +161,12 @@ public class WhiteBox { public boolean enqueueMethodForCompilation(Executable method, int compLevel) { return enqueueMethodForCompilation(method, compLevel, -1 /*InvocationEntryBci*/); } - public native boolean enqueueMethodForCompilation(Executable method, int compLevel, int entry_bci); + public boolean enqueueMethodForCompilation(Executable method, int compLevel, int entry_bci) { + return enqueueMethodForCompilation0(method, compLevel, entry_bci); + } + + public native boolean enqueueInitializerForCompilation0(Class clazz, int compLevel); + public native boolean enqueueMethodForCompilation0(Executable method, int compLevel, int entry_bci); public native void clearMethodState(Executable method); public native void markMethodProfiled(Executable method); public native int getMethodEntryBci(Executable method); @@ -171,6 +177,9 @@ public class WhiteBox { // Memory public native void readReservedMemory(); + public native long allocateCodeBlob(int size, int blobType); + public native void freeCodeBlob(long address); + public native Object[] getCodeBlob(long address); public native long allocateMetaspace(ClassLoader classLoader, long size); public native void freeMetaspace(ClassLoader classLoader, long addr, long size); public native long incMetaspaceCapacityUntilGC(long increment); -- GitLab