#define BT_COMP_LOG_SELF_COMP self_comp
#define BT_LOG_OUTPUT_LEVEL log_level
#define BT_LOG_TAG "PLUGIN/FLT.LTTNG-UTILS.DEBUG-INFO"
-#include "plugins/comp-logging.h"
+#include "logging/comp-logging.h"
#include <glib.h>
bt_self_component *self_comp;
struct debug_info_component *comp;
const bt_trace *input_trace;
- uint64_t destruction_listener_id;
+ bt_listener_id destruction_listener_id;
/*
* Hash table of VPIDs (pointer to int64_t) to
void event_get_common_context_signed_integer_field_value(
const bt_event *event, const char *field_name, int64_t *value)
{
- *value = bt_field_signed_integer_get_value(
+ *value = bt_field_integer_signed_get_value(
event_borrow_common_context_field(event, field_name));
}
bt_field_array_borrow_element_field_by_index_const(
build_id_field, i);
- build_id[i] = bt_field_unsigned_integer_get_value(curr_field);
+ build_id[i] = bt_field_integer_unsigned_get_value(curr_field);
}
return ret;
void event_get_payload_unsigned_integer_field_value(const bt_event *event,
const char *field_name, uint64_t *value)
{
- *value = bt_field_unsigned_integer_get_value(
+ *value = bt_field_integer_unsigned_get_value(
event_borrow_payload_field(event, field_name));
}
bool event_has_payload_field(const bt_event *event,
const char *field_name)
{
- return event_borrow_payload_field(event, field_name) != NULL;
+ return event_borrow_payload_field(event, field_name);
}
static
ip_field = bt_field_structure_borrow_member_field_by_name_const(
out_common_ctx_field, IP_FIELD_NAME);
- vpid = bt_field_signed_integer_get_value(vpid_field);
- ip = bt_field_unsigned_integer_get_value(ip_field);
+ vpid = bt_field_integer_signed_get_value(vpid_field);
+ ip = bt_field_integer_unsigned_get_value(ip_field);
/*
* Borrow the debug_info structure needed for the source
const bt_clock_snapshot *cs;
const bt_clock_class *default_cc;
const bt_packet *in_packet;
+ const bt_stream *in_stream;
+ const bt_stream *out_stream;
bt_event_class *out_event_class;
- bt_packet *out_packet;
+ bt_packet *out_packet = NULL;
bt_event *out_event;
bt_logging_level log_level = debug_it->log_level;
bt_self_component *self_comp = debug_it->self_comp;
}
BT_ASSERT(out_event_class);
+ /* Borrow the input stream. */
+ in_stream = bt_event_borrow_stream_const(in_event);
+ BT_ASSERT(in_stream);
+ out_stream = trace_ir_mapping_borrow_mapped_stream(debug_it->ir_maps,
+ in_stream);
+ BT_ASSERT(in_stream);
+
/* Borrow the input and output packets. */
in_packet = bt_event_borrow_packet_const(in_event);
- out_packet = trace_ir_mapping_borrow_mapped_packet(debug_it->ir_maps,
- in_packet);
+ if (in_packet) {
+ out_packet = trace_ir_mapping_borrow_mapped_packet(
+ debug_it->ir_maps, in_packet);
+ }
default_cc = bt_stream_class_borrow_default_clock_class_const(
bt_event_class_borrow_stream_class_const(in_event_class));
in_message);
/* Create an output event message. */
- out_message = bt_message_event_create_with_default_clock_snapshot(
+ if (out_packet) {
+ out_message =
+ bt_message_event_create_with_packet_and_default_clock_snapshot(
debug_it->input_iterator,
out_event_class, out_packet,
bt_clock_snapshot_get_value(cs));
+ } else {
+ out_message =
+ bt_message_event_create_with_default_clock_snapshot(
+ debug_it->input_iterator,
+ out_event_class, out_stream,
+ bt_clock_snapshot_get_value(cs));
+ }
} else {
- out_message = bt_message_event_create(debug_it->input_iterator,
- out_event_class, out_packet);
+ if (out_packet) {
+ out_message = bt_message_event_create_with_packet(
+ debug_it->input_iterator, out_event_class,
+ out_packet);
+ } else {
+ out_message = bt_message_event_create(
+ debug_it->input_iterator, out_event_class,
+ out_stream);
+ }
}
if (!out_message) {
bt_message_put_ref(msgs[i]);
}
+ /*
+ * Drop references of all the input messages not dropped before the
+ * failure.
+ */
+ for (i = curr_msg_idx; i < *count; i++) {
+ bt_message_put_ref(input_msgs[i]);
+ }
+
status = BT_COMPONENT_CLASS_MESSAGE_ITERATOR_NEXT_METHOD_STATUS_MEMORY_ERROR;
end:
debug_info_msg_iter->self_comp = self_comp;
/* Create an iterator on the upstream component. */
- upstream_iterator = bt_self_component_port_input_message_iterator_create(
- input_port);
+ upstream_iterator = bt_self_component_port_input_message_iterator_create_from_message_iterator(
+ self_msg_iter, input_port);
if (!upstream_iterator) {
status = BT_COMPONENT_CLASS_MESSAGE_ITERATOR_INIT_METHOD_STATUS_MEMORY_ERROR;
goto error;