| author | Matthew Khouzam | 2012-04-10 10:26:35 (EDT) |
|---|---|---|
| committer | Francois Chouinard | 2012-04-16 14:20:07 (EDT) |
| commit | 408f27d3450e68e9bbc3a543ef925fed170e2bb9 (patch) (side-by-side diff) | |
| tree | 4135fc315ca0eabe08e623c223cd1851a02f4b7c | |
| parent | dad5bdc62af79bbf033f289556d0d8716e66fe44 (diff) | |
| download | org.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.java | 8 |
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 |

