* SOFTWARE.
*/
+#define BT_LOG_OUTPUT_LEVEL (ctx->log_level)
#define BT_LOG_TAG "PLUGIN/SINK.CTF.FS/TRANSLATE-TRACE-IR-TO-CTF-IR"
-#include "logging.h"
+#include "logging/log.h"
#include <babeltrace2/babeltrace.h>
#include "common/macros.h"
};
struct ctx {
+ bt_logging_level log_level;
+
/* Weak */
struct fs_sink_ctf_stream_class *cur_sc;
}
static inline
-void ctx_init(struct ctx *ctx)
+void ctx_init(struct ctx *ctx, bt_logging_level log_level)
{
memset(ctx, 0, sizeof(struct ctx));
ctx->cur_path = g_array_new(FALSE, TRUE,
sizeof(struct field_path_elem));
BT_ASSERT(ctx->cur_path);
+ ctx->log_level = log_level;
}
static inline
static
int translate_event_class(struct fs_sink_ctf_stream_class *sc,
const bt_event_class *ir_ec,
- struct fs_sink_ctf_event_class **out_ec)
+ struct fs_sink_ctf_event_class **out_ec,
+ bt_logging_level log_level)
{
int ret = 0;
struct ctx ctx;
BT_ASSERT(sc);
BT_ASSERT(ir_ec);
- ctx_init(&ctx);
+ ctx_init(&ctx, log_level);
ec = fs_sink_ctf_event_class_create(sc, ir_ec);
BT_ASSERT(ec);
ctx.cur_sc = sc;
int try_translate_event_class_trace_ir_to_ctf_ir(
struct fs_sink_ctf_stream_class *sc,
const bt_event_class *ir_ec,
- struct fs_sink_ctf_event_class **out_ec)
+ struct fs_sink_ctf_event_class **out_ec,
+ bt_logging_level log_level)
{
int ret = 0;
goto end;
}
- ret = translate_event_class(sc, ir_ec, out_ec);
+ ret = translate_event_class(sc, ir_ec, out_ec, log_level);
end:
return ret;
static
int translate_stream_class(struct fs_sink_ctf_trace_class *tc,
const bt_stream_class *ir_sc,
- struct fs_sink_ctf_stream_class **out_sc)
+ struct fs_sink_ctf_stream_class **out_sc,
+ bt_logging_level log_level)
{
int ret = 0;
struct ctx ctx;
BT_ASSERT(tc);
BT_ASSERT(ir_sc);
- ctx_init(&ctx);
+ ctx_init(&ctx, log_level);
*out_sc = fs_sink_ctf_stream_class_create(tc, ir_sc);
BT_ASSERT(*out_sc);
int try_translate_stream_class_trace_ir_to_ctf_ir(
struct fs_sink_ctf_trace_class *tc,
const bt_stream_class *ir_sc,
- struct fs_sink_ctf_stream_class **out_sc)
+ struct fs_sink_ctf_stream_class **out_sc,
+ bt_logging_level log_level)
{
int ret = 0;
uint64_t i;
}
}
- ret = translate_stream_class(tc, ir_sc, out_sc);
+ ret = translate_stream_class(tc, ir_sc, out_sc, log_level);
end:
return ret;
BT_HIDDEN
struct fs_sink_ctf_trace_class *translate_trace_class_trace_ir_to_ctf_ir(
- const bt_trace_class *ir_tc)
+ const bt_trace_class *ir_tc, bt_logging_level log_level)
{
uint64_t count;
uint64_t i;
ir_tc, i, &name, &val);
if (!fs_sink_ctf_ist_valid_identifier(name)) {
- BT_LOGE("Unsupported trace class's environment entry name: "
+ BT_LOG_WRITE_CUR_LVL(BT_LOG_ERROR, log_level,
+ BT_LOG_TAG,
+ "Unsupported trace class's environment entry name: "
"name=\"%s\"", name);
goto end;
}
case BT_VALUE_TYPE_STRING:
break;
default:
- BT_LOGE("Unsupported trace class's environment entry value type: "
+ BT_LOG_WRITE_CUR_LVL(BT_LOG_ERROR, log_level,
+ BT_LOG_TAG,
+ "Unsupported trace class's environment entry value type: "
"type=%s",
bt_common_value_type_string(
bt_value_get_type(val)));