ctf: index: accommodate bug in barectf tracer
This commit is to accommodate the indexing of non-compliant CTF traces
produced by the barectf tracer.
What makes those traces non-compliant ?
=======================================
A bug in barectf leads to events being emitted with timestamp less than
their packet's `timestamp_begin` field.
At a higher level, such event would appear as before the beginning of
its own containing packet and not within the range of any packet of the
trace.
How this commit fixes the index for the affected traces
=====================================================
For each index entry excluding the first:
- Decode the packet until the first event and use the timestamp of
this event as the `timestamp_begin` of this index entry.
- Set the previous index entry's `timestamp_end` to the
`timestamp_end` of the current index entry.
Affected versions
=================
- before barectf 2.3.1
Tracer commit fixing the issue
===============================
barectf master branch:
27bc6f1e6265a0da01d8f1cf2d669f1a1537c47e
Signed-off-by: Francis Deslauriers <francis.deslauriers@efficios.com>
Change-Id: I1e683467bda15d586a063ca9231cc536e143b346
Reviewed-on: https://review.lttng.org/c/babeltrace/+/1435
Tested-by: jenkins <jenkins@lttng.org>
Reviewed-by: Philippe Proulx <eeppeliteloop@gmail.com>