/* Adjust the timestamp depending on the trace's offset */
long currTimestamp = ctfLocationData.getTimestamp();
- final long offsetTimestamp = currTimestamp - this.getTrace().getOffset();
+ final long offsetTimestamp = this.getCtfTmfTrace().getCTFTrace().timestampNanoToCycles(currTimestamp);
if (offsetTimestamp < 0) {
ret = super.seek(0L);
} else {
* Check if there is already one or more events for that timestamp, and
* assign the location index correctly
*/
- currTimestamp = this.getCurrentEvent().getTimestampValue();
long index = 0;
- for (long i = 0; i < ctfLocationData.getIndex(); i++) {
- if (currTimestamp == this.getCurrentEvent().getTimestampValue()) {
- index++;
- } else {
- index = 0;
+ if (this.getCurrentEvent() != null) {
+ currTimestamp = this.getCurrentEvent().getTimestampValue();
+
+ for (long i = 0; i < ctfLocationData.getIndex(); i++) {
+ if (currTimestamp == this.getCurrentEvent().getTimestampValue()) {
+ index++;
+ } else {
+ index = 0;
+ }
+ this.advance();
}
- this.advance();
+ } else {
+ ret= false;
}
-
/* Seek the current location accordingly */
if (ret) {
curLocation.setLocation(new CtfLocationData(getCurrentEvent().getTimestampValue(), index));