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

The following examples show how to use jdk.jfr.internal.instrument.JDKEvents#addInstrumentation() . 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();
}