Java Code Examples for jdk.jfr.internal.instrument.JDKEvents#initialize()

The following examples show how to use jdk.jfr.internal.instrument.JDKEvents#initialize() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: PlatformRecorder.java    From dragonwell8_jdk with GNU General Public License v2.0 6 votes vote down vote up
public PlatformRecorder() throws Exception {
    repository = Repository.getRepository();
    Logger.log(JFR_SYSTEM, INFO, "Initialized disk repository");
    repository.ensureRepository();
    jvm.createNativeJFR();
    Logger.log(JFR_SYSTEM, INFO, "Created native");
    JDKEvents.initialize();
    Logger.log(JFR_SYSTEM, INFO, "Registered JDK events");
    JDKEvents.addInstrumentation();
    startDiskMonitor();
    SecuritySupport.registerEvent(ActiveRecordingEvent.class);
    activeRecordingEvent = EventType.getEventType(ActiveRecordingEvent.class);
    SecuritySupport.registerEvent(ActiveSettingEvent.class);
    activeSettingEvent = EventType.getEventType(ActiveSettingEvent.class);
    shutdownHook = SecuritySupport.createThreadWitNoPermissions("JFR: Shutdown Hook", new ShutdownHook(this));
    SecuritySupport.setUncaughtExceptionHandler(shutdownHook, new ShutdownHook.ExceptionHandler());
    SecuritySupport.registerShutdownHook(shutdownHook);
    timer = createTimer();
}
 
Example 2
Source File: PlatformRecorder.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
public PlatformRecorder() throws Exception {
    repository = Repository.getRepository();
    Logger.log(JFR_SYSTEM, INFO, "Initialized disk repository");
    repository.ensureRepository();
    jvm.createNativeJFR();
    Logger.log(JFR_SYSTEM, INFO, "Created native");
    JDKEvents.initialize();
    Logger.log(JFR_SYSTEM, INFO, "Registered JDK events");
    JDKEvents.addInstrumentation();
    startDiskMonitor();
    SecuritySupport.registerEvent(ActiveRecordingEvent.class);
    activeRecordingEvent = EventType.getEventType(ActiveRecordingEvent.class);
    SecuritySupport.registerEvent(ActiveSettingEvent.class);
    activeSettingEvent = EventType.getEventType(ActiveSettingEvent.class);
    shutdownHook = SecuritySupport.createThreadWitNoPermissions("JFR: Shutdown Hook", new ShutdownHook(this));
    SecuritySupport.setUncaughtExceptionHandler(shutdownHook, new ShutdownHook.ExceptionHandler());
    SecuritySupport.registerShutdownHook(shutdownHook);
    timer = createTimer();
}
 
Example 3
Source File: PlatformRecorder.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
public PlatformRecorder() throws Exception {
    repository = Repository.getRepository();
    Logger.log(JFR_SYSTEM, INFO, "Initialized disk repository");
    repository.ensureRepository();
    jvm.createNativeJFR();
    Logger.log(JFR_SYSTEM, INFO, "Created native");
    JDKEvents.initialize();
    Logger.log(JFR_SYSTEM, INFO, "Registered JDK events");
    JDKEvents.addInstrumentation();
    startDiskMonitor();
    SecuritySupport.registerEvent(ActiveRecordingEvent.class);
    activeRecordingEvent = EventType.getEventType(ActiveRecordingEvent.class);
    SecuritySupport.registerEvent(ActiveSettingEvent.class);
    activeSettingEvent = EventType.getEventType(ActiveSettingEvent.class);
    shutdownHook = SecuritySupport.createThreadWitNoPermissions("JFR: Shutdown Hook", new ShutdownHook(this));
    SecuritySupport.setUncaughtExceptionHandler(shutdownHook, new ShutdownHook.ExceptionHandler());
    SecuritySupport.registerShutdownHook(shutdownHook);
    timer = createTimer();
}
 
Example 4
Source File: ManagementSupport.java    From dragonwell8_jdk with GNU General Public License v2.0 5 votes vote down vote up
public static List<EventType> getEventTypes() {
    // would normally be checked when a Flight Recorder instance is created
    Utils.checkAccessFlightRecorder();
    if (JVMSupport.isNotAvailable()) {
        return new ArrayList<>();
    }
    JDKEvents.initialize(); // make sure JDK events are available
    return Collections.unmodifiableList(MetadataRepository.getInstance().getRegisteredEventTypes());
}
 
Example 5
Source File: ManagementSupport.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
public static List<EventType> getEventTypes() {
    // would normally be checked when a Flight Recorder instance is created
    Utils.checkAccessFlightRecorder();
    if (JVMSupport.isNotAvailable()) {
        return new ArrayList<>();
    }
    JDKEvents.initialize(); // make sure JDK events are available
    return Collections.unmodifiableList(MetadataRepository.getInstance().getRegisteredEventTypes());
}
 
Example 6
Source File: ManagementSupport.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
public static List<EventType> getEventTypes() {
    // would normally be checked when a Flight Recorder instance is created
    Utils.checkAccessFlightRecorder();
    if (JVMSupport.isNotAvailable()) {
        return new ArrayList<>();
    }
    JDKEvents.initialize(); // make sure JDK events are available
    return Collections.unmodifiableList(MetadataRepository.getInstance().getRegisteredEventTypes());
}