diff options
author | Bernd Hufmann | 2012-08-28 14:58:16 +0000 |
---|---|---|
committer | Bernd Hufmann | 2012-08-31 17:43:40 +0000 |
commit | 35bc2d466b0fc2e024a2c8d94b85fedb1b0931a6 (patch) | |
tree | 761d27a8b5ca0b27e6c8ce4a974f180b1b91069d | |
parent | 7004aea22410051624538a398cb4a0f33477cc6a (diff) | |
download | org.eclipse.linuxtools-35bc2d466b0fc2e024a2c8d94b85fedb1b0931a6.tar.gz org.eclipse.linuxtools-35bc2d466b0fc2e024a2c8d94b85fedb1b0931a6.tar.xz org.eclipse.linuxtools-35bc2d466b0fc2e024a2c8d94b85fedb1b0931a6.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>
-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 9f14796228..eb8bcd65a1 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 @@ -120,6 +122,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()]); } |