aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBernd Hufmann2012-08-28 10:58:16 (EDT)
committerBernd Hufmann2012-08-31 10:43:43 (EDT)
commit93991ce4115c4dc5a3f84b625474cdcac8e76139 (patch)
treedfd95d5cf714d5e14e708d126e9ed801ef52a8e2
parent9a4d05c6b9e961698d972a40ee9c82e75f5b9560 (diff)
downloadorg.eclipse.linuxtools-93991ce4115c4dc5a3f84b625474cdcac8e76139.zip
org.eclipse.linuxtools-93991ce4115c4dc5a3f84b625474cdcac8e76139.tar.gz
org.eclipse.linuxtools-93991ce4115c4dc5a3f84b625474cdcac8e76139.tar.bz2
Add support for displaying of CTF context info in TMF (Bug 385494)
Change-Id: Ib1ca3094b7d203ac4207fb027d48629028571de4 Signed-off-by: Bernd Hufmann <bhufmann@gmail.com> Reviewed-on: https://git.eclipse.org/r/7456 Tested-by: Hudson CI Reviewed-by: Matthew Khouzam <matthew.khouzam@ericsson.com> IP-Clean: Matthew Khouzam <matthew.khouzam@ericsson.com> Tested-by: Matthew Khouzam <matthew.khouzam@ericsson.com>
-rw-r--r--lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/ctfadaptor/CtfTmfEvent.java22
1 files changed, 21 insertions, 1 deletions
diff --git a/lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/ctfadaptor/CtfTmfEvent.java b/lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/ctfadaptor/CtfTmfEvent.java
index 9de76d1..0d56c17 100644
--- a/lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/ctfadaptor/CtfTmfEvent.java
+++ b/lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/ctfadaptor/CtfTmfEvent.java
@@ -28,7 +28,7 @@ import org.eclipse.linuxtools.tmf.core.event.ITmfTimestamp;
/**
* A wrapper class around CTF's Event Definition/Declaration that maps all
* types of Declaration to native Java types.
- *
+ *
* @version 1.0
* @author Alexandre Montplaisir
*/
@@ -41,6 +41,8 @@ public final class CtfTmfEvent implements ITmfEvent, Cloneable {
private static final String NO_STREAM = "No stream"; //$NON-NLS-1$
private static final String EMPTY_CTF_EVENT_NAME = "Empty CTF event"; //$NON-NLS-1$
+ /** Prefix for Context information stored as CtfTmfEventfield */
+ private static final String CONTEXT_FIELD_PREFIX = "context."; //$NON-NLS-1$
// ------------------------------------------------------------------------
// Attributes
@@ -122,6 +124,24 @@ public final class CtfTmfEvent implements ITmfEvent, Cloneable {
fields.add(curField);
}
+ /* Add context information as CtfTmfEventField */
+ StructDefinition structContext = eventDef.getContext();
+ if (structContext != null) {
+ definitions = structContext.getDefinitions();
+ String curContextName;
+ Definition curContextDef;
+ CtfTmfEventField curContext;
+ it = definitions.entrySet().iterator();
+ while(it.hasNext()) {
+ Entry<String, Definition> entry = it.next();
+ /* Prefix field name to */
+ curContextName = CONTEXT_FIELD_PREFIX + entry.getKey();
+ curContextDef = entry.getValue();
+ curContext = CtfTmfEventField.parseField(curContextDef, curContextName);
+ fields.add(curContext);
+ }
+ }
+
return fields.toArray(new CtfTmfEventField[fields.size()]);
}