import org.eclipse.tracecompass.ctf.core.event.IEventDeclaration;
import org.eclipse.tracecompass.ctf.core.event.types.ICompositeDefinition;
import org.eclipse.tracecompass.ctf.core.event.types.IDefinition;
+import org.eclipse.tracecompass.ctf.core.trace.ICTFStream;
import org.eclipse.tracecompass.tmf.core.event.ITmfCustomAttributes;
import org.eclipse.tracecompass.tmf.core.event.ITmfEventField;
import org.eclipse.tracecompass.tmf.core.event.ITmfEventType;
private final int fSourceCpu;
private final String fChannel;
- /** Field to override {@link TmfEvent#getName()}, to bypass the type-getting */
+ /**
+ * Field to override {@link TmfEvent#getName()}, to bypass the type-getting
+ */
private final String fEventName;
/** Lazy-loaded field containing the event's payload */
/** Lazy-loaded field for the type, overriding TmfEvent's field */
private transient @Nullable CtfTmfEventType fEventType;
+ private final @Nullable ICTFStream fStream;
+
// ------------------------------------------------------------------------
// Constructors
// ------------------------------------------------------------------------
fEventName = checkNotNull(declaration.getName());
fEvent = eventDefinition;
fChannel = channel;
+ fStream = fEvent.getDeclaration().getStream();
}
/**
fEventDeclaration = null;
fEvent = EventDefinition.NULL_EVENT;
fChannel = ""; //$NON-NLS-1$
+ fStream = null;
}
/**
fEventDeclaration = null;
fEvent = EventDefinition.NULL_EVENT;
fChannel = ""; //$NON-NLS-1$
+ fStream = null;
}
// ------------------------------------------------------------------------
return getChannel();
}
+ /**
+ * Get the stream Id
+ *
+ * @return the stream ID or -1 if the stream is null
+ * @since 2.0
+ */
+ public long getStreamId() {
+ ICTFStream stream = fStream;
+ if (stream == null) {
+ return -1;
+ }
+ return stream.getId();
+ }
+
// ------------------------------------------------------------------------
// TmfEvent
// ------------------------------------------------------------------------