XML state system: Add timestamp field to the current eventfields
authorNaser Ezzati <n.ezzati@polymtl.ca>
Thu, 2 Oct 2014 20:52:07 +0000 (16:52 -0400)
committerAlexandre Montplaisir <alexmonthy@voxpopuli.im>
Tue, 7 Oct 2014 18:10:34 +0000 (14:10 -0400)
It is sometimes required to get also the timestamp of the events.

Change-Id: I013d91cbba4732245b1981b4e88f9c7648d05ec8
Signed-off-by: Naser Ezzati <n.ezzati@polymtl.ca>
Signed-off-by: Alexandre Montplaisir <alexmonthy@voxpopuli.im>
Reviewed-on: https://git.eclipse.org/r/34471
Reviewed-by: Genevieve Bastien <gbastien+lttng@versatic.net>
Tested-by: Hudson CI
org.eclipse.linuxtools.tmf.analysis.xml.core/META-INF/MANIFEST.MF
org.eclipse.linuxtools.tmf.analysis.xml.core/pom.xml
org.eclipse.linuxtools.tmf.analysis.xml.core/src/org/eclipse/linuxtools/tmf/analysis/xml/core/model/TmfXmlStateValue.java
org.eclipse.linuxtools.tmf.analysis.xml.core/src/org/eclipse/linuxtools/tmf/analysis/xml/core/stateprovider/TmfXmlStrings.java

index 6e92bdb74adaf171a6f85204c79b1efdf34f9d8e..30a372056def4ed32ed51457d837f358b1cfd84e 100644 (file)
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
 Bundle-ManifestVersion: 2
 Bundle-Name: %Bundle-Name
 Bundle-Vendor: %Bundle-Vendor
-Bundle-Version: 1.1.0.qualifier
+Bundle-Version: 1.2.0.qualifier
 Bundle-Localization: plugin
 Bundle-SymbolicName: org.eclipse.linuxtools.tmf.analysis.xml.core;singleton:=true
 Bundle-Activator: org.eclipse.linuxtools.internal.tmf.analysis.xml.core.Activator
index 04a3caedf22a96928ca800319c3ae5e2b3e49d74..3695da4e768160d7aa773915f660598984252af6 100644 (file)
@@ -18,7 +18,7 @@
   </parent>
 
   <artifactId>org.eclipse.linuxtools.tmf.analysis.xml.core</artifactId>
-  <version>1.1.0-SNAPSHOT</version>
+  <version>1.2.0-SNAPSHOT</version>
   <packaging>eclipse-plugin</packaging>
 
   <name>Linux Tools TMF Xml Analysis Core Plug-in</name>
index 0166d20866813d49754e218a07aaa8fb00f968d0..2b30ca9f06731d9c2e3b4b83d17a835b316d7f98 100644 (file)
@@ -257,6 +257,10 @@ public abstract class TmfXmlStateValue implements ITmfXmlStateValue {
         if (fieldName.equals(TmfXmlStrings.CPU)) {
             return TmfStateValue.newValueInt(Integer.valueOf(event.getSource()));
         }
+        /* Exception also for "TIMESTAMP", returns the timestamp of this event */
+        if (fieldName.equals(TmfXmlStrings.TIMESTAMP)) {
+            return TmfStateValue.newValueLong(event.getTimestamp().getValue());
+        }
         if (content.getField(fieldName) == null) {
             return value;
         }
index 7e1fa5d5053efb663e723d72660fc6a11f9e2a29..a3f61ef8a704579968084417eda2df893e5e15b7 100644 (file)
@@ -18,6 +18,7 @@ import org.eclipse.jdt.annotation.NonNullByDefault;
  * This file defines all name in the XML Structure for the State Provider
  *
  * @author Florian Wininger
+ * @noimplement This interface only contains static defines
  */
 @SuppressWarnings({ "javadoc", "nls" })
 @NonNullByDefault
@@ -82,6 +83,11 @@ public interface TmfXmlStrings {
     static final String STACK_PEEK = "peek";
     static final String CPU = "cpu";
 
+    /**
+     * @since 1.2
+     */
+    static final String TIMESTAMP = "timestamp";
+
     /* Operator type */
     static final String NOT = "not";
     static final String AND = "and";
This page took 0.028944 seconds and 5 git commands to generate.