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