X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=plugins%2Futils%2Ftrimmer%2Fiterator.c;h=6b5699a299139ef5949455da6f232400f1834639;hb=40f4ba76dd6f9508ca51b6220eaed57632281a07;hp=f157de817031c3713c6c9d6e22fb4824a59a4eb4;hpb=28e6ca8b6e08d1cdd1af81ae819aa39baa206eaf;p=babeltrace.git diff --git a/plugins/utils/trimmer/iterator.c b/plugins/utils/trimmer/iterator.c index f157de81..6b5699a2 100644 --- a/plugins/utils/trimmer/iterator.c +++ b/plugins/utils/trimmer/iterator.c @@ -42,18 +42,18 @@ static gboolean close_packets(gpointer key, gpointer value, gpointer user_data) { - struct bt_packet *writer_packet = value; + const struct bt_packet *writer_packet = value; bt_object_put_ref(writer_packet); return TRUE; } BT_HIDDEN -void trimmer_iterator_finalize(struct bt_private_connection_private_notification_iterator *it) +void trimmer_iterator_finalize(struct bt_self_notification_iterator *it) { struct trimmer_iterator *trim_it; - trim_it = bt_private_connection_private_notification_iterator_get_user_data(it); + trim_it = bt_self_notification_iterator_get_user_data(it); BT_ASSERT(trim_it); bt_object_put_ref(trim_it->input_iterator); @@ -65,7 +65,7 @@ void trimmer_iterator_finalize(struct bt_private_connection_private_notification BT_HIDDEN enum bt_notification_iterator_status trimmer_iterator_init( - struct bt_private_connection_private_notification_iterator *iterator, + struct bt_self_notification_iterator *iterator, struct bt_private_port *port) { enum bt_notification_iterator_status ret = @@ -74,8 +74,8 @@ enum bt_notification_iterator_status trimmer_iterator_init( enum bt_connection_status conn_status; struct bt_private_port *input_port = NULL; struct bt_private_connection *connection = NULL; - struct bt_private_component *component = - bt_private_connection_private_notification_iterator_get_private_component(iterator); + struct bt_self_component *component = + bt_self_notification_iterator_get_private_component(iterator); struct trimmer_iterator *it_data = g_new0(struct trimmer_iterator, 1); if (!it_data) { @@ -84,7 +84,7 @@ enum bt_notification_iterator_status trimmer_iterator_init( } /* Create a new iterator on the upstream component. */ - input_port = bt_private_component_filter_get_input_port_by_name( + input_port = bt_self_component_filter_get_input_port_by_name( component, "in"); BT_ASSERT(input_port); connection = bt_private_port_get_connection(input_port); @@ -101,7 +101,7 @@ enum bt_notification_iterator_status trimmer_iterator_init( it_data->packet_map = g_hash_table_new_full(g_direct_hash, g_direct_equal, NULL, NULL); - it_ret = bt_private_connection_private_notification_iterator_set_user_data(iterator, + it_ret = bt_self_notification_iterator_set_user_data(iterator, it_data); if (it_ret) { goto end; @@ -182,12 +182,12 @@ struct bt_notification *evaluate_event_notification( { int64_t ts; int clock_ret; - struct bt_event *event = NULL, *writer_event; + const struct bt_event *event = NULL, *writer_event; bool in_range = true; - struct bt_clock_class *clock_class = NULL; - struct bt_trace *trace = NULL; - struct bt_stream *stream = NULL; - struct bt_stream_class *stream_class = NULL; + const struct bt_clock_class *clock_class = NULL; + const struct bt_trace *trace = NULL; + const struct bt_stream *stream = NULL; + const struct bt_stream_class *stream_class = NULL; struct bt_clock_value *clock_value = NULL; bool lazy_update = false; struct bt_notification *new_notification = NULL; @@ -268,13 +268,13 @@ end: } static -int ns_from_integer_field(struct bt_field *integer, int64_t *ns) +int ns_from_integer_field(const struct bt_field *integer, int64_t *ns) { int ret = 0; int is_signed; uint64_t raw_clock_value; - struct bt_field_class *integer_class = NULL; - struct bt_clock_class *clock_class = NULL; + const struct bt_field_class *integer_class = NULL; + const struct bt_clock_class *clock_class = NULL; struct bt_clock_value *clock_value = NULL; integer_class = bt_field_get_class(integer); @@ -329,14 +329,14 @@ static uint64_t ns_from_value(uint64_t frequency, uint64_t value) * timestamp minus the offset. */ static -int64_t get_raw_timestamp(struct bt_packet *writer_packet, +int64_t get_raw_timestamp(const struct bt_packet *writer_packet, int64_t timestamp) { - struct bt_clock_class *writer_clock_class; + const struct bt_clock_class *writer_clock_class; int64_t sec_offset, cycles_offset, ns; - struct bt_trace *writer_trace; - struct bt_stream *writer_stream; - struct bt_stream_class *writer_stream_class; + const struct bt_trace *writer_trace; + const struct bt_stream *writer_stream; + const struct bt_stream_class *writer_stream_class; int ret; uint64_t freq; @@ -383,8 +383,8 @@ struct bt_notification *evaluate_packet_notification( { int64_t begin_ns, pkt_begin_ns, end_ns, pkt_end_ns; bool in_range = true; - struct bt_packet *packet = NULL, *writer_packet = NULL; - struct bt_field *packet_context = NULL, + const struct bt_packet *packet = NULL, *writer_packet = NULL; + const struct bt_field *packet_context = NULL, *timestamp_begin = NULL, *timestamp_end = NULL; struct bt_notification *new_notification = NULL; @@ -505,7 +505,7 @@ struct bt_notification *evaluate_stream_notification( struct bt_notification *notification, struct trimmer_iterator *trim_it) { - struct bt_stream *stream; + const struct bt_stream *stream; stream = bt_notification_stream_end_get_stream(notification); BT_ASSERT(stream); @@ -557,10 +557,10 @@ enum bt_notification_iterator_status evaluate_notification( BT_HIDDEN struct bt_notification_iterator_next_method_return trimmer_iterator_next( - struct bt_private_connection_private_notification_iterator *iterator) + struct bt_self_notification_iterator *iterator) { struct trimmer_iterator *trim_it = NULL; - struct bt_private_component *component = NULL; + struct bt_self_component *component = NULL; struct trimmer *trimmer = NULL; struct bt_notification_iterator *source_it = NULL; struct bt_notification_iterator_next_method_return ret = { @@ -569,13 +569,13 @@ struct bt_notification_iterator_next_method_return trimmer_iterator_next( }; bool notification_in_range = false; - trim_it = bt_private_connection_private_notification_iterator_get_user_data(iterator); + trim_it = bt_self_notification_iterator_get_user_data(iterator); BT_ASSERT(trim_it); - component = bt_private_connection_private_notification_iterator_get_private_component( + component = bt_self_notification_iterator_get_private_component( iterator); BT_ASSERT(component); - trimmer = bt_private_component_get_user_data(component); + trimmer = bt_self_component_get_user_data(component); BT_ASSERT(trimmer); source_it = trim_it->input_iterator;