Search in sources :

Example 11 with JfrNativeEventWriterData

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

the class EndChunkNativePeriodicEvents method emitOSInformation.

@Uninterruptible(reason = "Accesses a JFR buffer.")
private static void emitOSInformation(String osVersion) {
    if (SubstrateJVM.isRecording() && SubstrateJVM.get().isEnabled(JfrEvent.OSInformation)) {
        JfrNativeEventWriterData data = StackValue.get(JfrNativeEventWriterData.class);
        JfrNativeEventWriterDataAccess.initializeThreadLocalNativeBuffer(data);
        JfrNativeEventWriter.beginEventWrite(data, false);
        JfrNativeEventWriter.putLong(data, JfrEvent.OSInformation.getId());
        JfrNativeEventWriter.putLong(data, JfrTicks.elapsedTicks());
        JfrNativeEventWriter.putString(data, osVersion);
        JfrNativeEventWriter.endEventWrite(data, false);
    }
}
Also used : JfrNativeEventWriterData(com.oracle.svm.core.jfr.JfrNativeEventWriterData) Uninterruptible(com.oracle.svm.core.annotate.Uninterruptible)

Example 12 with JfrNativeEventWriterData

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

the class ExecutionSampleEvent method writeExecutionSample.

@Uninterruptible(reason = "Accesses a JFR buffer.")
public static void writeExecutionSample(IsolateThread isolateThread, Thread.State threadState) {
    SubstrateJVM svm = SubstrateJVM.get();
    if (SubstrateJVM.isRecording() && svm.isEnabled(JfrEvent.ExecutionSample)) {
        JfrNativeEventWriterData data = StackValue.get(JfrNativeEventWriterData.class);
        JfrNativeEventWriterDataAccess.initializeThreadLocalNativeBuffer(data);
        JfrNativeEventWriter.beginEventWrite(data, false);
        JfrNativeEventWriter.putLong(data, JfrEvent.ExecutionSample.getId());
        JfrNativeEventWriter.putLong(data, JfrTicks.elapsedTicks());
        JfrNativeEventWriter.putThread(data, isolateThread);
        JfrNativeEventWriter.putLong(data, svm.getStackTraceId(JfrEvent.ExecutionSample.getId(), 0));
        JfrNativeEventWriter.putLong(data, JfrThreadState.getId(threadState));
        JfrNativeEventWriter.endEventWrite(data, false);
    }
}
Also used : JfrNativeEventWriterData(com.oracle.svm.core.jfr.JfrNativeEventWriterData) SubstrateJVM(com.oracle.svm.core.jfr.SubstrateJVM) Uninterruptible(com.oracle.svm.core.annotate.Uninterruptible)

Example 13 with JfrNativeEventWriterData

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

the class SafepointEndEvent method emit.

@Uninterruptible(reason = "Accesses a JFR buffer.")
public static void emit(UnsignedWord safepointId, long startTick) {
    if (!HasJfrSupport.get()) {
        return;
    }
    if (SubstrateJVM.isRecording() && SubstrateJVM.get().isEnabled(JfrEvent.SafepointEnd)) {
        JfrNativeEventWriterData data = StackValue.get(JfrNativeEventWriterData.class);
        JfrNativeEventWriterDataAccess.initializeThreadLocalNativeBuffer(data);
        JfrNativeEventWriter.beginEventWrite(data, false);
        JfrNativeEventWriter.putLong(data, JfrEvent.SafepointEnd.getId());
        JfrNativeEventWriter.putLong(data, startTick);
        JfrNativeEventWriter.putLong(data, JfrTicks.elapsedTicks() - startTick);
        JfrNativeEventWriter.putEventThread(data);
        JfrNativeEventWriter.putLong(data, safepointId.rawValue());
        JfrNativeEventWriter.endEventWrite(data, false);
    }
}
Also used : JfrNativeEventWriterData(com.oracle.svm.core.jfr.JfrNativeEventWriterData) Uninterruptible(com.oracle.svm.core.annotate.Uninterruptible)

Example 14 with JfrNativeEventWriterData

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

the class JfrGCEventFeature method emitGarbageCollectionEvent.

@Uninterruptible(reason = "Accesses a JFR buffer.")
public void emitGarbageCollectionEvent(UnsignedWord gcEpoch, GCCause cause, long start) {
    long end = JfrTicks.elapsedTicks();
    long pauseTime = end - start;
    if (SubstrateJVM.isRecording() && SubstrateJVM.get().isEnabled(JfrEvent.GarbageCollection)) {
        JfrNativeEventWriterData data = StackValue.get(JfrNativeEventWriterData.class);
        JfrNativeEventWriterDataAccess.initializeThreadLocalNativeBuffer(data);
        JfrNativeEventWriter.beginEventWrite(data, false);
        JfrNativeEventWriter.putLong(data, JfrEvent.GarbageCollection.getId());
        JfrNativeEventWriter.putLong(data, start);
        JfrNativeEventWriter.putLong(data, pauseTime);
        JfrNativeEventWriter.putLong(data, gcEpoch.rawValue());
        JfrNativeEventWriter.putLong(data, gcName.getId());
        JfrNativeEventWriter.putLong(data, cause.getId());
        // sum of pause
        JfrNativeEventWriter.putLong(data, pauseTime);
        // longest pause
        JfrNativeEventWriter.putLong(data, pauseTime);
        JfrNativeEventWriter.endEventWrite(data, false);
    }
}
Also used : JfrNativeEventWriterData(com.oracle.svm.core.jfr.JfrNativeEventWriterData) Uninterruptible(com.oracle.svm.core.annotate.Uninterruptible)

Aggregations

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