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);
}
}
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);
}
}
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);
}
}
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);
}
}
Aggregations