From 29c703456a1af3f44d19e9ce6581607f354b02a1 Mon Sep 17 00:00:00 2001 From: Robert Toyonaga Date: Thu, 12 Jun 2025 09:37:55 -0400 Subject: [PATCH 1/2] jfr substitutions --- .../core/jfr/Target_jdk_jfr_internal_JVM.java | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jfr/Target_jdk_jfr_internal_JVM.java b/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jfr/Target_jdk_jfr_internal_JVM.java index 1a196b5bbbc1..db6064066d83 100644 --- a/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jfr/Target_jdk_jfr_internal_JVM.java +++ b/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jfr/Target_jdk_jfr_internal_JVM.java @@ -296,6 +296,12 @@ public static void setMethodSamplingPeriod(long type, long intervalMillis) { SubstrateJVM.get().setMethodSamplingInterval(type, intervalMillis); } + /** See {@code JVM#setCPUThrottle}. */ + @Substitute + public static void setCPUThrottle(double rate, boolean autoAdapt) { + // JFR CPUTimeSample is not supported. + } + /** See {@link JVM#setOutput}. */ @Substitute public static void setOutput(String file) { @@ -652,6 +658,24 @@ public static boolean isProduct() { */ return true; } + + /** See {@link JVM#setMethodTraceFilters}. */ + @Substitute + public static long[] setMethodTraceFilters( + String[] classes, + String[] methods, + String[] annotations, + int[] modification) { + // JFR method tracing is not supported. No filters can be used so return null. + return null; + } + + /** See {@link JVM#drainStaleMethodTracerIds}. */ + @Substitute + public static long[] drainStaleMethodTracerIds() { + // JFR method tracing is not supported. Return no stale IDs. + return null; + } } class Target_jdk_jfr_internal_JVM_Util { From a3104c76b1171fd14d73c546b5fc615710458ad2 Mon Sep 17 00:00:00 2001 From: Robert Toyonaga Date: Thu, 12 Jun 2025 10:21:34 -0400 Subject: [PATCH 2/2] fix style --- .../oracle/svm/core/jfr/Target_jdk_jfr_internal_JVM.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jfr/Target_jdk_jfr_internal_JVM.java b/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jfr/Target_jdk_jfr_internal_JVM.java index db6064066d83..95e0dd439cf4 100644 --- a/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jfr/Target_jdk_jfr_internal_JVM.java +++ b/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jfr/Target_jdk_jfr_internal_JVM.java @@ -662,10 +662,10 @@ public static boolean isProduct() { /** See {@link JVM#setMethodTraceFilters}. */ @Substitute public static long[] setMethodTraceFilters( - String[] classes, - String[] methods, - String[] annotations, - int[] modification) { + String[] classes, + String[] methods, + String[] annotations, + int[] modification) { // JFR method tracing is not supported. No filters can be used so return null. return null; }