Search in sources :

Example 6 with JfrNativeEventWriterData

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

the class EveryChunkNativePeriodicEvents method emitPhysicalMemory.

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

Example 7 with JfrNativeEventWriterData

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

the class EveryChunkNativePeriodicEvents method emitJavaThreadStats.

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

Example 8 with JfrNativeEventWriterData

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

the class ThreadStartEvent method emit.

@Uninterruptible(reason = "Accesses a JFR buffer.")
public static void emit(IsolateThread isolateThread) {
    SubstrateJVM svm = SubstrateJVM.get();
    if (SubstrateJVM.isRecording() && svm.isEnabled(JfrEvent.ThreadStart)) {
        JfrNativeEventWriterData data = StackValue.get(JfrNativeEventWriterData.class);
        JfrNativeEventWriterDataAccess.initializeThreadLocalNativeBuffer(data);
        JfrNativeEventWriter.beginEventWrite(data, false);
        JfrNativeEventWriter.putLong(data, JfrEvent.ThreadStart.getId());
        JfrNativeEventWriter.putLong(data, JfrTicks.elapsedTicks());
        JfrNativeEventWriter.putEventThread(data);
        JfrNativeEventWriter.putLong(data, svm.getStackTraceId(JfrEvent.ThreadStart.getId(), 0));
        JfrNativeEventWriter.putThread(data, isolateThread);
        JfrNativeEventWriter.putLong(data, SubstrateJVM.getParentThreadId(isolateThread));
        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 9 with JfrNativeEventWriterData

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

the class EndChunkNativePeriodicEvents method emitJVMInformation.

@Uninterruptible(reason = "Accesses a JFR buffer.")
private static void emitJVMInformation(JVMInformation jvmInformation) {
    if (SubstrateJVM.isRecording() && SubstrateJVM.get().isEnabled(JfrEvent.JVMInformation)) {
        JfrNativeEventWriterData data = StackValue.get(JfrNativeEventWriterData.class);
        JfrNativeEventWriterDataAccess.initializeThreadLocalNativeBuffer(data);
        JfrNativeEventWriter.beginEventWrite(data, false);
        JfrNativeEventWriter.putLong(data, JfrEvent.JVMInformation.getId());
        JfrNativeEventWriter.putLong(data, JfrTicks.elapsedTicks());
        JfrNativeEventWriter.putString(data, jvmInformation.getJvmName());
        JfrNativeEventWriter.putString(data, jvmInformation.getJvmVersion());
        JfrNativeEventWriter.putString(data, jvmInformation.getJvmArguments());
        JfrNativeEventWriter.putString(data, jvmInformation.getJvmFlags());
        JfrNativeEventWriter.putString(data, jvmInformation.getJavaArguments());
        JfrNativeEventWriter.putLong(data, jvmInformation.getJvmStartTime());
        JfrNativeEventWriter.putLong(data, jvmInformation.getJvmPid());
        JfrNativeEventWriter.endEventWrite(data, false);
    }
}
Also used : JfrNativeEventWriterData(com.oracle.svm.core.jfr.JfrNativeEventWriterData) Uninterruptible(com.oracle.svm.core.annotate.Uninterruptible)

Example 10 with JfrNativeEventWriterData

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

the class EndChunkNativePeriodicEvents method emitInitialEnvironmentVariables.

@Uninterruptible(reason = "Accesses a JFR buffer.")
private static void emitInitialEnvironmentVariables(StringEntry[] envs) {
    if (SubstrateJVM.isRecording() && SubstrateJVM.get().isEnabled(JfrEvent.InitialEnvironmentVariable)) {
        JfrNativeEventWriterData data = StackValue.get(JfrNativeEventWriterData.class);
        JfrNativeEventWriterDataAccess.initializeThreadLocalNativeBuffer(data);
        for (StringEntry env : envs) {
            JfrNativeEventWriter.beginEventWrite(data, false);
            JfrNativeEventWriter.putLong(data, JfrEvent.InitialEnvironmentVariable.getId());
            JfrNativeEventWriter.putLong(data, JfrTicks.elapsedTicks());
            JfrNativeEventWriter.putString(data, env.key);
            JfrNativeEventWriter.putString(data, env.value);
            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