Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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 8a7a12b3e8..972f97ec26 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

Back to the top