#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/TRACE-IR-DATA-COPY"
-#include "plugins/comp-logging.h"
+#include "logging/comp-logging.h"
#include <inttypes.h>
#include <stdint.h>
}
}
+ /*
+ * Safe to use the same value object because it's frozen at this
+ * point.
+ */
+ bt_trace_set_user_attributes(out_trace,
+ bt_trace_borrow_user_attributes_const(in_trace));
+
/*
* Do not copy the trace UUID as it may be modified and should
* no longer have the same UUID.
set_env_status =
bt_trace_set_environment_entry_integer(
out_trace, value_name,
- bt_value_signed_integer_get(
+ bt_value_integer_signed_get(
value));
} else if (bt_value_is_string(value)) {
set_env_status =
}
}
+ /*
+ * Safe to use the same value object because it's frozen at this
+ * point.
+ */
+ bt_stream_set_user_attributes(out_stream,
+ bt_stream_borrow_user_attributes_const(in_stream));
BT_COMP_LOGD("Copied content of stream: in-s-addr=%p, out-s-addr=%p",
in_stream, out_stream);
end:
BT_COMP_LOGT("Copying content of field: in-f-addr=%p, out-f-addr=%p",
in_field, out_field);
switch (in_fc_type) {
+ case BT_FIELD_CLASS_TYPE_BOOL:
+ bt_field_bool_set_value(out_field,
+ bt_field_bool_get_value(in_field));
+ break;
+ case BT_FIELD_CLASS_TYPE_BIT_ARRAY:
+ bt_field_bit_array_set_value_as_integer(out_field,
+ bt_field_bit_array_get_value_as_integer(in_field));
+ break;
case BT_FIELD_CLASS_TYPE_UNSIGNED_INTEGER:
case BT_FIELD_CLASS_TYPE_UNSIGNED_ENUMERATION:
- bt_field_unsigned_integer_set_value(out_field,
- bt_field_unsigned_integer_get_value(in_field));
+ bt_field_integer_unsigned_set_value(out_field,
+ bt_field_integer_unsigned_get_value(in_field));
break;
case BT_FIELD_CLASS_TYPE_SIGNED_INTEGER:
case BT_FIELD_CLASS_TYPE_SIGNED_ENUMERATION:
- bt_field_signed_integer_set_value(out_field,
- bt_field_signed_integer_get_value(in_field));
+ bt_field_integer_signed_set_value(out_field,
+ bt_field_integer_signed_get_value(in_field));
+ break;
+ case BT_FIELD_CLASS_TYPE_SINGLE_PRECISION_REAL:
+ bt_field_real_single_precision_set_value(out_field,
+ bt_field_real_single_precision_get_value(in_field));
break;
- case BT_FIELD_CLASS_TYPE_REAL:
- bt_field_real_set_value(out_field,
- bt_field_real_get_value(in_field));
+ case BT_FIELD_CLASS_TYPE_DOUBLE_PRECISION_REAL:
+ bt_field_real_double_precision_set_value(out_field,
+ bt_field_real_double_precision_get_value(in_field));
break;
case BT_FIELD_CLASS_TYPE_STRING:
{
const bt_field *in_element_field;
bt_field *out_element_field;
uint64_t i, array_len;
- bt_field_dynamic_array_set_length_status set_len_status;
+ bt_field_array_dynamic_set_length_status set_len_status;
array_len = bt_field_array_get_length(in_field);
if (in_fc_type == BT_FIELD_CLASS_TYPE_DYNAMIC_ARRAY) {
- set_len_status = bt_field_dynamic_array_set_length(
+ set_len_status = bt_field_array_dynamic_set_length(
out_field, array_len);
if (set_len_status !=
BT_FIELD_DYNAMIC_ARRAY_SET_LENGTH_STATUS_OK) {
}
break;
}
+ case BT_FIELD_CLASS_TYPE_OPTION:
+ {
+ const bt_field *in_option_field;
+ bt_field *out_option_field;
+
+ in_option_field = bt_field_option_borrow_field_const(in_field);
+
+ if (in_option_field) {
+ bt_field_option_set_has_field(out_field, BT_TRUE);
+ out_option_field = bt_field_option_borrow_field(
+ out_field);
+ BT_ASSERT(out_option_field);
+ copy_field_content(in_option_field, out_option_field,
+ log_level, self_comp);
+ } else {
+ bt_field_option_set_has_field(out_field, BT_FALSE);
+ }
+
+ break;
+ }
case BT_FIELD_CLASS_TYPE_VARIANT_WITHOUT_SELECTOR:
case BT_FIELD_CLASS_TYPE_VARIANT_WITH_UNSIGNED_SELECTOR:
case BT_FIELD_CLASS_TYPE_VARIANT_WITH_SIGNED_SELECTOR: