summaryrefslogtreecommitdiffstatsabout
diff options
context:
space:
mode:
authorAlexandre Montplaisir2012-03-17 21:24:58 (EDT)
committer Francois Chouinard2012-03-19 17:44:03 (EDT)
commitf1be1c40b328402d3c3ce52ac381c5aee5ad1451 (patch)
tree2476aaa2677a7cf64913c9b5b4b3aee2f419d536
parent512f28fdb0bdaaab2de9a034784c73a973e2af0e (diff)
downloadorg.eclipse.linuxtools-f1be1c40b328402d3c3ce52ac381c5aee5ad1451.zip
org.eclipse.linuxtools-f1be1c40b328402d3c3ce52ac381c5aee5ad1451.tar.gz
org.eclipse.linuxtools-f1be1c40b328402d3c3ce52ac381c5aee5ad1451.tar.bz2
Make the Kernel event handler tests work again
- Strip the underscores in CtfTmfEventField's. We need to save a value here (we can't use the parser's lookupDefinition()), so might as well save it with no underscore. - Use the getSource() as a way to get the event name. This is still waiting on the final trace model. We are bypassing the EventTypeManager for now - Use getTimestampValue() to check for a nullEvent, getTimestamp always return the ITmfTimestamp object now, so it's not null!
-rw-r--r--lttng/org.eclipse.linuxtools.lttng2.kernel.core/src/org/eclipse/linuxtools/internal/lttng2/kernel/core/stateprovider/CTFKernelHandler.java4
-rw-r--r--lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/ctfadaptor/CtfTmfEvent.java4
-rw-r--r--lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/ctfadaptor/CtfTmfEventField.java7
3 files changed, 10 insertions, 5 deletions
diff --git a/lttng/org.eclipse.linuxtools.lttng2.kernel.core/src/org/eclipse/linuxtools/internal/lttng2/kernel/core/stateprovider/CTFKernelHandler.java b/lttng/org.eclipse.linuxtools.lttng2.kernel.core/src/org/eclipse/linuxtools/internal/lttng2/kernel/core/stateprovider/CTFKernelHandler.java
index c0fb8c4..b0e5c3f 100644
--- a/lttng/org.eclipse.linuxtools.lttng2.kernel.core/src/org/eclipse/linuxtools/internal/lttng2/kernel/core/stateprovider/CTFKernelHandler.java
+++ b/lttng/org.eclipse.linuxtools.lttng2.kernel.core/src/org/eclipse/linuxtools/internal/lttng2/kernel/core/stateprovider/CTFKernelHandler.java
@@ -76,7 +76,7 @@ class CTFKernelHandler implements Runnable {
try {
event = inQueue.take();
- while (event.getTimestamp() != null) {
+ while (event.getTimestampValue() != -1) {
processEvent(event);
event = inQueue.take();
}
@@ -109,7 +109,7 @@ class CTFKernelHandler implements Runnable {
private void processEvent(CtfTmfEvent event) {
currentEvent = event;
ITmfEventField content = event.getContent();
- String eventName = event.getType().getName();
+ String eventName = event.getSource();
long ts = event.getTimestamp().getValue();
int quark;
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 65e1e02..f54556b 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
@@ -250,8 +250,8 @@ public final class CtfTmfEvent implements ITmfEvent {
@Override
public String getSource() {
- // TODO Auto-generated method stub
- return null;
+ // TODO Returns eventName for now
+ return eventName;
}
@Override
diff --git a/lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/ctfadaptor/CtfTmfEventField.java b/lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/ctfadaptor/CtfTmfEventField.java
index bf33ef2..88c55e1 100644
--- a/lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/ctfadaptor/CtfTmfEventField.java
+++ b/lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/ctfadaptor/CtfTmfEventField.java
@@ -38,7 +38,12 @@ public abstract class CtfTmfEventField implements ITmfEventField {
// ------------------------------------------------------------------------
protected CtfTmfEventField(String name) {
- this.name = name;
+ /* Strip the damn underscores, screw you CTF */
+ if ( name.startsWith("_") ) { //$NON-NLS-1$
+ this.name = name.substring(1);
+ } else {
+ this.name = name;
+ }
}
// ------------------------------------------------------------------------