-#ifndef BABELTRACE_PLUGIN_DEBUG_INFO_TRACE_IR_MAPPING_H
-#define BABELTRACE_PLUGIN_DEBUG_INFO_TRACE_IR_MAPPING_H
/*
- * Copyright 2019 Francis Deslauriers francis.deslauriers@efficios.com>
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
+ * SPDX-License-Identifier: MIT
*
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
+ * Copyright 2019 Francis Deslauriers francis.deslauriers@efficios.com>
*/
+#ifndef BABELTRACE_PLUGIN_DEBUG_INFO_TRACE_IR_MAPPING_H
+#define BABELTRACE_PLUGIN_DEBUG_INFO_TRACE_IR_MAPPING_H
+
#include <glib.h>
#include "common/assert.h"
#include "debug-info.h"
+enum debug_info_trace_ir_mapping_status {
+ DEBUG_INFO_TRACE_IR_MAPPING_STATUS_OK = 0,
+ DEBUG_INFO_TRACE_IR_MAPPING_STATUS_MEMORY_ERROR = -12,
+};
+
/* Used to resolve field paths for dynamic arrays and variant field classes. */
struct field_class_resolving_context {
/* Weak reference. Owned by input stream class. */
};
struct trace_ir_metadata_maps {
+ bt_logging_level log_level;
+ bt_self_component *self_comp;
const bt_trace_class *input_trace_class;
bt_trace_class *output_trace_class;
struct field_class_resolving_context *fc_resolving_ctx;
- uint64_t destruction_listener_id;
+ bt_listener_id destruction_listener_id;
};
struct trace_ir_data_maps {
+ bt_logging_level log_level;
+ bt_self_component *self_comp;
const bt_trace *input_trace;
bt_trace *output_trace;
*/
GHashTable *packet_map;
- uint64_t destruction_listener_id;
+ bt_listener_id destruction_listener_id;
};
struct trace_ir_maps {
+ bt_logging_level log_level;
+
/*
* input trace -> trace_ir_data_maps.
* input trace: weak reference. Owned by an upstream component.
BT_HIDDEN
struct trace_ir_maps *trace_ir_maps_create(bt_self_component *self_comp,
- const char *debug_info_field_name);
+ const char *debug_info_field_name, bt_logging_level log_level);
BT_HIDDEN
void trace_ir_maps_clear(struct trace_ir_maps *maps);
BT_HIDDEN
void trace_ir_metadata_maps_destroy(struct trace_ir_metadata_maps *md_maps);
+BT_HIDDEN
+bt_stream_class *trace_ir_mapping_create_new_mapped_stream_class(
+ struct trace_ir_maps *ir_maps,
+ const bt_stream_class *in_stream_class);
+
+BT_HIDDEN
+bt_stream_class *trace_ir_mapping_borrow_mapped_stream_class(
+ struct trace_ir_maps *ir_maps,
+ const bt_stream_class *in_stream_class);
+
BT_HIDDEN
bt_stream *trace_ir_mapping_create_new_mapped_stream(
struct trace_ir_maps *ir_maps,