summaryrefslogtreecommitdiffstatsabout
diff options
context:
space:
mode:
authorMatthew Khouzam2012-04-10 10:26:35 (EDT)
committer Francois Chouinard2012-04-16 14:20:07 (EDT)
commit408f27d3450e68e9bbc3a543ef925fed170e2bb9 (patch)
tree4135fc315ca0eabe08e623c223cd1851a02f4b7c
parentdad5bdc62af79bbf033f289556d0d8716e66fe44 (diff)
downloadorg.eclipse.linuxtools-408f27d3450e68e9bbc3a543ef925fed170e2bb9.zip
org.eclipse.linuxtools-408f27d3450e68e9bbc3a543ef925fed170e2bb9.tar.gz
org.eclipse.linuxtools-408f27d3450e68e9bbc3a543ef925fed170e2bb9.tar.bz2
fix seek with offsetted timestamps.
-rw-r--r--lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/ctfadaptor/CtfIterator.java8
1 files changed, 7 insertions, 1 deletions
diff --git a/lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/ctfadaptor/CtfIterator.java b/lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/ctfadaptor/CtfIterator.java
index 8a7a12b..972f97e 100644
--- a/lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/ctfadaptor/CtfIterator.java
+++ b/lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/ctfadaptor/CtfIterator.java
@@ -55,7 +55,12 @@ public class CtfIterator extends CTFTraceReader implements ITmfContext,
@Override
public boolean seek(long timestamp) {
boolean ret = false;
- ret = super.seek(timestamp);
+ long offsetTimestamp = timestamp - this.getCtfTmfTrace().getCTFTrace().getOffset();
+ if( offsetTimestamp < 0 ) {
+ ret = super.seek(timestamp);
+ } else {
+ ret = super.seek(offsetTimestamp);
+ }
if (ret) {
curLocation.setLocation(getCurrentEvent().getTimestampValue());
@@ -100,6 +105,7 @@ public class CtfIterator extends CTFTraceReader implements ITmfContext,
public void setLocation(ITmfLocation<?> location) {
// FIXME alex: isn't there a cleaner way than a cast here?
this.curLocation = (CtfLocation) location;
+ seek(((CtfLocation)location).getLocation());
}
@Override