ctf: index: accommodate bug in LTTng tracers
This commit is to accommodate the indexing of non-compliant CTF traces
produced by LTTng tracers.
What makes those traces non-compliant ?
=======================================
A bug in lttng tracers may lead them to emit events with timestamps that
are greater than the timestamp_end of the their packets.
At a higher level, such event would appear as not within the range of a
packet in the trace.
How this commit fixes the index for the affected traces
=======================================================
For each index entry:
- If it's the stream file's last packet: set the packet index entry's end
time to the packet's last event's time by decoding the packet, if
any, or to the packet's beginning time otherwise.
- If it's not the stream file's last packet: set the packet index
entry's end time to the next packet's beginning time.
Affected versions
=================
- before lttng-ust 2.11.0
- before lttng-module 2.11.0
- before lttng-module 2.10.10
- before lttng-module 2.9.13
Tracer commits fixing the issue
===============================
LTTng-UST master branch:
6c737d0594cac0d969e1948ea1ed55c15be9cec8
LTTng-Modules master branch:
2485a4307679e11711443483a5eb307639f955ed
LTTng-Modules stable-2.10 branch:
a1817dcb28265d0f8db10c6bbe98fe8db2c53a8a
LTTng-Modules stable-2.9 branch:
266cef247ceb5d1b4d266a987b8bfcc53d8965ca
Signed-off-by: Francis Deslauriers <francis.deslauriers@efficios.com>
Change-Id: I4c93d05a4e3f85b70657561e9a89cfa2542d49b8
Reviewed-on: https://review.lttng.org/c/babeltrace/+/1420
Tested-by: jenkins <jenkins@lttng.org>
Reviewed-by: Philippe Proulx <eeppeliteloop@gmail.com>