From c7072d5abafd9208df8bd1a1203f57c503a4da01 Mon Sep 17 00:00:00 2001 From: Philippe Proulx Date: Tue, 19 Feb 2019 09:40:16 -0500 Subject: [PATCH] iterator.c: auto-seeking: use packet messages's clock snapshots Consider the default clock snapshots of packet beginning and end messages in get_message_ns_from_origin() for auto-seeking. Signed-off-by: Philippe Proulx --- lib/graph/iterator.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/lib/graph/iterator.c b/lib/graph/iterator.c index 094447b6..ddfe417c 100644 --- a/lib/graph/iterator.c +++ b/lib/graph/iterator.c @@ -987,8 +987,8 @@ int get_message_ns_from_origin(const struct bt_message *msg, clk_snapshot = event_msg->default_cs; BT_ASSERT_PRE(clk_snapshot, - "Event has no default clock snapshot: %!+e", - event_msg->event); + "Event message has no default clock snapshot: %!+n", + event_msg); break; } case BT_MESSAGE_TYPE_INACTIVITY: @@ -1002,8 +1002,16 @@ int get_message_ns_from_origin(const struct bt_message *msg, } case BT_MESSAGE_TYPE_PACKET_BEGINNING: case BT_MESSAGE_TYPE_PACKET_END: - /* Ignore */ - goto end; + { + const struct bt_message_packet *packet_msg = + (const void *) msg; + + clk_snapshot = packet_msg->default_cs; + BT_ASSERT_PRE(clk_snapshot, + "Packet message has no default clock snapshot: %!+n", + packet_msg); + break; + } case BT_MESSAGE_TYPE_DISCARDED_EVENTS: case BT_MESSAGE_TYPE_DISCARDED_PACKETS: { -- 2.34.1