diff options
author | Bernd Hufmann | 2012-08-28 14:58:16 +0000 |
---|---|---|
committer | Bernd Hufmann | 2012-08-31 14:43:43 +0000 |
commit | 93991ce4115c4dc5a3f84b625474cdcac8e76139 (patch) | |
tree | dfd95d5cf714d5e14e708d126e9ed801ef52a8e2 /lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf | |
parent | 9a4d05c6b9e961698d972a40ee9c82e75f5b9560 (diff) | |
download | org.eclipse.linuxtools-93991ce4115c4dc5a3f84b625474cdcac8e76139.tar.gz org.eclipse.linuxtools-93991ce4115c4dc5a3f84b625474cdcac8e76139.tar.xz org.eclipse.linuxtools-93991ce4115c4dc5a3f84b625474cdcac8e76139.zip |
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>
Diffstat (limited to 'lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf')
-rw-r--r-- | lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/ctfadaptor/CtfTmfEvent.java | 22 |
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 9de76d1eb4..0d56c17072 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()]); } |