X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=src%2Flib%2Fgraph%2Fiterator.h;h=581f9c1f8d5e667c1b0cb1e93989a2316323366c;hb=29e191fceb6167bc486c8a492ec7652670de8355;hp=ed093633a5e208ebd162e3a209ded54f73669f67;hpb=5155b005cfadade509649b8f9a3bf2c055c6edfd;p=babeltrace.git diff --git a/src/lib/graph/iterator.h b/src/lib/graph/iterator.h index ed093633..581f9c1f 100644 --- a/src/lib/graph/iterator.h +++ b/src/lib/graph/iterator.h @@ -142,14 +142,35 @@ struct bt_message_iterator { CLOCK_EXPECTATION_ORIGIN_OTHER_NO_UUID, } type; - /* - * Expected UUID of the clock, if `type`is CLOCK_EXPECTATION_ORIGIN_OTHER_UUID. - * - * If the clock's origin is the unix epoch, the UUID is - * irrelevant (as the clock will be correlatable with other - * clocks having the same origin). - */ - bt_uuid_t uuid; + + union { + /* + * Expected UUID of the clock, if `type`is + * CLOCK_EXPECTATION_ORIGIN_OTHER_UUID. + * + * If the clock's origin is the unix epoch, the UUID is + * irrelevant (as the clock will be correlatable with other + * clocks having the same origin). + */ + bt_uuid_t uuid; + + /* + * Expected clock class, if `type` is + * CLOCK_EXPECTATION_ORIGIN_OTHER_NO_UUID. + * + * If the first clock class seen has an unknown origin + * and no UUID, then all subsequent clock classes seen + * must be the same instance. + * + * To make sure that the clock class pointed by this + * field doesn't get freed and another one reallocated + * at the same address (which could potentially bypass + * the clock expectation check), we keep a strong + * reference, ensuring that the clock class lives at + * least as long as the iterator. + */ + const bt_clock_class *clock_class; + }; } clock_expectation; BT_IF_DEV_MODE(GHashTable *per_stream_state);