Search in sources :

Example 1 with JfrTraceIdMap

use of com.oracle.svm.core.jfr.traceid.JfrTraceIdMap in project graal by oracle.

the class JfrFeature method afterRegistration.

@Override
public void afterRegistration(AfterRegistrationAccess access) {
    ModuleSupport.exportAndOpenAllPackagesToUnnamed("jdk.jfr", false);
    ModuleSupport.exportAndOpenAllPackagesToUnnamed("java.base", false);
    ModuleSupport.exportAndOpenPackageToClass("jdk.jfr", "jdk.jfr.events", false, JfrFeature.class);
    ModuleSupport.exportAndOpenPackageToClass("jdk.internal.vm.ci", "jdk.vm.ci.hotspot", false, JfrEventSubstitution.class);
    // Initialize some parts of JFR/JFC at image build time.
    List<Configuration> knownConfigurations = JFC.getConfigurations();
    JVM.getJVM().createNativeJFR();
    ImageSingletons.add(JfrManager.class, new JfrManager(HOSTED_ENABLED));
    ImageSingletons.add(SubstrateJVM.class, new SubstrateJVM(knownConfigurations));
    ImageSingletons.add(JfrSerializerSupport.class, new JfrSerializerSupport());
    ImageSingletons.add(JfrTraceIdMap.class, new JfrTraceIdMap());
    ImageSingletons.add(JfrTraceIdEpoch.class, new JfrTraceIdEpoch());
    ImageSingletons.add(JfrGCNames.class, new JfrGCNames());
    JfrSerializerSupport.get().register(new JfrFrameTypeSerializer());
    JfrSerializerSupport.get().register(new JfrThreadStateSerializer());
    ThreadListenerSupport.get().register(SubstrateJVM.getThreadLocal());
    if (HOSTED_ENABLED) {
        RuntimeClassInitializationSupport rci = ImageSingletons.lookup(RuntimeClassInitializationSupport.class);
        rci.initializeAtBuildTime("jdk.management.jfr", "Allow FlightRecorder to be used at image build time");
        rci.initializeAtBuildTime("com.sun.jmx.mbeanserver", "Allow FlightRecorder to be used at image build time");
        rci.initializeAtBuildTime("com.sun.jmx.defaults", "Allow FlightRecorder to be used at image build time");
        rci.initializeAtBuildTime("java.beans", "Allow FlightRecorder to be used at image build time");
    }
}
Also used : JfrManager(com.oracle.svm.core.jfr.JfrManager) Configuration(jdk.jfr.Configuration) JfrSerializerSupport(com.oracle.svm.core.jfr.JfrSerializerSupport) JfrThreadStateSerializer(com.oracle.svm.core.jfr.JfrThreadStateSerializer) JfrFrameTypeSerializer(com.oracle.svm.core.jfr.JfrFrameTypeSerializer) RuntimeClassInitializationSupport(org.graalvm.nativeimage.impl.RuntimeClassInitializationSupport) JfrGCNames(com.oracle.svm.core.jfr.JfrGCNames) JfrTraceIdMap(com.oracle.svm.core.jfr.traceid.JfrTraceIdMap) JfrTraceIdEpoch(com.oracle.svm.core.jfr.traceid.JfrTraceIdEpoch) SubstrateJVM(com.oracle.svm.core.jfr.SubstrateJVM)

Aggregations

JfrFrameTypeSerializer (com.oracle.svm.core.jfr.JfrFrameTypeSerializer)1 JfrGCNames (com.oracle.svm.core.jfr.JfrGCNames)1 JfrManager (com.oracle.svm.core.jfr.JfrManager)1 JfrSerializerSupport (com.oracle.svm.core.jfr.JfrSerializerSupport)1 JfrThreadStateSerializer (com.oracle.svm.core.jfr.JfrThreadStateSerializer)1 SubstrateJVM (com.oracle.svm.core.jfr.SubstrateJVM)1 JfrTraceIdEpoch (com.oracle.svm.core.jfr.traceid.JfrTraceIdEpoch)1 JfrTraceIdMap (com.oracle.svm.core.jfr.traceid.JfrTraceIdMap)1 Configuration (jdk.jfr.Configuration)1 RuntimeClassInitializationSupport (org.graalvm.nativeimage.impl.RuntimeClassInitializationSupport)1