Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Khouzam2016-09-29 13:14:00 -0400
committerMatthew Khouzam2019-07-04 13:57:29 -0400
commit3f31d0c32c48433c49fe727dc4ff35e4f2293b08 (patch)
treecc98c5753862c7a8b5307fc1cdb58d30bbb3f01c
parent1840c2a0e60aa57fb67c5e98615e29590c4349dc (diff)
downloadorg.eclipse.tracecompass-3f31d0c32c48433c49fe727dc4ff35e4f2293b08.tar.gz
org.eclipse.tracecompass-3f31d0c32c48433c49fe727dc4ff35e4f2293b08.tar.xz
org.eclipse.tracecompass-3f31d0c32c48433c49fe727dc4ff35e4f2293b08.zip
ctf: add event, packet and stream aspects to CTF
[Added] context columns in events table for CTF Traces Change-Id: I0e37829f5b7138094f5cbe58274ec61ed11085b2 Signed-off-by: Matthew Khouzam <matthew.khouzam@ericsson.com> Reviewed-on: https://git.eclipse.org/r/82199 Reviewed-by: Patrick Tasse <patrick.tasse@gmail.com> Tested-by: Patrick Tasse <patrick.tasse@gmail.com> Tested-by: CI Bot
-rw-r--r--ctf/org.eclipse.tracecompass.ctf.core/src/org/eclipse/tracecompass/ctf/core/event/IEventDefinition.java11
-rw-r--r--ctf/org.eclipse.tracecompass.ctf.core/src/org/eclipse/tracecompass/internal/ctf/core/event/EventDefinition.java5
-rw-r--r--ctf/org.eclipse.tracecompass.tmf.ctf.core/META-INF/MANIFEST.MF2
-rw-r--r--ctf/org.eclipse.tracecompass.tmf.ctf.core/src/org/eclipse/tracecompass/internal/tmf/ctf/core/event/aspect/CtfEventContextAspect.java82
-rw-r--r--ctf/org.eclipse.tracecompass.tmf.ctf.core/src/org/eclipse/tracecompass/internal/tmf/ctf/core/event/aspect/CtfPacketContextAspect.java72
-rw-r--r--ctf/org.eclipse.tracecompass.tmf.ctf.core/src/org/eclipse/tracecompass/internal/tmf/ctf/core/event/aspect/CtfPacketHeaderAspect.java82
-rw-r--r--ctf/org.eclipse.tracecompass.tmf.ctf.core/src/org/eclipse/tracecompass/internal/tmf/ctf/core/event/aspect/CtfStreamContextAspect.java82
-rw-r--r--ctf/org.eclipse.tracecompass.tmf.ctf.core/src/org/eclipse/tracecompass/internal/tmf/ctf/core/event/aspect/Messages.java59
-rw-r--r--ctf/org.eclipse.tracecompass.tmf.ctf.core/src/org/eclipse/tracecompass/internal/tmf/ctf/core/event/aspect/messages.properties20
-rw-r--r--ctf/org.eclipse.tracecompass.tmf.ctf.core/src/org/eclipse/tracecompass/tmf/ctf/core/event/CtfTmfEvent.java29
-rw-r--r--ctf/org.eclipse.tracecompass.tmf.ctf.core/src/org/eclipse/tracecompass/tmf/ctf/core/trace/CtfTmfTrace.java15
11 files changed, 453 insertions, 6 deletions
diff --git a/ctf/org.eclipse.tracecompass.ctf.core/src/org/eclipse/tracecompass/ctf/core/event/IEventDefinition.java b/ctf/org.eclipse.tracecompass.ctf.core/src/org/eclipse/tracecompass/ctf/core/event/IEventDefinition.java
index 1bfa52bfb5..66c57d763a 100644
--- a/ctf/org.eclipse.tracecompass.ctf.core/src/org/eclipse/tracecompass/ctf/core/event/IEventDefinition.java
+++ b/ctf/org.eclipse.tracecompass.ctf.core/src/org/eclipse/tracecompass/ctf/core/event/IEventDefinition.java
@@ -12,6 +12,7 @@ package org.eclipse.tracecompass.ctf.core.event;
import java.util.Map;
import org.eclipse.jdt.annotation.NonNull;
+import org.eclipse.jdt.annotation.Nullable;
import org.eclipse.tracecompass.ctf.core.event.types.ICompositeDefinition;
/**
@@ -90,4 +91,14 @@ public interface IEventDefinition {
*/
@NonNull Map<@NonNull String, @NonNull Object> getPacketAttributes();
+ /**
+ * Gets the stream context of a given event
+ *
+ * @return the stream context
+ * @since 4.0
+ */
+ default @Nullable ICompositeDefinition getStreamContext() {
+ return null;
+ }
+
} \ No newline at end of file
diff --git a/ctf/org.eclipse.tracecompass.ctf.core/src/org/eclipse/tracecompass/internal/ctf/core/event/EventDefinition.java b/ctf/org.eclipse.tracecompass.ctf.core/src/org/eclipse/tracecompass/internal/ctf/core/event/EventDefinition.java
index 9f7ab4fb56..1b6c7c27d1 100644
--- a/ctf/org.eclipse.tracecompass.ctf.core/src/org/eclipse/tracecompass/internal/ctf/core/event/EventDefinition.java
+++ b/ctf/org.eclipse.tracecompass.ctf.core/src/org/eclipse/tracecompass/internal/ctf/core/event/EventDefinition.java
@@ -161,6 +161,11 @@ public final class EventDefinition implements IDefinitionScope, IEventDefinition
}
@Override
+ public ICompositeDefinition getStreamContext() {
+ return fStreamContext;
+ }
+
+ @Override
public ICompositeDefinition getContext() {
/* Most common case so far */
diff --git a/ctf/org.eclipse.tracecompass.tmf.ctf.core/META-INF/MANIFEST.MF b/ctf/org.eclipse.tracecompass.tmf.ctf.core/META-INF/MANIFEST.MF
index ca8b0beafc..453f1f6708 100644
--- a/ctf/org.eclipse.tracecompass.tmf.ctf.core/META-INF/MANIFEST.MF
+++ b/ctf/org.eclipse.tracecompass.tmf.ctf.core/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %Bundle-Name
Bundle-Vendor: %Bundle-Vendor
-Bundle-Version: 4.1.2.qualifier
+Bundle-Version: 4.2.0.qualifier
Bundle-Localization: plugin
Bundle-SymbolicName: org.eclipse.tracecompass.tmf.ctf.core;singleton:=true
Bundle-Activator: org.eclipse.tracecompass.internal.tmf.ctf.core.Activator
diff --git a/ctf/org.eclipse.tracecompass.tmf.ctf.core/src/org/eclipse/tracecompass/internal/tmf/ctf/core/event/aspect/CtfEventContextAspect.java b/ctf/org.eclipse.tracecompass.tmf.ctf.core/src/org/eclipse/tracecompass/internal/tmf/ctf/core/event/aspect/CtfEventContextAspect.java
new file mode 100644
index 0000000000..fefa5429d5
--- /dev/null
+++ b/ctf/org.eclipse.tracecompass.tmf.ctf.core/src/org/eclipse/tracecompass/internal/tmf/ctf/core/event/aspect/CtfEventContextAspect.java
@@ -0,0 +1,82 @@
+/*******************************************************************************
+ * Copyright (c) 2019 Ericsson
+ *
+ * All rights reserved. This program and the accompanying materials are
+ * made available under the terms of the Eclipse Public License v1.0 which
+ * accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *******************************************************************************/
+
+package org.eclipse.tracecompass.internal.tmf.ctf.core.event.aspect;
+
+import java.util.Arrays;
+import java.util.List;
+
+import org.eclipse.jdt.annotation.NonNull;
+import org.eclipse.jdt.annotation.Nullable;
+import org.eclipse.tracecompass.ctf.core.event.types.ICompositeDefinition;
+import org.eclipse.tracecompass.tmf.core.event.ITmfEvent;
+import org.eclipse.tracecompass.tmf.core.event.ITmfEventField;
+import org.eclipse.tracecompass.tmf.core.event.aspect.ITmfEventAspect;
+import org.eclipse.tracecompass.tmf.ctf.core.event.CtfTmfEvent;
+import org.eclipse.tracecompass.tmf.ctf.core.event.CtfTmfEventField;
+
+/**
+ * Event context event aspect for CTF traces.
+ *
+ * @author Matthew Khouzam
+ */
+public class CtfEventContextAspect implements ITmfEventAspect<List<ITmfEventField>> {
+
+ private static final @NonNull String ANON = ""; //$NON-NLS-1$
+ private static ITmfEventAspect<List<ITmfEventField>> sInstance = null;
+
+ /**
+ * Get the instance
+ *
+ * @return the instance
+ */
+ public static @NonNull ITmfEventAspect<List<ITmfEventField>> getInstance() {
+ ITmfEventAspect<List<ITmfEventField>> instance = sInstance;
+ if (instance == null) {
+ instance = new CtfEventContextAspect();
+ sInstance = instance;
+ }
+ return instance;
+ }
+
+ private CtfEventContextAspect() {
+ // do nothing
+ }
+
+ @Override
+ public List<ITmfEventField> resolve(ITmfEvent event) {
+ if (!(event instanceof CtfTmfEvent)) {
+ return null;
+ }
+ ICompositeDefinition eventContext = ((CtfTmfEvent) event).getEventContext();
+ if (eventContext == null) {
+ return null;
+ }
+ Object value = CtfTmfEventField.parseField(eventContext, ANON).getValue();
+ if (value instanceof ITmfEventField[]) {
+ return Arrays.asList((@Nullable ITmfEventField @Nullable []) value);
+ }
+ return null;
+ }
+
+ @Override
+ public @NonNull String getName() {
+ return Messages.getMessage(Messages.CtfEventContextAspect_name);
+ }
+
+ @Override
+ public @NonNull String getHelpText() {
+ return Messages.getMessage(Messages.CtfEventContextAspect_description);
+ }
+
+ @Override
+ public boolean isHiddenByDefault() {
+ return true;
+ }
+}
diff --git a/ctf/org.eclipse.tracecompass.tmf.ctf.core/src/org/eclipse/tracecompass/internal/tmf/ctf/core/event/aspect/CtfPacketContextAspect.java b/ctf/org.eclipse.tracecompass.tmf.ctf.core/src/org/eclipse/tracecompass/internal/tmf/ctf/core/event/aspect/CtfPacketContextAspect.java
new file mode 100644
index 0000000000..07a3d1d473
--- /dev/null
+++ b/ctf/org.eclipse.tracecompass.tmf.ctf.core/src/org/eclipse/tracecompass/internal/tmf/ctf/core/event/aspect/CtfPacketContextAspect.java
@@ -0,0 +1,72 @@
+/*******************************************************************************
+ * Copyright (c) 2019 Ericsson
+ *
+ * All rights reserved. This program and the accompanying materials are
+ * made available under the terms of the Eclipse Public License v1.0 which
+ * accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *******************************************************************************/
+
+package org.eclipse.tracecompass.internal.tmf.ctf.core.event.aspect;
+
+import java.util.Map;
+
+import org.eclipse.jdt.annotation.NonNull;
+import org.eclipse.tracecompass.tmf.core.event.ITmfEvent;
+import org.eclipse.tracecompass.tmf.core.event.aspect.ITmfEventAspect;
+import org.eclipse.tracecompass.tmf.ctf.core.event.CtfTmfEvent;
+
+/**
+ * Packet context aspect for CTF traces.
+ *
+ * @author Matthew Khouzam
+ */
+public class CtfPacketContextAspect implements ITmfEventAspect<Map<@NonNull String, @NonNull Object>> {
+
+ private static ITmfEventAspect<Map<@NonNull String, @NonNull Object>> sInstance = null;
+
+ /**
+ * Get the instance
+ *
+ * @return the instance
+ */
+ public static @NonNull ITmfEventAspect<Map<@NonNull String, @NonNull Object>> getInstance() {
+ ITmfEventAspect<Map<@NonNull String, @NonNull Object>> instance = sInstance;
+ if (instance == null) {
+ instance = new CtfPacketContextAspect();
+ sInstance = instance;
+ }
+ return instance;
+ }
+
+ private CtfPacketContextAspect() {
+ // do nothing
+ }
+
+ @Override
+ public Map<@NonNull String, @NonNull Object> resolve(ITmfEvent event) {
+ if (!(event instanceof CtfTmfEvent)) {
+ return null;
+ }
+ Map<@NonNull String, @NonNull Object> packetContext = ((CtfTmfEvent) event).getPacketAttributes();
+ if (packetContext.isEmpty()) {
+ return null;
+ }
+ return packetContext;
+ }
+
+ @Override
+ public @NonNull String getName() {
+ return Messages.getMessage(Messages.CtfPacketContextAspect_name);
+ }
+
+ @Override
+ public @NonNull String getHelpText() {
+ return Messages.getMessage(Messages.CtfPacketContextAspect_description);
+ }
+
+ @Override
+ public boolean isHiddenByDefault() {
+ return true;
+ }
+}
diff --git a/ctf/org.eclipse.tracecompass.tmf.ctf.core/src/org/eclipse/tracecompass/internal/tmf/ctf/core/event/aspect/CtfPacketHeaderAspect.java b/ctf/org.eclipse.tracecompass.tmf.ctf.core/src/org/eclipse/tracecompass/internal/tmf/ctf/core/event/aspect/CtfPacketHeaderAspect.java
new file mode 100644
index 0000000000..82b9bbc2b4
--- /dev/null
+++ b/ctf/org.eclipse.tracecompass.tmf.ctf.core/src/org/eclipse/tracecompass/internal/tmf/ctf/core/event/aspect/CtfPacketHeaderAspect.java
@@ -0,0 +1,82 @@
+/*******************************************************************************
+ * Copyright (c) 2019 Ericsson
+ *
+ * All rights reserved. This program and the accompanying materials are
+ * made available under the terms of the Eclipse Public License v1.0 which
+ * accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *******************************************************************************/
+
+package org.eclipse.tracecompass.internal.tmf.ctf.core.event.aspect;
+
+import java.util.Arrays;
+import java.util.List;
+
+import org.eclipse.jdt.annotation.NonNull;
+import org.eclipse.jdt.annotation.Nullable;
+import org.eclipse.tracecompass.ctf.core.event.types.ICompositeDefinition;
+import org.eclipse.tracecompass.tmf.core.event.ITmfEvent;
+import org.eclipse.tracecompass.tmf.core.event.ITmfEventField;
+import org.eclipse.tracecompass.tmf.core.event.aspect.ITmfEventAspect;
+import org.eclipse.tracecompass.tmf.ctf.core.event.CtfTmfEvent;
+import org.eclipse.tracecompass.tmf.ctf.core.event.CtfTmfEventField;
+
+/**
+ * Packet header aspect for CTF traces.
+ *
+ * @author Matthew Khouzam
+ */
+public class CtfPacketHeaderAspect implements ITmfEventAspect<List<ITmfEventField>> {
+
+ private static final @NonNull String ANON = ""; //$NON-NLS-1$
+ private static ITmfEventAspect<List<ITmfEventField>> sInstance = null;
+
+ /**
+ * Get the instance
+ *
+ * @return the instance
+ */
+ public static @NonNull ITmfEventAspect<List<ITmfEventField>> getInstance() {
+ ITmfEventAspect<List<ITmfEventField>> instance = sInstance;
+ if (instance == null) {
+ instance = new CtfPacketHeaderAspect();
+ sInstance = instance;
+ }
+ return instance;
+ }
+
+ private CtfPacketHeaderAspect() {
+ // do nothing
+ }
+
+ @Override
+ public @Nullable List<ITmfEventField> resolve(ITmfEvent event) {
+ if (!(event instanceof CtfTmfEvent)) {
+ return null;
+ }
+ ICompositeDefinition packetContext = ((CtfTmfEvent) event).getPacketContext();
+ if (packetContext == null) {
+ return null;
+ }
+ Object value = CtfTmfEventField.parseField(packetContext, ANON).getValue();
+ if(value instanceof ITmfEventField[]) {
+ return Arrays.asList((ITmfEventField[]) value);
+ }
+ return null;
+ }
+
+ @Override
+ public @NonNull String getName() {
+ return Messages.getMessage(Messages.CtfPacketHeaderAspect_name);
+ }
+
+ @Override
+ public @NonNull String getHelpText() {
+ return Messages.getMessage(Messages.CtfPacketHeaderAspect_description);
+ }
+
+ @Override
+ public boolean isHiddenByDefault() {
+ return true;
+ }
+}
diff --git a/ctf/org.eclipse.tracecompass.tmf.ctf.core/src/org/eclipse/tracecompass/internal/tmf/ctf/core/event/aspect/CtfStreamContextAspect.java b/ctf/org.eclipse.tracecompass.tmf.ctf.core/src/org/eclipse/tracecompass/internal/tmf/ctf/core/event/aspect/CtfStreamContextAspect.java
new file mode 100644
index 0000000000..34701b02a6
--- /dev/null
+++ b/ctf/org.eclipse.tracecompass.tmf.ctf.core/src/org/eclipse/tracecompass/internal/tmf/ctf/core/event/aspect/CtfStreamContextAspect.java
@@ -0,0 +1,82 @@
+/*******************************************************************************
+ * Copyright (c) 2019 Ericsson
+ *
+ * All rights reserved. This program and the accompanying materials are
+ * made available under the terms of the Eclipse Public License v1.0 which
+ * accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *******************************************************************************/
+
+package org.eclipse.tracecompass.internal.tmf.ctf.core.event.aspect;
+
+import java.util.Arrays;
+import java.util.List;
+
+import org.eclipse.jdt.annotation.NonNull;
+import org.eclipse.jdt.annotation.Nullable;
+import org.eclipse.tracecompass.ctf.core.event.types.ICompositeDefinition;
+import org.eclipse.tracecompass.tmf.core.event.ITmfEvent;
+import org.eclipse.tracecompass.tmf.core.event.ITmfEventField;
+import org.eclipse.tracecompass.tmf.core.event.aspect.ITmfEventAspect;
+import org.eclipse.tracecompass.tmf.ctf.core.event.CtfTmfEvent;
+import org.eclipse.tracecompass.tmf.ctf.core.event.CtfTmfEventField;
+
+/**
+ * Stream context event aspect for CTF traces.
+ *
+ * @author Matthew Khouzam
+ */
+public class CtfStreamContextAspect implements ITmfEventAspect<List<ITmfEventField>> {
+
+ private static final @NonNull String ANON = ""; //$NON-NLS-1$
+ private static ITmfEventAspect<List<ITmfEventField>> sInstance = null;
+
+ /**
+ * Get the instance
+ *
+ * @return the instance
+ */
+ public static @NonNull ITmfEventAspect<List<ITmfEventField>> getInstance() {
+ ITmfEventAspect<List<ITmfEventField>> instance = sInstance;
+ if (instance == null) {
+ instance = new CtfStreamContextAspect();
+ sInstance = instance;
+ }
+ return instance;
+ }
+
+ private CtfStreamContextAspect() {
+ // do nothing
+ }
+
+ @Override
+ public List<ITmfEventField> resolve(ITmfEvent event) {
+ if (!(event instanceof CtfTmfEvent)) {
+ return null;
+ }
+ ICompositeDefinition streamContext = ((CtfTmfEvent) event).getStreamContext();
+ if (streamContext == null) {
+ return null;
+ }
+ Object value = CtfTmfEventField.parseField(streamContext, ANON).getValue();
+ if(value instanceof ITmfEventField[]) {
+ return Arrays.asList((@Nullable ITmfEventField @Nullable []) value);
+ }
+ return null;
+ }
+
+ @Override
+ public @NonNull String getName() {
+ return Messages.getMessage(Messages.CtfStreamContextAspect_name);
+ }
+
+ @Override
+ public @NonNull String getHelpText() {
+ return Messages.getMessage(Messages.CtfStreamContextAspect_description);
+ }
+
+ @Override
+ public boolean isHiddenByDefault() {
+ return true;
+ }
+}
diff --git a/ctf/org.eclipse.tracecompass.tmf.ctf.core/src/org/eclipse/tracecompass/internal/tmf/ctf/core/event/aspect/Messages.java b/ctf/org.eclipse.tracecompass.tmf.ctf.core/src/org/eclipse/tracecompass/internal/tmf/ctf/core/event/aspect/Messages.java
new file mode 100644
index 0000000000..e3bf6e20a3
--- /dev/null
+++ b/ctf/org.eclipse.tracecompass.tmf.ctf.core/src/org/eclipse/tracecompass/internal/tmf/ctf/core/event/aspect/Messages.java
@@ -0,0 +1,59 @@
+/*******************************************************************************
+ * Copyright (c) 2019 Ericsson
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *******************************************************************************/
+
+package org.eclipse.tracecompass.internal.tmf.ctf.core.event.aspect;
+
+import org.eclipse.jdt.annotation.NonNull;
+import org.eclipse.osgi.util.NLS;
+
+/**
+ * Messages
+ */
+public class Messages extends NLS {
+ private static final String BUNDLE_NAME = "org.eclipse.tracecompass.internal.tmf.ctf.core.event.aspect.messages"; //$NON-NLS-1$
+
+ /** Packet header name */
+ public static String CtfPacketHeaderAspect_name;
+ /** Packet header description */
+ public static String CtfPacketHeaderAspect_description;
+ /** Packet context name */
+ public static String CtfPacketContextAspect_name;
+ /** Packet context description */
+ public static String CtfPacketContextAspect_description;
+ /** Stream context name */
+ public static String CtfStreamContextAspect_name;
+ /** Stream context description */
+ public static String CtfStreamContextAspect_description;
+ /** Event context name */
+ public static String CtfEventContextAspect_name;
+ /** Event context description */
+ public static String CtfEventContextAspect_description;
+
+ static {
+ // initialize resource bundle
+ NLS.initializeMessages(BUNDLE_NAME, Messages.class);
+ }
+
+ /**
+ * NonNull wrapper
+ *
+ * @param msg
+ * message
+ * @return message or "" if msg is null
+ */
+ public static @NonNull String getMessage(String msg) {
+ if (msg == null) {
+ return ""; //$NON-NLS-1$
+ }
+ return msg;
+ }
+
+ private Messages() {
+ // Do nothing
+ }
+}
diff --git a/ctf/org.eclipse.tracecompass.tmf.ctf.core/src/org/eclipse/tracecompass/internal/tmf/ctf/core/event/aspect/messages.properties b/ctf/org.eclipse.tracecompass.tmf.ctf.core/src/org/eclipse/tracecompass/internal/tmf/ctf/core/event/aspect/messages.properties
new file mode 100644
index 0000000000..d41d67efa1
--- /dev/null
+++ b/ctf/org.eclipse.tracecompass.tmf.ctf.core/src/org/eclipse/tracecompass/internal/tmf/ctf/core/event/aspect/messages.properties
@@ -0,0 +1,20 @@
+###############################################################################
+# Copyright (c) 2019 Ericsson
+#
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+# Ericsson - Initial API and implementation
+###############################################################################
+
+CtfPacketHeaderAspect_name=Trace Packet Header
+CtfPacketHeaderAspect_description=The trace packet header of an event. The value can change for every packet, for every event in a same packet, the value will be the same.
+CtfPacketContextAspect_name=Packet Context
+CtfPacketContextAspect_description=The per-packet context of an event. The value can change for every packet, for every event in a same packet, the value will be the same.
+CtfStreamContextAspect_name=Stream Context
+CtfStreamContextAspect_description=The per-stream context of an event. The value can change for every event.
+CtfEventContextAspect_name=Event Context
+CtfEventContextAspect_description=The per-event type context of an event. The value can change for every event.
diff --git a/ctf/org.eclipse.tracecompass.tmf.ctf.core/src/org/eclipse/tracecompass/tmf/ctf/core/event/CtfTmfEvent.java b/ctf/org.eclipse.tracecompass.tmf.ctf.core/src/org/eclipse/tracecompass/tmf/ctf/core/event/CtfTmfEvent.java
index 14b0a29246..2c2d8ca7e1 100644
--- a/ctf/org.eclipse.tracecompass.tmf.ctf.core/src/org/eclipse/tracecompass/tmf/ctf/core/event/CtfTmfEvent.java
+++ b/ctf/org.eclipse.tracecompass.tmf.ctf.core/src/org/eclipse/tracecompass/tmf/ctf/core/event/CtfTmfEvent.java
@@ -385,6 +385,35 @@ public class CtfTmfEvent extends TmfEvent
return fPacketAttributes;
}
+ /**
+ * Get the packet context
+ *
+ * @return the packet context
+ * @since 4.2
+ */
+ public @Nullable ICompositeDefinition getPacketContext() {
+ return fEvent.getPacketContext();
+ }
+
+ /**
+ * Get the stream context
+ *
+ * @return the stream context
+ * @since 4.2
+ */
+ public @Nullable ICompositeDefinition getStreamContext() {
+ return fEvent.getStreamContext();
+ }
+
+ /**
+ * Get the event context
+ *
+ * @return the event context
+ * @since 4.2
+ */
+ public @Nullable ICompositeDefinition getEventContext() {
+ return fEvent.getEventContext();
+ }
// ------------------------------------------------------------------------
// Object
// ------------------------------------------------------------------------
diff --git a/ctf/org.eclipse.tracecompass.tmf.ctf.core/src/org/eclipse/tracecompass/tmf/ctf/core/trace/CtfTmfTrace.java b/ctf/org.eclipse.tracecompass.tmf.ctf.core/src/org/eclipse/tracecompass/tmf/ctf/core/trace/CtfTmfTrace.java
index cbd7372f04..ea8a6a479a 100644
--- a/ctf/org.eclipse.tracecompass.tmf.ctf.core/src/org/eclipse/tracecompass/tmf/ctf/core/trace/CtfTmfTrace.java
+++ b/ctf/org.eclipse.tracecompass.tmf.ctf.core/src/org/eclipse/tracecompass/tmf/ctf/core/trace/CtfTmfTrace.java
@@ -50,6 +50,10 @@ import org.eclipse.tracecompass.ctf.core.trace.CTFTraceWriter;
import org.eclipse.tracecompass.ctf.core.trace.ICTFStream;
import org.eclipse.tracecompass.ctf.core.trace.Metadata;
import org.eclipse.tracecompass.internal.tmf.ctf.core.Activator;
+import org.eclipse.tracecompass.internal.tmf.ctf.core.event.aspect.CtfEventContextAspect;
+import org.eclipse.tracecompass.internal.tmf.ctf.core.event.aspect.CtfPacketContextAspect;
+import org.eclipse.tracecompass.internal.tmf.ctf.core.event.aspect.CtfPacketHeaderAspect;
+import org.eclipse.tracecompass.internal.tmf.ctf.core.event.aspect.CtfStreamContextAspect;
import org.eclipse.tracecompass.internal.tmf.ctf.core.trace.iterator.CtfIterator;
import org.eclipse.tracecompass.internal.tmf.ctf.core.trace.iterator.CtfIteratorManager;
import org.eclipse.tracecompass.tmf.core.event.ITmfEvent;
@@ -125,7 +129,11 @@ public class CtfTmfTrace extends TmfTrace
new CtfChannelAspect(),
new CtfCpuAspect(),
TmfBaseAspects.getEventTypeAspect(),
- TmfBaseAspects.getContentsAspect());
+ TmfBaseAspects.getContentsAspect(),
+ CtfPacketHeaderAspect.getInstance(),
+ CtfPacketContextAspect.getInstance(),
+ CtfStreamContextAspect.getInstance(),
+ CtfEventContextAspect.getInstance());
/**
* The Ctf clock unique identifier field
@@ -172,10 +180,7 @@ public class CtfTmfTrace extends TmfTrace
* Default constructor
*/
public CtfTmfTrace() {
- super();
-
- /* Use default event factory */
- fEventFactory = CtfTmfEventFactory.instance();
+ this(CtfTmfEventFactory.instance());
}
/**

Back to the top