bt_trace_class *create_new_mapped_trace_class(struct trace_ir_maps *ir_maps,
const bt_trace_class *in_trace_class)
{
bt_trace_class *create_new_mapped_trace_class(struct trace_ir_maps *ir_maps,
const bt_trace_class *in_trace_class)
{
BT_COMP_LOGD("Creating new mapped trace class: in-tc-addr=%p", in_trace_class);
BT_ASSERT(ir_maps);
BT_ASSERT(in_trace_class);
BT_COMP_LOGD("Creating new mapped trace class: in-tc-addr=%p", in_trace_class);
BT_ASSERT(ir_maps);
BT_ASSERT(in_trace_class);
- out_trace_class = bt_trace_class_create(ir_maps->self_comp);
- if (!out_trace_class) {
+ metadata_maps->output_trace_class =
+ bt_trace_class_create(ir_maps->self_comp);
+ if (!metadata_maps->output_trace_class) {
- /* If not, create a new one and add it to the mapping. */
- ret = copy_trace_class_content(in_trace_class, out_trace_class,
- ir_maps->log_level, ir_maps->self_comp);
+ /* Copy the content over and add to the mapping. */
+ ret = copy_trace_class_content(ir_maps, in_trace_class,
+ metadata_maps->output_trace_class, ir_maps->log_level,
+ ir_maps->self_comp);
return g_hash_table_lookup(md_maps->stream_class_map,
(gpointer) in_stream_class);
}
return g_hash_table_lookup(md_maps->stream_class_map,
(gpointer) in_stream_class);
}
/* Copy the content over to the output stream class. */
ret = copy_stream_class_content(ir_maps, in_stream_class,
out_stream_class);
/* Copy the content over to the output stream class. */
ret = copy_stream_class_content(ir_maps, 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);
BT_COMP_LOGD("Created new mapped stream class: in-sc-addr=%p, out-sc-addr=%p",
in_stream_class, out_stream_class);
struct trace_ir_maps *ir_maps, const bt_stream *in_stream)
{
struct trace_ir_data_maps *d_maps;
struct trace_ir_maps *ir_maps, const bt_stream *in_stream)
{
struct trace_ir_data_maps *d_maps;
const bt_stream_class *in_stream_class;
const bt_trace *in_trace;
bt_stream_class *out_stream_class;
const bt_stream_class *in_stream_class;
const bt_trace *in_trace;
bt_stream_class *out_stream_class;
BT_ASSERT(!borrow_mapped_stream(d_maps, in_stream));
in_stream_class = bt_stream_borrow_class_const(in_stream);
BT_ASSERT(!borrow_mapped_stream(d_maps, in_stream));
in_stream_class = bt_stream_borrow_class_const(in_stream);
- md_maps = borrow_metadata_maps_from_input_stream_class(ir_maps, in_stream_class);
- out_stream_class = borrow_mapped_stream_class(md_maps, in_stream_class);
+ out_stream_class = trace_ir_mapping_borrow_mapped_stream_class(ir_maps,
+ in_stream_class);
+
/* Add it to the mapping. */
g_hash_table_insert(d_maps->stream_map, (gpointer) in_stream,
out_stream);
/* Add it to the mapping. */
g_hash_table_insert(d_maps->stream_map, (gpointer) in_stream,
out_stream);
BT_ASSERT(!borrow_mapped_event_class(md_maps, in_event_class));
/* Get the right output stream class to add the new event class to it. */
BT_ASSERT(!borrow_mapped_event_class(md_maps, in_event_class));
/* Get the right output stream class to add the new event class to it. */
/* Copy the content over to the output event class. */
ret = copy_event_class_content(ir_maps, in_event_class,
out_event_class);
/* Copy the content over to the output event class. */
ret = copy_event_class_content(ir_maps, 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);
BT_COMP_LOGD("Created new mapped event class: in-ec-addr=%p, out-ec-addr=%p",
in_event_class, out_event_class);
/* Add it to the mapping. */
g_hash_table_insert(d_maps->packet_map,
(gpointer) in_packet, out_packet);
/* Add it to the mapping. */
g_hash_table_insert(d_maps->packet_map,
(gpointer) in_packet, out_packet);