package org.eclipse.tracecompass.lttng2.ust.core.trace;
+import java.util.Collection;
import java.util.Map;
import org.eclipse.core.resources.IProject;
import org.eclipse.tracecompass.internal.lttng2.ust.core.Activator;
import org.eclipse.tracecompass.internal.lttng2.ust.core.trace.layout.LttngUst20EventLayout;
import org.eclipse.tracecompass.internal.lttng2.ust.core.trace.layout.LttngUst27EventLayout;
+import org.eclipse.tracecompass.internal.lttng2.ust.core.trace.layout.LttngUst28EventLayout;
+import org.eclipse.tracecompass.lttng2.ust.core.analysis.debuginfo.UstDebugInfoBinaryAspect;
+import org.eclipse.tracecompass.lttng2.ust.core.analysis.debuginfo.UstDebugInfoSourceAspect;
import org.eclipse.tracecompass.lttng2.ust.core.trace.layout.ILttngUstEventLayout;
import org.eclipse.tracecompass.tmf.core.event.ITmfEvent;
+import org.eclipse.tracecompass.tmf.core.event.aspect.ITmfEventAspect;
import org.eclipse.tracecompass.tmf.core.exceptions.TmfTraceException;
import org.eclipse.tracecompass.tmf.core.trace.TraceValidationStatus;
import org.eclipse.tracecompass.tmf.ctf.core.trace.CtfTmfTrace;
import org.eclipse.tracecompass.tmf.ctf.core.trace.CtfTraceValidationStatus;
import org.eclipse.tracecompass.tmf.ctf.core.trace.CtfUtils;
+import com.google.common.collect.ImmutableSet;
+
/**
* Class to contain LTTng-UST traces
*
*/
public class LttngUstTrace extends CtfTmfTrace {
+ /**
+ * Name of the tracer that generates this trace type, as found in the CTF
+ * metadata.
+ *
+ * @since 2.0
+ */
+ public static final String TRACER_NAME = "lttng-ust"; //$NON-NLS-1$
+
private static final int CONFIDENCE = 100;
+ private static final @NonNull Collection<ITmfEventAspect> LTTNG_UST_ASPECTS;
+
+ static {
+ ImmutableSet.Builder<ITmfEventAspect> builder = ImmutableSet.builder();
+ builder.addAll(CtfTmfTrace.CTF_ASPECTS);
+ builder.add(UstDebugInfoBinaryAspect.INSTANCE);
+ builder.add(UstDebugInfoSourceAspect.INSTANCE);
+ LTTNG_UST_ASPECTS = builder.build();
+ }
+
private @Nullable ILttngUstEventLayout fLayout = null;
/**
* Default constructor
*/
public LttngUstTrace() {
- super();
+ super(LttngUstEventFactory.instance());
}
/**
int tracerMajor = CtfUtils.getTracerMajorVersion(this);
int tracerMinor = CtfUtils.getTracerMinorVersion(this);
- if ("lttng-ust".equals(tracerName)) { //$NON-NLS-1$
+ if (TRACER_NAME.equals(tracerName)) {
if (tracerMajor >= 2) {
- if (tracerMinor >= 7) {
+ if (tracerMinor >= 8) {
+ return LttngUst28EventLayout.getInstance();
+ } else if (tracerMinor >= 7) {
return LttngUst27EventLayout.getInstance();
}
return LttngUst20EventLayout.getInstance();
return LttngUst20EventLayout.getInstance();
}
+ @Override
+ public Iterable<ITmfEventAspect> getEventAspects() {
+ return LTTNG_UST_ASPECTS;
+ }
+
/**
* {@inheritDoc}
* <p>