lib: make auto-seek skip over packet messages without clock snapshots
authorSimon Marchi <simon.marchi@efficios.com>
Wed, 5 May 2021 14:08:35 +0000 (10:08 -0400)
committerPhilippe Proulx <eeppeliteloop@gmail.com>
Fri, 10 Sep 2021 14:39:08 +0000 (10:39 -0400)
commited3039e4f1abcc78367b60ce40512ee8d3949144
tree3d7081ad0fdb4222027a425dc220415e0f8d1d3d
parent8a30271a574f095d9d6a7978f3745e568c019f7b
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>
src/lib/graph/iterator.c
This page took 0.024432 seconds and 4 git commands to generate.