Search in sources :

Example 1 with JfrEvent

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

the class JfrGCEventFeature method emitGCPhasePauseEvent.

@Uninterruptible(reason = "Accesses a JFR buffer.")
public void emitGCPhasePauseEvent(UnsignedWord gcEpoch, String name, long startTicks) {
    int level = popPhase();
    JfrEvent event = getGCPhasePauseEvent(level);
    if (SubstrateJVM.isRecording() && SubstrateJVM.get().isEnabled(event)) {
        long end = JfrTicks.elapsedTicks();
        JfrNativeEventWriterData data = StackValue.get(JfrNativeEventWriterData.class);
        JfrNativeEventWriterDataAccess.initializeThreadLocalNativeBuffer(data);
        JfrNativeEventWriter.beginEventWrite(data, false);
        JfrNativeEventWriter.putLong(data, event.getId());
        JfrNativeEventWriter.putLong(data, startTicks);
        JfrNativeEventWriter.putLong(data, end - startTicks);
        JfrNativeEventWriter.putEventThread(data);
        JfrNativeEventWriter.putLong(data, gcEpoch.rawValue());
        JfrNativeEventWriter.putString(data, name);
        JfrNativeEventWriter.endEventWrite(data, false);
    }
}
Also used : JfrEvent(com.oracle.svm.core.jfr.JfrEvent) JfrNativeEventWriterData(com.oracle.svm.core.jfr.JfrNativeEventWriterData) Uninterruptible(com.oracle.svm.core.annotate.Uninterruptible)

Aggregations

Uninterruptible (com.oracle.svm.core.annotate.Uninterruptible)1 JfrEvent (com.oracle.svm.core.jfr.JfrEvent)1 JfrNativeEventWriterData (com.oracle.svm.core.jfr.JfrNativeEventWriterData)1