--- a/src/jdk.jfr/share/classes/jdk/jfr/internal/management/ManagementSupport.java Thu Jun 06 21:19:07 2019 +0800
+++ b/src/jdk.jfr/share/classes/jdk/jfr/internal/management/ManagementSupport.java Thu Jun 06 15:22:12 2019 +0200
@@ -31,12 +31,16 @@
import java.util.List;
import jdk.jfr.EventType;
+import jdk.jfr.Recording;
import jdk.jfr.internal.JVMSupport;
import jdk.jfr.internal.LogLevel;
import jdk.jfr.internal.LogTag;
import jdk.jfr.internal.Logger;
import jdk.jfr.internal.MetadataRepository;
+import jdk.jfr.internal.PlatformRecording;
+import jdk.jfr.internal.PrivateAccess;
import jdk.jfr.internal.Utils;
+import jdk.jfr.internal.WriteableUserPath;
import jdk.jfr.internal.instrument.JDKEvents;
/**
@@ -86,4 +90,12 @@
public static void logError(String message) {
Logger.log(LogTag.JFR, LogLevel.ERROR, message);
}
+
+ // Get the textual representation when the destination was set, which
+ // requires access to jdk.jfr.internal.PlatformRecording
+ public static String getDestinationOriginalText(Recording recording) {
+ PlatformRecording pr = PrivateAccess.getInstance().getPlatformRecording(recording);
+ WriteableUserPath wup = pr.getDestination();
+ return wup == null ? null : wup.getOriginalText();
+ }
}