lib: make auto-seek skip over packet messages without clock snapshots
Trying to use a CTF trace with packets that don't have beginning clock
snapshots [1] with a trimmer component invokes the "auto-seek" seeking
mechanism provided by the lib, and leads to:
$ ./src/cli/babeltrace2 nvctf --timerange="05:50:53,05:50:55"
...
Babeltrace 2 library postcondition not satisfied.
------------------------------------------------------------------------
Condition ID: `post:message-iterator-class-next-method:packet-message-has-default-clock-snapshot`.
Function: bt_message_iterator_class_next_method().
------------------------------------------------------------------------
Error is:
Packet message has no default clock snapshot: addr=0x607000001fa0, type=PACKET_BEGINNING, is-frozen=0, graph-addr=0x612000001840, packet-is-frozen=1, packet-context-field-addr=(nil), packet-stream-addr=0x60d000001cb0, packet-stream-id=0, packet-stream-name="/home/simark/build/babeltrace/nvctf/channel0", packet-trace-class-addr=0x60d000001be0
The problem is with the auto_seek_handle_message function assuming that
all packet beginning messages have a clock snapshot. Fix it by making
it check the relevant property in the stream class, and skip the message
if it doesn't have a clock snapshot.
Change it as well for packet end, discarded event and discarded packet
messages, although I did not test these cases.
[1] Like the trace from
https://lists.lttng.org/pipermail/lttng-dev/2021-May/029955.html
Change-Id: I6be0ab013285c2a01125dbf27161d31e227250a8
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/5690
Tested-by: jenkins <jenkins@lttng.org>
Reviewed-by: Philippe Proulx <eeppeliteloop@gmail.com>
This page took 0.035094 seconds and 4 git commands to generate.