ust: Add trace constructor with event factory
authorGeneviève Bastien <gbastien+lttng@versatic.net>
Wed, 10 May 2017 18:29:59 +0000 (14:29 -0400)
committerGenevieve Bastien <gbastien+lttng@versatic.net>
Fri, 12 May 2017 15:40:15 +0000 (11:40 -0400)
Traces extending the UST trace may pass their own event factory to the
constructor to parse additional fields.

Example use case for this: A JUL trace of Trace Compass taken with LTTng
is a UST trace, but the CTF field 'msg' is a json string from which we
can extract extra fields. The event factory will do just that.

Change-Id: Ic9ac1fde9df655f6b529cb0fbcd2ed0d3932d0b5
Signed-off-by: Geneviève Bastien <gbastien+lttng@versatic.net>
Reviewed-on: https://git.eclipse.org/r/96765
Reviewed-by: Hudson CI
lttng/org.eclipse.tracecompass.lttng2.ust.core/META-INF/MANIFEST.MF
lttng/org.eclipse.tracecompass.lttng2.ust.core/src/org/eclipse/tracecompass/lttng2/ust/core/trace/LttngUstTrace.java

index c931a83fbb6991c26318ef0aa7f63e17213ca001..67ed9e5129ab9a5959c8cdc4fb46adef03f509ec 100644 (file)
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
 Bundle-ManifestVersion: 2
 Bundle-Name: %Bundle-Name
 Bundle-Vendor: %Bundle-Vendor
-Bundle-Version: 2.1.1.qualifier
+Bundle-Version: 2.2.0.qualifier
 Bundle-Localization: plugin
 Bundle-SymbolicName: org.eclipse.tracecompass.lttng2.ust.core;singleton:=true
 Bundle-Activator: org.eclipse.tracecompass.internal.lttng2.ust.core.Activator
index 96e9b9dd401acffca2605d06651682e1d0e61f26..ab98e513d77db3b9af3f6a4f4ba2dc4eb83669bb 100644 (file)
@@ -37,6 +37,7 @@ 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.event.CtfTmfEventFactory;
 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;
@@ -80,6 +81,19 @@ public class LttngUstTrace extends CtfTmfTrace {
         super(LttngUstEventFactory.instance());
     }
 
+    /**
+     * Protected constructor for child classes. Classes extending this one may
+     * have extra fields coming from the event itself and may pass their own
+     * event factory.
+     *
+     * @param factory
+     *            The event factory for this specific trace
+     * @since 2.2
+     */
+    protected LttngUstTrace(@NonNull CtfTmfEventFactory factory) {
+        super(factory);
+    }
+
     /**
      * Get the event layout to use with this trace. This normally depends on the
      * tracer's version.
This page took 0.025368 seconds and 5 git commands to generate.