- /*
- * Go over all the entries in the environment section of the trace class
- * and copy the content to the new trace class.
- */
- env_field_count = bt_trace_class_get_environment_entry_count(in_trace_class);
- for (i = 0; i < env_field_count; i++) {
- const char *value_name;
- const bt_value *value = NULL;
- bt_trace_class_status trace_class_status;
-
- bt_trace_class_borrow_environment_entry_by_index_const(
- in_trace_class, i, &value_name, &value);
-
- BT_LOGD("Copying trace class environnement entry: "
- "index=%" PRId64 ", value-addr=%p, value-name=%s",
- i, value, value_name);
-
- BT_ASSERT(value_name);
- BT_ASSERT(value);
-
- if (bt_value_is_signed_integer(value)) {
- trace_class_status =
- bt_trace_class_set_environment_entry_integer(
- out_trace_class, value_name,
- bt_value_signed_integer_get(
- value));
- } else if (bt_value_is_string(value)) {
- trace_class_status =
- bt_trace_class_set_environment_entry_string(
- out_trace_class, value_name,
- bt_value_string_get(value));
- } else {
- abort();
- }
-
- if (trace_class_status != BT_TRACE_CLASS_STATUS_OK) {
- ret = -1;
- goto error;
- }
- }
-
- BT_LOGD("Copied content of trace class: in-tc-addr=%p, out-tc-addr=%p",
+ /* 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_COMP_LOGD("Copied content of trace class: in-tc-addr=%p, out-tc-addr=%p",