}
debug_info_src->short_src_path = get_filename_from_path(
- debug_info_src->src_path);
+ debug_info_src->src_path);
}
source_location_destroy(src_loc);
}
}
debug_info_src->short_bin_path = get_filename_from_path(
- debug_info_src->bin_path);
+ debug_info_src->bin_path);
ret = bin_info_get_bin_loc(bin, ip, &(debug_info_src->bin_loc));
if (ret) {
}
proc_dbg_info_src->baddr_to_bin_info = g_hash_table_new_full(
- g_int64_hash, g_int64_equal, (GDestroyNotify) g_free,
- (GDestroyNotify) bin_info_destroy);
+ g_int64_hash, g_int64_equal, (GDestroyNotify) g_free,
+ (GDestroyNotify) bin_info_destroy);
if (!proc_dbg_info_src->baddr_to_bin_info) {
goto error;
}
proc_dbg_info_src->ip_to_debug_info_src = g_hash_table_new_full(
- g_int64_hash, g_int64_equal, (GDestroyNotify) g_free,
- (GDestroyNotify) debug_info_source_destroy);
+ g_int64_hash, g_int64_equal, (GDestroyNotify) g_free,
+ (GDestroyNotify) debug_info_source_destroy);
if (!proc_dbg_info_src->ip_to_debug_info_src) {
goto error;
}
BT_ASSERT(event_payload);
field = bt_field_structure_borrow_member_field_by_name_const(
- event_payload, field_name);
+ event_payload, field_name);
return field;
}
}
field = bt_field_structure_borrow_member_field_by_name_const(
- event_common_ctx, field_name);
+ event_common_ctx, field_name);
end:
return field;
const bt_event *event, const char *field_name, int64_t *value)
{
*value = bt_field_integer_signed_get_value(
- event_borrow_common_context_field(event, field_name));
+ event_borrow_common_context_field(event, field_name));
}
static inline
build_id_field_class = bt_field_borrow_class_const(build_id_field);
BT_ASSERT(bt_field_class_get_type(build_id_field_class) ==
- BT_FIELD_CLASS_TYPE_DYNAMIC_ARRAY);
+ BT_FIELD_CLASS_TYPE_DYNAMIC_ARRAY);
BT_ASSERT(bt_field_class_get_type(
- bt_field_class_array_borrow_element_field_class_const(
- build_id_field_class)) ==
- BT_FIELD_CLASS_TYPE_UNSIGNED_INTEGER);
+ bt_field_class_array_borrow_element_field_class_const(
+ build_id_field_class)) ==
+ BT_FIELD_CLASS_TYPE_UNSIGNED_INTEGER);
*build_id_len = bt_field_array_get_length(build_id_field);
build_id_field_class = bt_field_borrow_class_const(build_id_field);
BT_ASSERT(bt_field_class_get_type(build_id_field_class) ==
- BT_FIELD_CLASS_TYPE_DYNAMIC_ARRAY);
+ BT_FIELD_CLASS_TYPE_DYNAMIC_ARRAY);
BT_ASSERT(bt_field_class_get_type(
- bt_field_class_array_borrow_element_field_class_const(
- build_id_field_class)) ==
- BT_FIELD_CLASS_TYPE_UNSIGNED_INTEGER);
+ bt_field_class_array_borrow_element_field_class_const(
+ build_id_field_class)) ==
+ BT_FIELD_CLASS_TYPE_UNSIGNED_INTEGER);
build_id_len = bt_field_array_get_length(build_id_field);
for (i = 0; i < build_id_len; i++) {
- curr_field =
- bt_field_array_borrow_element_field_by_index_const(
- build_id_field, i);
+ curr_field = bt_field_array_borrow_element_field_by_index_const(
+ build_id_field, i);
build_id[i] = bt_field_integer_unsigned_get_value(curr_field);
}
const char *field_name, uint64_t *value)
{
*value = bt_field_integer_unsigned_get_value(
- event_borrow_payload_field(event, field_name));
+ event_borrow_payload_field(event, field_name));
}
static
const char *field_name, const char **value)
{
*value = bt_field_string_get_value(
- event_borrow_payload_field(event, field_name));
+ event_borrow_payload_field(event, field_name));
}
static inline
/* Look in IP to debug infos hash table first. */
debug_info_src = g_hash_table_lookup(
- proc_dbg_info_src->ip_to_debug_info_src,
- key);
+ proc_dbg_info_src->ip_to_debug_info_src, key);
if (debug_info_src) {
goto end;
}
debug_info->self_comp);
if (debug_info_src) {
g_hash_table_insert(
- proc_dbg_info_src->ip_to_debug_info_src,
- key, debug_info_src);
+ proc_dbg_info_src->ip_to_debug_info_src, key,
+ debug_info_src);
/* Ownership passed to ht. */
key = NULL;
}
struct proc_debug_info_sources *proc_dbg_info_src;
proc_dbg_info_src = proc_debug_info_sources_ht_get_entry(
- debug_info->vpid_to_proc_dbg_info_src, vpid);
+ debug_info->vpid_to_proc_dbg_info_src, vpid);
if (!proc_dbg_info_src) {
goto end;
}
debug_info->log_level = comp->log_level;
debug_info->self_comp = comp->self_comp;
debug_info->vpid_to_proc_dbg_info_src = g_hash_table_new_full(
- g_int64_hash, g_int64_equal, (GDestroyNotify) g_free,
- (GDestroyNotify) proc_debug_info_sources_destroy);
+ g_int64_hash, g_int64_equal, (GDestroyNotify) g_free,
+ (GDestroyNotify) proc_debug_info_sources_destroy);
if (!debug_info->vpid_to_proc_dbg_info_src) {
goto error;
}
}
remove_listener_status = bt_trace_remove_destruction_listener(
- debug_info->input_trace,
- debug_info->destruction_listener_id);
+ debug_info->input_trace,
+ debug_info->destruction_listener_id);
if (remove_listener_status != BT_TRACE_REMOVE_LISTENER_STATUS_OK) {
BT_COMP_LOGE("Trace destruction listener removal failed.");
bt_current_thread_clear_error();
int ret = 0;
event_get_common_context_signed_integer_field_value(event,
- VPID_FIELD_NAME, &vpid);
+ VPID_FIELD_NAME, &vpid);
event_get_payload_unsigned_integer_field_value(event,
- BADDR_FIELD_NAME, &baddr);
+ BADDR_FIELD_NAME, &baddr);
proc_dbg_info_src = proc_debug_info_sources_ht_get_entry(
- debug_info->vpid_to_proc_dbg_info_src, vpid);
+ debug_info->vpid_to_proc_dbg_info_src, vpid);
if (!proc_dbg_info_src) {
goto end;
}
bin = g_hash_table_lookup(proc_dbg_info_src->baddr_to_bin_info,
- (gpointer) &baddr);
+ (gpointer) &baddr);
if (!bin) {
/*
* The build_id event comes after the bin has been
goto end;
}
ret = event_get_payload_build_id_length(event, BUILD_ID_FIELD_NAME,
- &build_id_len);
+ &build_id_len);
build_id = g_new0(uint8_t, build_id_len);
if (!build_id) {
}
ret = event_get_payload_build_id_value(event, BUILD_ID_FIELD_NAME,
- build_id);
+ build_id);
if (ret) {
goto end;
}
uint64_t crc_field_value;
event_get_common_context_signed_integer_field_value(event,
- VPID_FIELD_NAME, &vpid);
+ VPID_FIELD_NAME, &vpid);
event_get_payload_unsigned_integer_field_value(event,
- BADDR_FIELD_NAME, &baddr);
+ BADDR_FIELD_NAME, &baddr);
event_get_payload_unsigned_integer_field_value(event,
- CRC32_FIELD_NAME, &crc_field_value);
+ CRC32_FIELD_NAME, &crc_field_value);
crc32 = (uint32_t) crc_field_value;
event_get_payload_string_field_value(event,
- FILENAME_FIELD_NAME, &filename);
+ FILENAME_FIELD_NAME, &filename);
proc_dbg_info_src = proc_debug_info_sources_ht_get_entry(
- debug_info->vpid_to_proc_dbg_info_src, vpid);
+ debug_info->vpid_to_proc_dbg_info_src, vpid);
if (!proc_dbg_info_src) {
goto end;
}
bin = g_hash_table_lookup(proc_dbg_info_src->baddr_to_bin_info,
- (gpointer) &baddr);
+ (gpointer) &baddr);
if (!bin) {
/*
* The debug_link event comes after the bin has been
bool is_pic;
event_get_payload_unsigned_integer_field_value(event,
- MEMSZ_FIELD_NAME, &memsz);
+ MEMSZ_FIELD_NAME, &memsz);
if (memsz == 0) {
/* Ignore VDSO. */
goto end;
}
event_get_payload_unsigned_integer_field_value(event,
- BADDR_FIELD_NAME, &baddr);
+ BADDR_FIELD_NAME, &baddr);
/*
* This field is not produced by the dlopen event emitted before
int64_t vpid;
event_get_payload_unsigned_integer_field_value(event, BADDR_FIELD_NAME,
- &baddr);
+ &baddr);
event_get_common_context_signed_integer_field_value(event,
- VPID_FIELD_NAME, &vpid);
+ VPID_FIELD_NAME, &vpid);
proc_dbg_info_src = proc_debug_info_sources_ht_get_entry(
- debug_info->vpid_to_proc_dbg_info_src, vpid);
+ debug_info->vpid_to_proc_dbg_info_src, vpid);
if (!proc_dbg_info_src) {
/*
* It's an unload event for a library for which no load event
}
ret = g_hash_table_remove(proc_dbg_info_src->baddr_to_bin_info,
- (gpointer) &baddr);
+ (gpointer) &baddr);
BT_ASSERT(ret);
end:
return;
int64_t vpid;
event_get_common_context_signed_integer_field_value(
- event, VPID_FIELD_NAME, &vpid);
+ event, VPID_FIELD_NAME, &vpid);
proc_dbg_info_src = proc_debug_info_sources_ht_get_entry(
- debug_info->vpid_to_proc_dbg_info_src, vpid);
+ debug_info->vpid_to_proc_dbg_info_src, vpid);
if (!proc_dbg_info_src) {
goto end;
}
if (debug_it->debug_info_map) {
gboolean ret;
ret = g_hash_table_remove(debug_it->debug_info_map,
- (gpointer) in_trace);
+ (gpointer) in_trace);
BT_ASSERT(ret);
}
}
event_name = bt_event_class_get_name(event_class);
trace = bt_stream_borrow_trace_const(
- bt_event_borrow_stream_const(event));
+ bt_event_borrow_stream_const(event));
debug_info = g_hash_table_lookup(debug_it->debug_info_map, trace);
if (!debug_info) {
bt_trace_add_listener_status add_listener_status;
debug_info = debug_info_create(debug_it->debug_info_component,
- trace, &debug_it->fd_cache);
+ trace, &debug_it->fd_cache);
g_hash_table_insert(debug_it->debug_info_map, (gpointer) trace,
- debug_info);
+ debug_info);
add_listener_status = bt_trace_add_destruction_listener(
- trace, trace_debug_info_remove_func,
- debug_it,
- &debug_info->destruction_listener_id);
+ trace, trace_debug_info_remove_func, debug_it,
+ &debug_info->destruction_listener_id);
BT_ASSERT(add_listener_status == BT_TRACE_ADD_LISTENER_STATUS_OK);
}
bt_field_string_append_status append_status;
BT_ASSERT(bt_field_get_class_type(curr_field) ==
- BT_FIELD_CLASS_TYPE_STRING);
+ BT_FIELD_CLASS_TYPE_STRING);
if (dbg_info_src) {
if (full_path) {
bt_field_string_append_status append_status;
BT_ASSERT(bt_field_get_class_type(curr_field) ==
- BT_FIELD_CLASS_TYPE_STRING);
+ BT_FIELD_CLASS_TYPE_STRING);
if (dbg_info_src && dbg_info_src->src_path) {
if (full_path) {
set_status = bt_field_string_set_value(curr_field,
- dbg_info_src->src_path);
+ dbg_info_src->src_path);
} else {
set_status = bt_field_string_set_value(curr_field,
- dbg_info_src->short_src_path);
+ dbg_info_src->short_src_path);
}
if (set_status != BT_FIELD_STRING_SET_VALUE_STATUS_OK) {
BT_COMP_LOGE("Cannot set path component of \"src\" "
bt_field *bin_field, *func_field, *src_field;
BT_ASSERT(bt_field_get_class_type(debug_info_field) ==
- BT_FIELD_CLASS_TYPE_STRUCTURE);
+ BT_FIELD_CLASS_TYPE_STRUCTURE);
bin_field = bt_field_structure_borrow_member_field_by_name(
- debug_info_field, "bin");
+ debug_info_field, "bin");
func_field = bt_field_structure_borrow_member_field_by_name(
- debug_info_field, "func");
+ debug_info_field, "func");
src_field = bt_field_structure_borrow_member_field_by_name(
- debug_info_field, "src");
+ debug_info_field, "src");
BT_ASSERT(bt_field_get_class_type(bin_field) ==
- BT_FIELD_CLASS_TYPE_STRING);
+ BT_FIELD_CLASS_TYPE_STRING);
BT_ASSERT(bt_field_get_class_type(func_field) ==
- BT_FIELD_CLASS_TYPE_STRING);
+ BT_FIELD_CLASS_TYPE_STRING);
BT_ASSERT(bt_field_get_class_type(src_field) ==
- BT_FIELD_CLASS_TYPE_STRING);
+ BT_FIELD_CLASS_TYPE_STRING);
status = bt_field_string_set_value(bin_field, "");
if (status != BT_FIELD_STRING_SET_VALUE_STATUS_OK) {
const bt_field_class *debug_info_fc;
BT_ASSERT(bt_field_get_class_type(debug_info_field) ==
- BT_FIELD_CLASS_TYPE_STRUCTURE);
+ BT_FIELD_CLASS_TYPE_STRUCTURE);
debug_info_fc = bt_field_borrow_class_const(debug_info_field);
bt_self_component *self_comp = debug_it->self_comp;
in_common_ctx_field = bt_event_borrow_common_context_field_const(
- in_event);
+ in_event);
if (!in_common_ctx_field) {
/*
* There is no event common context so no need to add debug
in_common_ctx_fc = bt_field_borrow_class_const(in_common_ctx_field);
if (!is_event_common_ctx_dbg_info_compatible(in_common_ctx_fc,
- debug_it->ir_maps->debug_info_field_class_name)) {
+ debug_it->ir_maps->debug_info_field_class_name)) {
/*
* The input event common context does not have the necessary
* fields to resolve debug information.
}
out_debug_info_field = bt_field_structure_borrow_member_field_by_name(
- out_common_ctx_field, debug_info_field_name);
+ out_common_ctx_field, debug_info_field_name);
vpid_field = bt_field_structure_borrow_member_field_by_name_const(
- out_common_ctx_field, VPID_FIELD_NAME);
+ out_common_ctx_field, VPID_FIELD_NAME);
ip_field = bt_field_structure_borrow_member_field_by_name_const(
- out_common_ctx_field, IP_FIELD_NAME);
+ out_common_ctx_field, IP_FIELD_NAME);
vpid = bt_field_integer_signed_get_value(vpid_field);
ip = bt_field_integer_unsigned_get_value(ip_field);
* resolving.
*/
debug_info = g_hash_table_lookup(debug_it->debug_info_map,
- bt_stream_borrow_trace_const(
- bt_event_borrow_stream_const(in_event)));
+ bt_stream_borrow_trace_const(
+ bt_event_borrow_stream_const(in_event)));
if (debug_info) {
/*
event_common_ctx_fc = bt_field_borrow_class_const(event_common_ctx);
if (is_event_common_ctx_dbg_info_compatible(event_common_ctx_fc,
- debug_it->ir_maps->debug_info_field_class_name)) {
+ debug_it->ir_maps->debug_info_field_class_name)) {
/* Checkout if it might be a one of lttng ust statedump events. */
const char *in_event_name = bt_event_class_get_name(in_event_class);
if (strncmp(in_event_name, LTTNG_UST_STATEDUMP_PREFIX,
debug_it->ir_maps, in_event_class);
if (!out_event_class) {
out_event_class = trace_ir_mapping_create_new_mapped_event_class(
- debug_it->ir_maps, in_event_class);
+ debug_it->ir_maps, in_event_class);
}
BT_ASSERT(out_event_class);
}
default_cc = bt_stream_class_borrow_default_clock_class_const(
- bt_event_class_borrow_stream_class_const(in_event_class));
+ bt_event_class_borrow_stream_class_const(in_event_class));
if (default_cc) {
/* Borrow event clock snapshot. */
cs = bt_message_event_borrow_default_clock_snapshot_const(
- in_message);
+ in_message);
/* Create an output event message. */
if (out_packet) {
/* Create a duplicated output stream. */
out_stream = trace_ir_mapping_create_new_mapped_stream(
- debug_it->ir_maps, in_stream);
+ debug_it->ir_maps, in_stream);
if (!out_stream) {
out_message = NULL;
goto error;
/* Create an output stream beginning message. */
out_message = bt_message_stream_beginning_create(
- debug_it->input_iterator, out_stream);
+ debug_it->input_iterator, out_stream);
if (!out_message) {
BT_COMP_LOGE("Error creating output stream beginning message: "
"out-s-addr=%p", out_stream);
BT_ASSERT(in_stream);
out_stream = trace_ir_mapping_borrow_mapped_stream(
- debug_it->ir_maps, in_stream);
+ debug_it->ir_maps, in_stream);
BT_ASSERT(out_stream);
/* Create an output stream end message. */
out_message = bt_message_stream_end_create(debug_it->input_iterator,
- out_stream);
+ out_stream);
if (!out_message) {
BT_COMP_LOGE("Error creating output stream end message: out-s-addr=%p",
out_stream);
debug_it->ir_maps, in_packet));
out_packet = trace_ir_mapping_create_new_mapped_packet(debug_it->ir_maps,
- in_packet);
+ in_packet);
BT_ASSERT(out_packet);
if (has_default_clock_snapshot) {
/* Borrow clock snapshot. */
cs = bt_message_packet_beginning_borrow_default_clock_snapshot_const(
- in_message);
+ in_message);
/* Create an output packet beginning message. */
out_message = bt_message_packet_beginning_create_with_default_clock_snapshot(
- debug_it->input_iterator, out_packet,
- bt_clock_snapshot_get_value(cs));
+ debug_it->input_iterator, out_packet,
+ bt_clock_snapshot_get_value(cs));
} else {
out_message = bt_message_packet_beginning_create(
- debug_it->input_iterator, out_packet);
+ debug_it->input_iterator, out_packet);
}
if (!out_message) {
BT_COMP_LOGE("Error creating output packet beginning message: "
if (has_default_clock_snapshot) {
/* Borrow clock snapshot. */
cs = bt_message_packet_end_borrow_default_clock_snapshot_const(
- in_message);
+ in_message);
/* Create an outpute packet end message. */
out_message = bt_message_packet_end_create_with_default_clock_snapshot(
- debug_it->input_iterator, out_packet,
- bt_clock_snapshot_get_value(cs));
+ debug_it->input_iterator, out_packet,
+ bt_clock_snapshot_get_value(cs));
} else {
out_message = bt_message_packet_end_create(
- debug_it->input_iterator, out_packet);
+ debug_it->input_iterator, out_packet);
}
if (!out_message) {
in_message);
BT_ASSERT(in_stream);
- out_stream = trace_ir_mapping_borrow_mapped_stream(
- debug_it->ir_maps, in_stream);
+ out_stream = trace_ir_mapping_borrow_mapped_stream( debug_it->ir_maps,
+ in_stream);
BT_ASSERT(out_stream);
has_default_clock_snapshots =
bt_stream_class_discarded_events_have_default_clock_snapshots(
bt_stream_borrow_class_const(in_stream));
if (has_default_clock_snapshots) {
- begin_cs =
- bt_message_discarded_events_borrow_beginning_default_clock_snapshot_const(
- in_message);
- end_cs =
- bt_message_discarded_events_borrow_end_default_clock_snapshot_const(
- in_message);
+ begin_cs = bt_message_discarded_events_borrow_beginning_default_clock_snapshot_const(
+ in_message);
+ end_cs = bt_message_discarded_events_borrow_end_default_clock_snapshot_const(
+ in_message);
begin_cs_value = bt_clock_snapshot_get_value(begin_cs);
end_cs_value = bt_clock_snapshot_get_value(end_cs);
- out_message =
- bt_message_discarded_events_create_with_default_clock_snapshots(
- debug_it->input_iterator, out_stream,
- begin_cs_value, end_cs_value);
+ out_message = bt_message_discarded_events_create_with_default_clock_snapshots(
+ debug_it->input_iterator, out_stream,
+ begin_cs_value, end_cs_value);
} else {
out_message = bt_message_discarded_events_create(
- debug_it->input_iterator, out_stream);
+ debug_it->input_iterator, out_stream);
}
if (!out_message) {
BT_COMP_LOGE("Error creating output discarded events message: "
}
prop_avail = bt_message_discarded_events_get_count(in_message,
- &discarded_events);
+ &discarded_events);
if (prop_avail == BT_PROPERTY_AVAILABILITY_NOT_AVAILABLE) {
bt_message_discarded_events_set_count(out_message,
- discarded_events);
+ discarded_events);
}
error:
bt_self_component *self_comp = debug_it->self_comp;
in_stream = bt_message_discarded_packets_borrow_stream_const(
- in_message);
+ in_message);
BT_ASSERT(in_stream);
- out_stream = trace_ir_mapping_borrow_mapped_stream(
- debug_it->ir_maps, in_stream);
+ out_stream = trace_ir_mapping_borrow_mapped_stream( debug_it->ir_maps,
+ in_stream);
BT_ASSERT(out_stream);
has_default_clock_snapshots =
bt_stream_class_discarded_packets_have_default_clock_snapshots(
bt_stream_borrow_class_const(in_stream));
if (has_default_clock_snapshots) {
- begin_cs =
- bt_message_discarded_packets_borrow_beginning_default_clock_snapshot_const(
- in_message);
+ begin_cs = bt_message_discarded_packets_borrow_beginning_default_clock_snapshot_const(
+ in_message);
- end_cs =
- bt_message_discarded_packets_borrow_end_default_clock_snapshot_const(
- in_message);
+ end_cs = bt_message_discarded_packets_borrow_end_default_clock_snapshot_const(
+ in_message);
begin_cs_value = bt_clock_snapshot_get_value(begin_cs);
end_cs_value = bt_clock_snapshot_get_value(end_cs);
out_message = bt_message_discarded_packets_create_with_default_clock_snapshots(
- debug_it->input_iterator, out_stream,
- begin_cs_value, end_cs_value);
+ debug_it->input_iterator, out_stream,
+ begin_cs_value, end_cs_value);
} else {
out_message = bt_message_discarded_packets_create(
- debug_it->input_iterator, out_stream);
+ debug_it->input_iterator, out_stream);
}
if (!out_message) {
BT_COMP_LOGE("Error creating output discarded packet message: "
}
prop_avail = bt_message_discarded_packets_get_count(in_message,
- &discarded_packets);
+ &discarded_packets);
if (prop_avail == BT_PROPERTY_AVAILABILITY_NOT_AVAILABLE) {
bt_message_discarded_packets_set_count(out_message,
- discarded_packets);
+ discarded_packets);
}
error:
switch (bt_message_get_type(in_message)) {
case BT_MESSAGE_TYPE_EVENT:
- out_message = handle_event_message(debug_it,
- in_message);
+ out_message = handle_event_message(debug_it, in_message);
break;
case BT_MESSAGE_TYPE_PACKET_BEGINNING:
- out_message = handle_packet_begin_message(debug_it,
- in_message);
+ out_message = handle_packet_begin_message(debug_it, in_message);
break;
case BT_MESSAGE_TYPE_PACKET_END:
- out_message = handle_packet_end_message(debug_it,
- in_message);
+ out_message = handle_packet_end_message(debug_it, in_message);
break;
case BT_MESSAGE_TYPE_STREAM_BEGINNING:
- out_message = handle_stream_begin_message(debug_it,
- in_message);
+ out_message = handle_stream_begin_message(debug_it, in_message);
break;
case BT_MESSAGE_TYPE_STREAM_END:
- out_message = handle_stream_end_message(debug_it,
- in_message);
+ out_message = handle_stream_end_message(debug_it, in_message);
break;
case BT_MESSAGE_TYPE_MESSAGE_ITERATOR_INACTIVITY:
- out_message = handle_msg_iterator_inactivity(debug_it,
- in_message);
+ out_message = handle_msg_iterator_inactivity(debug_it, in_message);
break;
case BT_MESSAGE_TYPE_DISCARDED_EVENTS:
- out_message = handle_discarded_events_message(debug_it,
- in_message);
+ out_message = handle_discarded_events_message(debug_it, in_message);
break;
case BT_MESSAGE_TYPE_DISCARDED_PACKETS:
- out_message = handle_discarded_packets_message(debug_it,
- in_message);
+ out_message = handle_discarded_packets_message(debug_it, in_message);
break;
default:
abort();
}
add_port_status = bt_self_component_filter_add_output_port(
- self_comp_flt, "out", NULL, NULL);
+ self_comp_flt, "out", NULL, NULL);
switch (add_port_status) {
case BT_SELF_COMPONENT_ADD_PORT_STATUS_ERROR:
status = BT_COMPONENT_CLASS_INITIALIZE_METHOD_STATUS_ERROR;
{
struct debug_info_component *debug_info =
bt_self_component_get_data(
- bt_self_component_filter_as_self_component(
- self_comp_flt));
+ bt_self_component_filter_as_self_component(
+ self_comp_flt));
bt_logging_level log_level = debug_info->log_level;
bt_self_component *self_comp = debug_info->self_comp;
upstream_iterator_ret_status =
bt_self_component_port_input_message_iterator_next(
- upstream_iterator, &input_msgs, count);
+ upstream_iterator, &input_msgs, count);
if (upstream_iterator_ret_status !=
BT_MESSAGE_ITERATOR_NEXT_STATUS_OK) {
/*
if (debug_info_msg_iter->msg_iter) {
bt_self_component_port_input_message_iterator_put_ref(
- debug_info_msg_iter->msg_iter);
+ debug_info_msg_iter->msg_iter);
}
if (debug_info_msg_iter->ir_maps) {
BT_HIDDEN
bt_component_class_message_iterator_can_seek_beginning_method_status
-debug_info_msg_iter_can_seek_beginning(
- bt_self_message_iterator *self_msg_iter, bt_bool *can_seek)
+debug_info_msg_iter_can_seek_beginning(bt_self_message_iterator *self_msg_iter,
+ bt_bool *can_seek)
{
struct debug_info_msg_iter *debug_info_msg_iter =
bt_self_message_iterator_get_data(self_msg_iter);
}
BT_HIDDEN
-bt_component_class_message_iterator_seek_beginning_method_status debug_info_msg_iter_seek_beginning(
- bt_self_message_iterator *self_msg_iter)
+bt_component_class_message_iterator_seek_beginning_method_status
+debug_info_msg_iter_seek_beginning(bt_self_message_iterator *self_msg_iter)
{
struct debug_info_msg_iter *debug_info_msg_iter =
bt_self_message_iterator_get_data(self_msg_iter);
BT_ASSERT(value);
if (bt_value_is_signed_integer(value)) {
- set_env_status =
- bt_trace_set_environment_entry_integer(
- out_trace, value_name,
- bt_value_integer_signed_get(
- value));
+ set_env_status = bt_trace_set_environment_entry_integer(
+ out_trace, value_name,
+ bt_value_integer_signed_get( value));
} else if (bt_value_is_string(value)) {
- set_env_status =
- bt_trace_set_environment_entry_string(
- out_trace, value_name,
- bt_value_string_get(value));
+ set_env_status = bt_trace_set_environment_entry_string(
+ out_trace, value_name,
+ bt_value_string_get(value));
} else {
abort();
}
- if (set_env_status !=
- BT_TRACE_SET_ENVIRONMENT_ENTRY_STATUS_OK) {
+ if (set_env_status != BT_TRACE_SET_ENVIRONMENT_ENTRY_STATUS_OK) {
BT_COMP_LOGE("Cannot copy trace's environment: "
"trace-addr=%p, name=\"%s\"",
out_trace, trace_name);
member);
in_member_field =
bt_field_structure_borrow_member_field_by_name_const(
- in_field, in_member_name);
+ in_field, in_member_name);
out_member_field =
bt_field_structure_borrow_member_field_by_name(
- out_field, in_member_name);
+ out_field, in_member_name);
copy_field_content(in_member_field,
out_member_field, log_level, self_comp);
in_selected_option_idx =
bt_field_variant_get_selected_option_field_index(
- in_field);
+ in_field);
sel_opt_status = bt_field_variant_select_option_field_by_index(out_field,
- in_selected_option_idx);
+ in_selected_option_idx);
if (sel_opt_status !=
BT_FIELD_VARIANT_SELECT_OPTION_FIELD_STATUS_OK) {
BT_COMP_LOGE("Cannot select variant field's option field: "
}
BT_COMP_LOGD("Created new mapped trace class: in-tc-addr=%p, out-tc-addr=%p",
- in_trace_class, out_trace_class);
+ in_trace_class, out_trace_class);
end:
return out_trace_class;
in_trace_class = bt_trace_borrow_class_const(in_trace);
metadata_maps = borrow_metadata_maps_from_input_trace_class(ir_maps,
- in_trace_class);
+ in_trace_class);
if (!metadata_maps->output_trace_class) {
metadata_maps->output_trace_class =
ir_maps->self_comp);
BT_COMP_LOGD("Created new mapped trace: in-t-addr=%p, out-t-addr=%p",
- in_trace, out_trace);
+ in_trace, out_trace);
end:
return out_trace;
}
BT_ASSERT(in_stream_class);
return g_hash_table_lookup(md_maps->stream_class_map,
- (gpointer) in_stream_class);
+ (gpointer) in_stream_class);
}
static
struct trace_ir_metadata_maps *md_maps;
BT_COMP_LOGD("Creating new mapped stream class: in-sc-addr=%p",
- in_stream_class);
+ in_stream_class);
md_maps = borrow_metadata_maps_from_input_stream_class(ir_maps,
- in_stream_class);
+ in_stream_class);
BT_ASSERT(md_maps);
BT_ASSERT(in_stream_class);
/* Create an out_stream_class. */
out_stream_class = bt_stream_class_create_with_id(
- md_maps->output_trace_class,
- bt_stream_class_get_id(in_stream_class));
+ md_maps->output_trace_class,
+ bt_stream_class_get_id(in_stream_class));
if (!out_stream_class) {
BT_COMP_LOGE_STR("Error create output stream class");
goto end;
/* If not, create a new one and add it to the mapping. */
ret = copy_stream_class_content(ir_maps, in_stream_class,
- out_stream_class);
+ out_stream_class);
if (ret) {
BT_COMP_LOGE_STR("Error copy content to output stream class");
out_stream_class = NULL;
}
g_hash_table_insert(md_maps->stream_class_map,
- (gpointer) in_stream_class, out_stream_class);
+ (gpointer) in_stream_class, out_stream_class);
BT_COMP_LOGD("Created new mapped stream class: in-sc-addr=%p, out-sc-addr=%p",
- in_stream_class, out_stream_class);
+ in_stream_class, out_stream_class);
end:
return out_stream_class;
out_stream_class = borrow_mapped_stream_class(md_maps, in_stream_class);
if (!out_stream_class) {
out_stream_class = create_new_mapped_stream_class(ir_maps,
- in_stream_class);
+ in_stream_class);
if (!out_stream_class) {
goto end;
}
ir_maps->self_comp);
g_hash_table_insert(d_maps->stream_map, (gpointer) in_stream,
- out_stream);
+ out_stream);
BT_COMP_LOGD("Created new mapped stream: in-s-addr=%p, out-s-addr=%p",
- in_stream, out_stream);
+ in_stream, out_stream);
end:
return out_stream;
const bt_event_class *in_event_class)
{
return g_hash_table_lookup(md_maps->event_class_map,
- (gpointer) in_event_class);
+ (gpointer) in_event_class);
}
BT_HIDDEN
in_event_class);
in_trace_class = bt_stream_class_borrow_trace_class_const(
- bt_event_class_borrow_stream_class_const(
- in_event_class));
+ bt_event_class_borrow_stream_class_const(in_event_class));
- md_maps = borrow_metadata_maps_from_input_trace_class(ir_maps, in_trace_class);
+ md_maps = borrow_metadata_maps_from_input_trace_class(ir_maps,
+ in_trace_class);
BT_ASSERT(!borrow_mapped_event_class(md_maps, in_event_class));
/* Create an output event class. */
out_event_class = bt_event_class_create_with_id(out_stream_class,
- bt_event_class_get_id(in_event_class));
+ bt_event_class_get_id(in_event_class));
if (!out_event_class) {
BT_COMP_LOGE_STR("Error creating output event class");
goto end;
/* If not, create a new one and add it to the mapping. */
ret = copy_event_class_content(ir_maps, in_event_class,
- out_event_class);
+ out_event_class);
if (ret) {
BT_COMP_LOGE_STR("Error copy content to output event class");
out_event_class = NULL;
}
g_hash_table_insert(md_maps->event_class_map,
- (gpointer) in_event_class, out_event_class);
+ (gpointer) in_event_class, out_event_class);
BT_COMP_LOGD("Created new mapped event class: in-ec-addr=%p, out-ec-addr=%p",
- in_event_class, out_event_class);
+ in_event_class, out_event_class);
end:
return out_event_class;
BT_ASSERT(ir_maps);
BT_ASSERT(in_event_class);
- md_maps = borrow_metadata_maps_from_input_event_class(ir_maps, in_event_class);
+ md_maps = borrow_metadata_maps_from_input_event_class(ir_maps,
+ in_event_class);
/* Return the mapped event_class. */
return borrow_mapped_event_class(md_maps, in_event_class);
BT_ASSERT(d_maps);
BT_ASSERT(in_packet);
- return g_hash_table_lookup(d_maps->packet_map,
- (gpointer) in_packet);
+ return g_hash_table_lookup(d_maps->packet_map, (gpointer) in_packet);
}
BT_HIDDEN
ir_maps->self_comp);
g_hash_table_insert(d_maps->packet_map,
- (gpointer) in_packet, out_packet);
+ (gpointer) in_packet, out_packet);
BT_COMP_LOGD("Created new mapped packet: in-p-addr=%p, out-p-addr=%p",
- in_packet, out_packet);
+ in_packet, out_packet);
end:
return out_packet;
if (maps->metadata_maps) {
gboolean ret;
ret = g_hash_table_remove(maps->metadata_maps,
- (gpointer) in_trace_class);
+ (gpointer) in_trace_class);
BT_ASSERT(ret);
}
}
struct trace_ir_data_maps *trace_ir_data_maps_create(struct trace_ir_maps *ir_maps,
const bt_trace *in_trace)
{
- struct trace_ir_data_maps *d_maps =
- g_new0(struct trace_ir_data_maps, 1);
+ struct trace_ir_data_maps *d_maps = g_new0(struct trace_ir_data_maps, 1);
bt_trace_add_listener_status add_listener_status;
if (!d_maps) {
/* Create the hashtables used to map metadata objects. */
md_maps->stream_class_map = g_hash_table_new_full(g_direct_hash,
- g_direct_equal, NULL, (GDestroyNotify) bt_stream_class_put_ref);
+ g_direct_equal, NULL, (GDestroyNotify) bt_stream_class_put_ref);
md_maps->event_class_map = g_hash_table_new_full(g_direct_hash,
- g_direct_equal, NULL, (GDestroyNotify) bt_event_class_put_ref);
+ g_direct_equal, NULL, (GDestroyNotify) bt_event_class_put_ref);
md_maps->field_class_map = g_hash_table_new_full(g_direct_hash,
- g_direct_equal, NULL, (GDestroyNotify) bt_field_class_put_ref);
+ g_direct_equal, NULL, (GDestroyNotify) bt_field_class_put_ref);
md_maps->clock_class_map = g_hash_table_new_full(g_direct_hash,
- g_direct_equal, NULL, (GDestroyNotify) bt_clock_class_put_ref);
+ g_direct_equal, NULL, (GDestroyNotify) bt_clock_class_put_ref);
add_listener_status = bt_trace_class_add_destruction_listener(
- in_trace_class,
- trace_ir_metadata_maps_remove_func,
- ir_maps, &md_maps->destruction_listener_id);
- BT_ASSERT(add_listener_status ==
- BT_TRACE_CLASS_ADD_LISTENER_STATUS_OK);
+ in_trace_class, trace_ir_metadata_maps_remove_func,
+ ir_maps, &md_maps->destruction_listener_id);
+ BT_ASSERT(add_listener_status == BT_TRACE_CLASS_ADD_LISTENER_STATUS_OK);
error:
return md_maps;
}
status = bt_trace_class_remove_destruction_listener(
- maps->input_trace_class,
- maps->destruction_listener_id);
+ maps->input_trace_class, maps->destruction_listener_id);
if (status != BT_TRACE_CLASS_REMOVE_LISTENER_STATUS_OK) {
BT_COMP_LOG_CUR_LVL(BT_LOG_DEBUG, maps->log_level,
maps->self_comp,
ir_maps->self_comp = self_comp;
ir_maps->data_maps = g_hash_table_new_full(g_direct_hash,
- g_direct_equal, (GDestroyNotify) NULL,
- (GDestroyNotify) trace_ir_data_maps_destroy);
+ g_direct_equal, (GDestroyNotify) NULL,
+ (GDestroyNotify) trace_ir_data_maps_destroy);
ir_maps->metadata_maps = g_hash_table_new_full(g_direct_hash,
- g_direct_equal, (GDestroyNotify) NULL,
- (GDestroyNotify) trace_ir_metadata_maps_destroy);
+ g_direct_equal, (GDestroyNotify) NULL,
+ (GDestroyNotify) trace_ir_metadata_maps_destroy);
goto end;
error:
bt_self_component *self_comp)
{
BT_COMP_LOGD("Copying content of trace class: in-tc-addr=%p, out-tc-addr=%p",
- in_trace_class, out_trace_class);
+ in_trace_class, out_trace_class);
/*
* Safe to use the same value object because it's frozen at this
/* Use the same stream class ids as in the origin trace class. */
bt_trace_class_set_assigns_automatic_stream_class_id(out_trace_class,
- BT_FALSE);
+ BT_FALSE);
BT_COMP_LOGD("Copied content of trace class: in-tc-addr=%p, out-tc-addr=%p",
- in_trace_class, out_trace_class);
+ in_trace_class, out_trace_class);
return 0;
}
int ret = 0;
BT_COMP_LOGD("Copying content of clock class: in-cc-addr=%p, out-cc-addr=%p",
- in_clock_class, out_clock_class);
+ in_clock_class, out_clock_class);
clock_class_name = bt_clock_class_get_name(in_clock_class);
}
bt_clock_class_set_frequency(out_clock_class,
- bt_clock_class_get_frequency(in_clock_class));
+ bt_clock_class_get_frequency(in_clock_class));
bt_clock_class_set_precision(out_clock_class,
- bt_clock_class_get_precision(in_clock_class));
+ bt_clock_class_get_precision(in_clock_class));
bt_clock_class_get_offset(in_clock_class, &seconds, &cycles);
bt_clock_class_set_offset(out_clock_class, seconds, cycles);
bt_clock_class_set_origin_is_unix_epoch(out_clock_class,
- bt_clock_class_origin_is_unix_epoch(in_clock_class));
+ bt_clock_class_origin_is_unix_epoch(in_clock_class));
BT_COMP_LOGD("Copied content of clock class: in-cc-addr=%p, out-cc-addr=%p",
- in_clock_class, out_clock_class);
+ in_clock_class, out_clock_class);
error:
return ret;
BT_ASSERT(in_clock_class);
return g_hash_table_lookup(md_maps->clock_class_map,
- (gpointer) in_clock_class);
+ (gpointer) in_clock_class);
}
static
-bt_clock_class *create_new_mapped_clock_class(
- bt_self_component *self_comp,
+bt_clock_class *create_new_mapped_clock_class(bt_self_component *self_comp,
struct trace_ir_metadata_maps *md_maps,
const bt_clock_class *in_clock_class)
{
bt_clock_class *out_clock_class;
- int ret;
bt_logging_level log_level = md_maps->log_level;
+ int ret;
BT_COMP_LOGD("Creating new mapped clock class: in-cc-addr=%p",
- in_clock_class);
+ in_clock_class);
BT_ASSERT(md_maps);
BT_ASSERT(in_clock_class);
}
g_hash_table_insert(md_maps->clock_class_map,
- (gpointer) in_clock_class, out_clock_class);
+ (gpointer) in_clock_class, out_clock_class);
BT_COMP_LOGD("Created new mapped clock class: in-cc-addr=%p, out-cc-addr=%p",
- in_clock_class, out_clock_class);
+ in_clock_class, out_clock_class);
end:
return out_clock_class;
}
const bt_field_class *in_packet_context_fc, *in_common_context_fc;
bt_field_class *out_packet_context_fc, *out_common_context_fc;
const char *in_name;
- int ret = 0;
bt_logging_level log_level = ir_maps->log_level;
bt_self_component *self_comp = ir_maps->self_comp;
+ int ret = 0;
BT_COMP_LOGD("Copying content of stream class: in-sc-addr=%p, out-sc-addr=%p",
- in_stream_class, out_stream_class);
+ in_stream_class, out_stream_class);
md_maps = borrow_metadata_maps_from_input_stream_class(ir_maps, in_stream_class);
in_clock_class = bt_stream_class_borrow_default_clock_class_const(
- in_stream_class);
+ in_stream_class);
if (in_clock_class) {
/* Copy the clock class. */
- out_clock_class =
- borrow_mapped_clock_class(md_maps, in_clock_class);
+ out_clock_class = borrow_mapped_clock_class(md_maps,
+ in_clock_class);
if (!out_clock_class) {
out_clock_class = create_new_mapped_clock_class(
- ir_maps->self_comp, md_maps,
- in_clock_class);
+ ir_maps->self_comp, md_maps, in_clock_class);
}
bt_stream_class_set_default_clock_class(out_stream_class,
- out_clock_class);
-
+ out_clock_class);
}
/*
}
bt_stream_class_set_assigns_automatic_stream_id(out_stream_class,
- BT_FALSE);
+ BT_FALSE);
bt_stream_class_set_assigns_automatic_event_class_id(out_stream_class,
- BT_FALSE);
+ BT_FALSE);
/*
* Add the input packet context field class to the context to
*/
in_packet_context_fc =
bt_stream_class_borrow_packet_context_field_class_const(
- in_stream_class);
+ in_stream_class);
md_maps->fc_resolving_ctx->packet_context =
in_packet_context_fc;
if (in_packet_context_fc) {
/* Copy packet context. */
- out_packet_context_fc = create_field_class_copy(
- md_maps, in_packet_context_fc);
+ out_packet_context_fc = create_field_class_copy(md_maps,
+ in_packet_context_fc);
- ret = copy_field_class_content(md_maps,
- in_packet_context_fc, out_packet_context_fc);
+ ret = copy_field_class_content(md_maps, in_packet_context_fc,
+ out_packet_context_fc);
if (ret) {
ret = -1;
goto error;
*/
in_common_context_fc =
bt_stream_class_borrow_event_common_context_field_class_const(
- in_stream_class);
- md_maps->fc_resolving_ctx->event_common_context =
- in_common_context_fc;
+ in_stream_class);
+ md_maps->fc_resolving_ctx->event_common_context = in_common_context_fc;
if (in_common_context_fc) {
/* Copy common context. */
/* TODO: I find it a bit awkward to have this special function
* here to add the debug-info field class. I would like to
* abstract that.*/
- out_common_context_fc = create_field_class_copy(
- md_maps, in_common_context_fc);
+ out_common_context_fc = create_field_class_copy(md_maps,
+ in_common_context_fc);
- ret = copy_event_common_context_field_class_content(
- md_maps, ir_maps->debug_info_field_class_name,
- in_common_context_fc, out_common_context_fc);
+ ret = copy_event_common_context_field_class_content(md_maps,
+ ir_maps->debug_info_field_class_name,
+ in_common_context_fc, out_common_context_fc);
if (ret) {
goto error;
}
}
BT_COMP_LOGD("Copied content of stream class: in-sc-addr=%p, out-sc-addr=%p",
- in_stream_class, out_stream_class);
+ in_stream_class, out_stream_class);
error:
return ret;
}
bt_self_component *self_comp = ir_maps->self_comp;
BT_COMP_LOGD("Copying content of event class: in-ec-addr=%p, out-ec-addr=%p",
- in_event_class, out_event_class);
+ in_event_class, out_event_class);
/* Copy event class name. */
in_event_class_name = bt_event_class_get_name(in_event_class);
prop_avail = bt_event_class_get_log_level(in_event_class,
&ec_log_level);
if (prop_avail == BT_PROPERTY_AVAILABILITY_AVAILABLE) {
- bt_event_class_set_log_level(out_event_class,
- ec_log_level);
+ bt_event_class_set_log_level(out_event_class, ec_log_level);
}
/* Copy event class emf uri. */
}
}
- md_maps = borrow_metadata_maps_from_input_event_class(ir_maps, in_event_class);
+ md_maps = borrow_metadata_maps_from_input_event_class(ir_maps,
+ in_event_class);
/*
* Add the input event class' specific ctx to te
* context.
*/
in_event_specific_context =
bt_event_class_borrow_specific_context_field_class_const(
- in_event_class);
+ in_event_class);
md_maps->fc_resolving_ctx->event_specific_context =
in_event_specific_context;
if (in_event_specific_context) {
/* Copy the specific context of this event class. */
out_specific_context_fc = create_field_class_copy(md_maps,
- in_event_specific_context);
+ in_event_specific_context);
ret = copy_field_class_content(md_maps,
- in_event_specific_context, out_specific_context_fc);
+ in_event_specific_context, out_specific_context_fc);
if (ret) {
goto error;
}
* the context.
*/
in_event_payload = bt_event_class_borrow_payload_field_class_const(
- in_event_class);
+ in_event_class);
md_maps->fc_resolving_ctx->event_payload = in_event_payload;
if (in_event_payload) {
/* Copy the payload of this event class. */
out_payload_fc = create_field_class_copy(md_maps,
- in_event_payload);
- ret = copy_field_class_content(md_maps,
- in_event_payload, out_payload_fc);
+ in_event_payload);
+ ret = copy_field_class_content(md_maps, in_event_payload,
+ out_payload_fc);
if (ret) {
goto error;
}
/* Add the output payload to the output event class. */
- if (bt_event_class_set_payload_field_class(
- out_event_class, out_payload_fc) !=
- BT_EVENT_CLASS_SET_FIELD_CLASS_STATUS_OK) {
+ if (bt_event_class_set_payload_field_class(out_event_class,
+ out_payload_fc) != BT_EVENT_CLASS_SET_FIELD_CLASS_STATUS_OK) {
BT_COMP_LOGE("Error setting event class' payload "
"field class: ec-addr=%p, payload-fc-addr=%p",
out_event_class, out_payload_fc);
}
BT_COMP_LOGD("Copied content of event class: in-ec-addr=%p, out-ec-addr=%p",
- in_event_class, out_event_class);
+ in_event_class, out_event_class);
error:
return ret;
}
{
bt_field_class *debug_field_class = NULL, *bin_field_class = NULL,
*func_field_class = NULL, *src_field_class = NULL;
- int ret = 0;
bt_logging_level log_level = md_maps->log_level;
bt_self_component *self_comp = md_maps->self_comp;
+ int ret = 0;
BT_COMP_LOGD("Copying content of event common context field class: "
"in-fc-addr=%p, out-fc-addr=%p", in_field_class, out_field_class);
* classes.
*/
debug_field_class = bt_field_class_structure_create(
- md_maps->output_trace_class);
+ md_maps->output_trace_class);
if (!debug_field_class) {
BT_COMP_LOGE_STR("Failed to create debug_info structure.");
ret = -1;
}
bin_field_class = bt_field_class_string_create(
- md_maps->output_trace_class);
+ md_maps->output_trace_class);
if (!bin_field_class) {
BT_COMP_LOGE_STR("Failed to create string for field=bin.");
ret = -1;
}
func_field_class = bt_field_class_string_create(
- md_maps->output_trace_class);
+ md_maps->output_trace_class);
if (!func_field_class) {
BT_COMP_LOGE_STR("Failed to create string for field=func.");
ret = -1;
}
src_field_class = bt_field_class_string_create(
- md_maps->output_trace_class);
+ md_maps->output_trace_class);
if (!src_field_class) {
BT_COMP_LOGE_STR("Failed to create string for field=src.");
ret = -1;
goto error;
}
- if (bt_field_class_structure_append_member(
- debug_field_class, "bin", bin_field_class) !=
+ if (bt_field_class_structure_append_member(debug_field_class,
+ "bin", bin_field_class) !=
BT_FIELD_CLASS_STRUCTURE_APPEND_MEMBER_STATUS_OK) {
BT_COMP_LOGE_STR("Failed to add a field to debug_info "
"struct: field=bin.");
}
BT_FIELD_CLASS_PUT_REF_AND_RESET(bin_field_class);
- if (bt_field_class_structure_append_member(
- debug_field_class, "func", func_field_class) !=
+ if (bt_field_class_structure_append_member(debug_field_class,
+ "func", func_field_class) !=
BT_FIELD_CLASS_STRUCTURE_APPEND_MEMBER_STATUS_OK) {
BT_COMP_LOGE_STR("Failed to add a field to debug_info "
"struct: field=func.");
}
BT_FIELD_CLASS_PUT_REF_AND_RESET(func_field_class);
- if (bt_field_class_structure_append_member(
- debug_field_class, "src", src_field_class) !=
+ if (bt_field_class_structure_append_member(debug_field_class,
+ "src", src_field_class) !=
BT_FIELD_CLASS_STRUCTURE_APPEND_MEMBER_STATUS_OK) {
BT_COMP_LOGE_STR("Failed to add a field to debug_info "
"struct: field=src.");
BT_ASSERT(bt_field_class_get_type(fc) == BT_FIELD_CLASS_TYPE_STRUCTURE);
BT_COMP_LOGD("Walking field path on field class: fp-addr=%p, fc-addr=%p",
- fp, fc);
+ fp, fc);
fp_item_count = bt_field_path_get_item_count(fp);
curr_fc = fc;
bt_field_class *output_fc)
{
bt_field_class_integer_set_preferred_display_base(output_fc,
- bt_field_class_integer_get_preferred_display_base(input_fc));
+ bt_field_class_integer_get_preferred_display_base(input_fc));
bt_field_class_integer_set_field_value_range(output_fc,
- bt_field_class_integer_get_field_value_range(input_fc));
+ bt_field_class_integer_get_field_value_range(input_fc));
}
static inline
-int field_class_bool_copy(
- struct trace_ir_metadata_maps *md_maps,
+int field_class_bool_copy(struct trace_ir_metadata_maps *md_maps,
const bt_field_class *in_field_class,
bt_field_class *out_field_class)
{
BT_COMP_LOGD("Copying content of boolean field class: "
- "in-fc-addr=%p, out-fc-addr=%p",
- in_field_class, out_field_class);
+ "in-fc-addr=%p, out-fc-addr=%p", in_field_class, out_field_class);
+ /*
+ * There is no content to copy. Keep this function call anyway for
+ * logging purposes.
+ */
BT_COMP_LOGD("Copied content of boolean field class: "
- "in-fc-addr=%p, out-fc-addr=%p",
- in_field_class, out_field_class);
+ "in-fc-addr=%p, out-fc-addr=%p", in_field_class, out_field_class);
return 0;
}
bt_field_class *out_field_class)
{
BT_COMP_LOGD("Copying content of bit array field class: "
- "in-fc-addr=%p, out-fc-addr=%p",
- in_field_class, out_field_class);
+ "in-fc-addr=%p, out-fc-addr=%p", in_field_class, out_field_class);
+ /*
+ * There is no content to copy. Keep this function call anyway for
+ * logging purposes.
+ */
BT_COMP_LOGD("Copied content of bit array field class: "
- "in-fc-addr=%p, out-fc-addr=%p",
- in_field_class, out_field_class);
+ "in-fc-addr=%p, out-fc-addr=%p", in_field_class, out_field_class);
return 0;
}
bt_field_class *out_field_class)
{
BT_COMP_LOGD("Copying content of unsigned integer field class: "
- "in-fc-addr=%p, out-fc-addr=%p",
- in_field_class, out_field_class);
+ "in-fc-addr=%p, out-fc-addr=%p", in_field_class, out_field_class);
field_class_integer_set_props(in_field_class, out_field_class);
BT_COMP_LOGD("Copied content of unsigned integer field class: "
- "in-fc-addr=%p, out-fc-addr=%p",
- in_field_class, out_field_class);
+ "in-fc-addr=%p, out-fc-addr=%p", in_field_class, out_field_class);
return 0;
}
bt_field_class *out_field_class)
{
BT_COMP_LOGD("Copying content of signed integer field class: "
- "in-fc-addr=%p, out-fc-addr=%p",
- in_field_class, out_field_class);
+ "in-fc-addr=%p, out-fc-addr=%p", in_field_class, out_field_class);
field_class_integer_set_props(in_field_class, out_field_class);
BT_COMP_LOGD("Copied content of signed integer field class: "
- "in-fc-addr=%p, out-fc-addr=%p",
- in_field_class, out_field_class);
+ "in-fc-addr=%p, out-fc-addr=%p", in_field_class, out_field_class);
return 0;
}
int ret = 0;
BT_COMP_LOGD("Copying content of unsigned enumeration field class: "
- "in-fc-addr=%p, out-fc-addr=%p",
- in_field_class, out_field_class);
+ "in-fc-addr=%p, out-fc-addr=%p", in_field_class, out_field_class);
/* Copy properties of the inner integer. */
field_class_integer_set_props(in_field_class, out_field_class);
/* Copy all enumeration entries. */
- enum_mapping_count = bt_field_class_enumeration_get_mapping_count(in_field_class);
+ enum_mapping_count = bt_field_class_enumeration_get_mapping_count(
+ in_field_class);
for (i = 0; i < enum_mapping_count; i++) {
const char *label;
const bt_integer_range_set_unsigned *range_set;
const bt_field_class_enumeration_mapping *mapping;
u_mapping = bt_field_class_enumeration_unsigned_borrow_mapping_by_index_const(
- in_field_class, i);
+ in_field_class, i);
mapping = bt_field_class_enumeration_unsigned_mapping_as_mapping_const(
u_mapping);
label = bt_field_class_enumeration_mapping_get_label(mapping);
}
BT_COMP_LOGD("Copied content of unsigned enumeration field class: "
- "in-fc-addr=%p, out-fc-addr=%p",
- in_field_class, out_field_class);
+ "in-fc-addr=%p, out-fc-addr=%p", in_field_class, out_field_class);
error:
return ret;
int ret = 0;
BT_COMP_LOGD("Copying content of signed enumeration field class: "
- "in-fc-addr=%p, out-fc-addr=%p",
- in_field_class, out_field_class);
+ "in-fc-addr=%p, out-fc-addr=%p", in_field_class, out_field_class);
/* Copy properties of the inner integer. */
field_class_integer_set_props(in_field_class, out_field_class);
const bt_field_class_enumeration_mapping *mapping;
s_mapping = bt_field_class_enumeration_signed_borrow_mapping_by_index_const(
- in_field_class, i);
+ in_field_class, i);
mapping = bt_field_class_enumeration_signed_mapping_as_mapping_const(
s_mapping);
label = bt_field_class_enumeration_mapping_get_label(mapping);
}
BT_COMP_LOGD("Copied content of signed enumeration field class: "
- "in-fc-addr=%p, out-fc-addr=%p",
- in_field_class, out_field_class);
+ "in-fc-addr=%p, out-fc-addr=%p", in_field_class, out_field_class);
error:
return ret;
int ret = 0;
BT_COMP_LOGD("Copying content of structure field class: "
- "in-fc-addr=%p, out-fc-addr=%p",
- in_field_class, out_field_class);
+ "in-fc-addr=%p, out-fc-addr=%p", in_field_class, out_field_class);
/* Get the number of member in that struct. */
struct_member_count =
bt_field_class_structure_get_member_count(in_field_class);
in_member);
member_name = bt_field_class_structure_member_get_name(in_member);
BT_COMP_LOGD("Copying structure field class's field: "
- "index=%" PRId64 ", "
- "member-fc-addr=%p, field-name=\"%s\"",
+ "index=%" PRId64 ", member-fc-addr=%p, field-name=\"%s\"",
i, in_member_fc, member_name);
out_member_field_class = create_field_class_copy(md_maps,
in_member_fc);
if (!out_member_field_class) {
BT_COMP_LOGE("Cannot copy structure field class's field: "
- "index=%" PRId64 ", "
- "field-fc-addr=%p, field-name=\"%s\"",
+ "index=%" PRId64 ", field-fc-addr=%p, field-name=\"%s\"",
i, in_member_fc, member_name);
ret = -1;
goto error;
int ret = 0;
BT_COMP_LOGD("Copying content of variant field class: "
- "in-fc-addr=%p, out-fc-addr=%p",
- in_field_class, out_field_class);
+ "in-fc-addr=%p, out-fc-addr=%p", in_field_class, out_field_class);
variant_option_count =
bt_field_class_variant_get_option_count(in_field_class);
for (i = 0; i < variant_option_count; i++) {
goto error;
}
ret = copy_field_class_content_internal(md_maps, in_option_fc,
- out_option_field_class);
+ out_option_field_class);
if (ret) {
BT_COMP_LOGE_STR("Error copying content of option variant "
"field class'");
bt_field_class *out_field_class)
{
BT_COMP_LOGD("Copying content of static array field class: in-fc-addr=%p, "
- "out-fc-addr=%p", in_field_class, out_field_class);
+ "out-fc-addr=%p", in_field_class, out_field_class);
/*
* There is no content to copy. Keep this function call anyway for
* logging purposes.
*/
BT_COMP_LOGD("Copied content of static array field class: in-fc-addr=%p, "
- "out-fc-addr=%p", in_field_class, out_field_class);
+ "out-fc-addr=%p", in_field_class, out_field_class);
return 0;
}
bt_field_class *out_field_class)
{
BT_COMP_LOGD("Copying content of dynamic array field class: "
- "in-fc-addr=%p, out-fc-addr=%p",
- in_field_class, out_field_class);
-
+ "in-fc-addr=%p, out-fc-addr=%p", in_field_class, out_field_class);
/*
* There is no content to copy. Keep this function call anyway for
* logging purposes.
*/
- BT_COMP_LOGD("Copied dynamic array field class: in-fc-addr=%p, "
- "out-fc-addr=%p", in_field_class, out_field_class);
+ BT_COMP_LOGD("Copied content of dynamic array field class: "
+ "in-fc-addr=%p, out-fc-addr=%p", in_field_class, out_field_class);
return 0;
}
bt_field_class *out_field_class)
{
BT_COMP_LOGD("Copying content of option field class: "
- "in-fc-addr=%p, out-fc-addr=%p",
- in_field_class, out_field_class);
+ "in-fc-addr=%p, out-fc-addr=%p", in_field_class, out_field_class);
if (bt_field_class_get_type(out_field_class) ==
BT_FIELD_CLASS_TYPE_OPTION_WITH_BOOL_SELECTOR) {
in_field_class));
}
- BT_COMP_LOGD("Copied option field class: in-fc-addr=%p, "
- "out-fc-addr=%p", in_field_class, out_field_class);
+ BT_COMP_LOGD("Copied content of option field class: "
+ "in-fc-addr=%p, out-fc-addr=%p", in_field_class, out_field_class);
return 0;
}
bt_field_class *out_field_class)
{
BT_COMP_LOGD("Copying content of string field class: in-fc-addr=%p, "
- "out-fc-addr=%p", in_field_class, out_field_class);
+ "out-fc-addr=%p", in_field_class, out_field_class);
/*
* There is no content to copy. Keep this function call anyway for
* logging purposes.
*/
BT_COMP_LOGD("Copied content of string field class: in-fc-addr=%p, "
- "out-fc-addr=%p", in_field_class, out_field_class);
+ "out-fc-addr=%p", in_field_class, out_field_class);
return 0;
}
create_field_class_copy_internal(md_maps, in_elem_fc);
if (!out_elem_fc) {
BT_COMP_LOGE("Error creating output elem field class "
- "from input elem field class for static array: "
- "in-fc-addr=%p", in_elem_fc);
+ "from input elem field class for static array: "
+ "in-fc-addr=%p", in_elem_fc);
goto error;
}
ret = copy_field_class_content_internal(md_maps, in_elem_fc, out_elem_fc);
if (ret) {
BT_COMP_LOGE("Error creating output elem field class "
- "from input elem field class for static array: "
- "in-fc-addr=%p", in_elem_fc);
+ "from input elem field class for static array: "
+ "in-fc-addr=%p", in_elem_fc);
BT_FIELD_CLASS_PUT_REF_AND_RESET(out_elem_fc);
goto error;
}
bt_field_class_type fc_type = bt_field_class_get_type(in_field_class);
BT_COMP_LOGD("Creating bare field class based on field class: in-fc-addr=%p",
- in_field_class);
+ in_field_class);
switch (fc_type) {
case BT_FIELD_CLASS_TYPE_BOOL:
out_field_class = bt_field_class_bool_create(
- md_maps->output_trace_class);
+ md_maps->output_trace_class);
break;
case BT_FIELD_CLASS_TYPE_BIT_ARRAY:
out_field_class = bt_field_class_bit_array_create(
- md_maps->output_trace_class,
- bt_field_class_bit_array_get_length(
- in_field_class));
+ md_maps->output_trace_class,
+ bt_field_class_bit_array_get_length(
+ in_field_class));
break;
case BT_FIELD_CLASS_TYPE_UNSIGNED_INTEGER:
out_field_class = bt_field_class_integer_unsigned_create(
- md_maps->output_trace_class);
+ md_maps->output_trace_class);
break;
case BT_FIELD_CLASS_TYPE_SIGNED_INTEGER:
out_field_class = bt_field_class_integer_signed_create(
- md_maps->output_trace_class);
+ md_maps->output_trace_class);
break;
case BT_FIELD_CLASS_TYPE_UNSIGNED_ENUMERATION:
out_field_class = bt_field_class_enumeration_unsigned_create(
- md_maps->output_trace_class);
+ md_maps->output_trace_class);
break;
case BT_FIELD_CLASS_TYPE_SIGNED_ENUMERATION:
out_field_class = bt_field_class_enumeration_signed_create(
- md_maps->output_trace_class);
+ md_maps->output_trace_class);
break;
case BT_FIELD_CLASS_TYPE_SINGLE_PRECISION_REAL:
out_field_class = bt_field_class_real_single_precision_create(
- md_maps->output_trace_class);
+ md_maps->output_trace_class);
break;
case BT_FIELD_CLASS_TYPE_DOUBLE_PRECISION_REAL:
out_field_class = bt_field_class_real_double_precision_create(
- md_maps->output_trace_class);
+ md_maps->output_trace_class);
break;
case BT_FIELD_CLASS_TYPE_STRING:
out_field_class = bt_field_class_string_create(
- md_maps->output_trace_class);
+ md_maps->output_trace_class);
break;
case BT_FIELD_CLASS_TYPE_STRUCTURE:
out_field_class = bt_field_class_structure_create(
- md_maps->output_trace_class);
+ md_maps->output_trace_class);
break;
case BT_FIELD_CLASS_TYPE_STATIC_ARRAY:
{
const bt_field_class *in_elem_fc =
bt_field_class_array_borrow_element_field_class_const(
in_field_class);
- uint64_t array_len =
- bt_field_class_array_static_get_length(in_field_class);
+ uint64_t array_len = bt_field_class_array_static_get_length(
+ in_field_class);
bt_field_class *out_elem_fc = copy_field_class_array_element(
md_maps, in_elem_fc);
}
out_field_class = bt_field_class_array_static_create(
- md_maps->output_trace_class,
- out_elem_fc, array_len);
+ md_maps->output_trace_class,
+ out_elem_fc, array_len);
break;
}
case BT_FIELD_CLASS_TYPE_DYNAMIC_ARRAY:
}
out_field_class = bt_field_class_array_dynamic_create(
- md_maps->output_trace_class,
- out_elem_fc, out_length_fc);
+ md_maps->output_trace_class,
+ out_elem_fc, out_length_fc);
break;
}
case BT_FIELD_CLASS_TYPE_OPTION_WITHOUT_SELECTOR:
{
const bt_field_class *in_content_fc =
bt_field_class_option_borrow_field_class_const(
- in_field_class);
+ in_field_class);
bt_field_class *out_selector_fc = NULL;
bt_field_class *out_content_fc;
int ret;
out_content_fc = create_field_class_copy_internal(
- md_maps, in_content_fc);
+ md_maps, in_content_fc);
if (!out_content_fc) {
BT_COMP_LOGE_STR("Cannot copy option's content field class.");
goto error;
* classes.
*/
g_hash_table_insert(md_maps->field_class_map,
- (gpointer) in_field_class, out_field_class);
+ (gpointer) in_field_class, out_field_class);
error:
if(out_field_class){