ctf: Fix unreliable handling of invalid location
This could lead to bad seeks when opening experiments (bug 476816).
In experiments, it is often the case (expected) that a seek to a
location will result to an invalid location for one of the traces in
the experiment.
There are issues with the handling of seeking to an invalid
location (CtfLocation.INVALID_LOCATION)
1. In one spot, == is used instead of .equals which means that a
location read from the index is not considered invalid, but rather,
it seeks to an offset of 0.
2. Even if the location is properly considered invalid (== fixed),
the code relies on the "last packet end time" to seek past the end of
the trace which then make the context location become invalid. This
works correctly when the trace was fully read the first time but the
"last packet end time" is not necessarily the end of the trace when
it is opened a second time.
Instead, we can explicitly check for CtfLocation.INVALID_LOCATION
in CtfTmfContext.setLocation and CtfIterator.seek to make sure no
bad seeks occur.
Bug: 476816
Change-Id: I4c74259ae3b67fb22cae302f2d5f09f1adda51f0
Signed-off-by: Marc-Andre Laperle <marc-andre.laperle@ericsson.com>
Reviewed-on: https://git.eclipse.org/r/55429
Reviewed-by: Hudson CI
This page took 0.028137 seconds and 5 git commands to generate.