X-Git-Url: http://git.efficios.com/?p=babeltrace.git;a=blobdiff_plain;f=include%2Fbabeltrace%2Fctf-ir%2Fpacket-internal.h;h=712903a550ca08002f7310f7efa07bec9af133a6;hp=759c371a38849e023f0c12d72f94c6a9eff6c202;hb=44c440bc5fe8219cc17d1b786d91fd83c4c9860a;hpb=c800eb3790218d2f33df01e77ec38cbd43cc02a1 diff --git a/include/babeltrace/ctf-ir/packet-internal.h b/include/babeltrace/ctf-ir/packet-internal.h index 759c371a..712903a5 100644 --- a/include/babeltrace/ctf-ir/packet-internal.h +++ b/include/babeltrace/ctf-ir/packet-internal.h @@ -27,54 +27,25 @@ #include #include +#include #include #include #include #include #include #include -#include - -struct bt_packet_prop_uint64 { - enum bt_packet_property_availability avail; - uint64_t value; -}; +#include struct bt_packet { struct bt_object base; - struct bt_field_wrapper *header; - struct bt_field_wrapper *context; + struct bt_field_wrapper *header_field; + struct bt_field_wrapper *context_field; struct bt_stream *stream; - struct bt_clock_value_set begin_cv_set; - struct bt_clock_value_set end_cv_set; - struct bt_packet_prop_uint64 discarded_event_counter; - struct bt_packet_prop_uint64 seq_num; - struct bt_packet_prop_uint64 discarded_event_count; - struct bt_packet_prop_uint64 discarded_packet_count; - bool props_are_set; - - struct { - /* - * We keep this here to avoid keeping a reference on the - * previous packet object: those properties are - * snapshots of the previous packet's properties when - * calling bt_packet_create(). We know that the previous - * packet's properties do not change afterwards because - * we freeze the previous packet when bt_packet_create() - * is successful. - */ - enum bt_packet_previous_packet_availability avail; - struct bt_packet_prop_uint64 discarded_event_counter; - struct bt_packet_prop_uint64 seq_num; - struct { - enum bt_packet_property_availability avail; - - /* Owned by this (copy of previous packet's or NULL) */ - struct bt_clock_value *cv; - } default_end_cv; - } prev_packet_info; - - int frozen; + struct bt_clock_value *default_beginning_cv; + struct bt_clock_value *default_end_cv; + struct bt_property_uint discarded_event_counter_snapshot; + struct bt_property_uint packet_counter_snapshot; + bool frozen; }; BT_HIDDEN @@ -95,30 +66,4 @@ void bt_packet_recycle(struct bt_packet *packet); BT_HIDDEN void bt_packet_destroy(struct bt_packet *packet); -/* - * Sets a packet's properties using its current context fields and its - * previous packet's snapshotted properties (if any). The packet context - * field must not be modified until the packet is recycled. - * - * This function does NOT set the `props_are_set` flag (does not - * validate the properties): call bt_packet_validate_properties() to - * mark the properties as definitely cached. - */ -BT_HIDDEN -int bt_packet_set_properties(struct bt_packet *packet); - -static inline -void bt_packet_invalidate_properties(struct bt_packet *packet) -{ - BT_ASSERT(packet); - packet->props_are_set = false; -} - -static inline -void bt_packet_validate_properties(struct bt_packet *packet) -{ - BT_ASSERT(packet); - packet->props_are_set = true; -} - #endif /* BABELTRACE_CTF_IR_PACKET_INTERNAL_H */