diff --git a/substratevm/src/com.oracle.svm.test/src/com/oracle/svm/test/jfr/AbstractJfrTest.java b/substratevm/src/com.oracle.svm.test/src/com/oracle/svm/test/jfr/AbstractJfrTest.java index ffde76ad560..73b95ece753 100644 --- a/substratevm/src/com.oracle.svm.test/src/com/oracle/svm/test/jfr/AbstractJfrTest.java +++ b/substratevm/src/com.oracle.svm.test/src/com/oracle/svm/test/jfr/AbstractJfrTest.java @@ -41,6 +41,7 @@ import org.graalvm.nativeimage.ImageInfo; import org.graalvm.nativeimage.hosted.Feature; +import org.graalvm.nativeimage.hosted.RuntimeProxyCreation; import org.junit.After; import org.junit.Assert; import org.junit.BeforeClass; @@ -54,6 +55,7 @@ import jdk.jfr.Configuration; import jdk.jfr.consumer.RecordedEvent; import jdk.jfr.consumer.RecordingFile; +import jdk.jfr.Unsigned; /** Base class for JFR unit tests. */ public abstract class AbstractJfrTest { @@ -196,4 +198,16 @@ public void afterRegistration(AfterRegistrationAccess access) { */ ModuleSupport.accessPackagesToClass(ModuleSupport.Access.OPEN, JfrTestFeature.class, false, "jdk.internal.vm.compiler", "org.graalvm.compiler.serviceprovider"); } + + @Override + public void beforeAnalysis(BeforeAnalysisAccess access) { + /* + * Register proxies for event data assertion + * + * Unsigned added to be able to query RecordedObject.getLong() method, and this method + * checks if the value returned has the jdk.jfr.Unsigned. The jfr layer in HotSpot creates a + * proxy to query this information. + */ + RuntimeProxyCreation.register(Unsigned.class); + } }