ctf: index: accommodate lttng-crash timestamp quirk
This commit is to accommodate the indexing of non-compliant CTF traces
produced by LTTng tracers and extracted by the lttng-crash utility.
What makes those traces non-compliant ?
=======================================
The lttng-crash is used to extract a trace from the tracing buffers from
non-volatile memory following a system crash. Because a system crash can
happen at any time, it's possible that some tracing packets might not
have been closed properly. It's possible to observe this by looking at
the `timestamp_end` field of the packets. They might be left to their
initial value of 0 when their `timestamp_begin` are often larger than 0.
This has the higher level effect that affected packets have a
`timestamp_end` smaller than their `timestamp_begin`, as if their end
time was before the beginning time.
How this commit fixes the index for the affected traces
=====================================================
For each index entry, if the entry's `timestamp_end` is 0 and the
`timestamp_begin` is not 0:
- 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, 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
=================
All current and future lttng-ust and lttng-modules versions are affect
because this really cannot be fixed by the tracers because lttng-crash
only tries to make the most of a critical situation (i.e. a system
crash).
Signed-off-by: Francis Deslauriers <francis.deslauriers@efficios.com>
Change-Id: Ib6ff9683b676983d8691f514f4d6c3e5c8c7e071
Reviewed-on: https://review.lttng.org/c/babeltrace/+/1436
Tested-by: jenkins <jenkins@lttng.org>
Reviewed-by: Philippe Proulx <eeppeliteloop@gmail.com>
This page took 0.037766 seconds and 5 git commands to generate.