#define BT_LOG_TAG "PLUGIN-CTF-FS-SINK-TRACE"
#include "logging.h"
-#include <babeltrace/babeltrace.h>
+#include <babeltrace2/babeltrace.h>
#include <stdio.h>
#include <stdbool.h>
#include <glib.h>
-#include <babeltrace/assert-internal.h>
-#include <babeltrace/ctfser-internal.h>
+#include <babeltrace2/assert-internal.h>
+#include <babeltrace2/ctfser-internal.h>
#include "translate-trace-ir-to-ctf-ir.h"
#include "translate-ctf-ir-to-tsdl.h"
int ret;
v = bt_trace_class_borrow_environment_entry_value_by_name_const(tc, "tracer_buffering_id");
- if (!v || !bt_value_is_integer(v)) {
+ if (!v || !bt_value_is_signed_integer(v)) {
BT_LOGD_STR("Couldn't get environment value: name=\"tracer_buffering_id\"");
goto error;
}
- g_string_append_printf(path, G_DIR_SEPARATOR_S "%" PRId64, bt_value_integer_get(v));
+ g_string_append_printf(path, G_DIR_SEPARATOR_S "%" PRId64,
+ bt_value_signed_integer_get(v));
v = bt_trace_class_borrow_environment_entry_value_by_name_const(tc, "isa_length");
- if (!v || !bt_value_is_integer(v)) {
+ if (!v || !bt_value_is_signed_integer(v)) {
BT_LOGD_STR("Couldn't get environment value: name=\"isa_length\"");
goto error;
}
- g_string_append_printf(path, G_DIR_SEPARATOR_S "%" PRIu64 "-bit", bt_value_integer_get(v));
+ g_string_append_printf(path, G_DIR_SEPARATOR_S "%" PRIu64 "-bit",
+ bt_value_signed_integer_get(v));
ret = 0;
goto end;
g_string_append_printf(path, G_DIR_SEPARATOR_S "%s", bt_value_string_get(v));
v = bt_trace_class_borrow_environment_entry_value_by_name_const(tc, "vpid");
- if (!v || !bt_value_is_integer(v)) {
+ if (!v || !bt_value_is_signed_integer(v)) {
BT_LOGD_STR("Couldn't get environment value: name=\"vpid\"");
goto error;
}
- g_string_append_printf(path, "-%" PRId64, bt_value_integer_get(v));
+ g_string_append_printf(path, "-%" PRId64, bt_value_signed_integer_get(v));
v = bt_trace_class_borrow_environment_entry_value_by_name_const(tc, "vpid_datetime");
if (!v || !bt_value_is_string(v)) {
}
v = bt_trace_class_borrow_environment_entry_value_by_name_const(tc, "tracer_major");
- if (!v || !bt_value_is_integer(v)) {
+ if (!v || !bt_value_is_signed_integer(v)) {
BT_LOGD_STR("Couldn't get environment value: name=\"tracer_major\"");
goto error;
}
- tracer_major = bt_value_integer_get(v);
+ tracer_major = bt_value_signed_integer_get(v);
v = bt_trace_class_borrow_environment_entry_value_by_name_const(tc, "tracer_minor");
- if (!v || !bt_value_is_integer(v)) {
+ if (!v || !bt_value_is_signed_integer(v)) {
BT_LOGD_STR("Couldn't get environment value: name=\"tracer_minor\"");
goto error;
}
- tracer_minor = bt_value_integer_get(v);
+ tracer_minor = bt_value_signed_integer_get(v);
if (!(tracer_major >= 3 || (tracer_major == 2 && tracer_minor >= 11))) {
BT_LOGD("Unsupported LTTng version for automatic trace path: major=%" PRId64 ", minor=%" PRId64,
tsdl = g_string_new(NULL);
BT_ASSERT(tsdl);
translate_trace_class_ctf_ir_to_tsdl(trace->tc, tsdl);
+
+ BT_ASSERT(trace->metadata_path);
fh = fopen(trace->metadata_path->str, "wb");
if (!fh) {
BT_LOGF_ERRNO("In trace destruction listener: "
trace->path = NULL;
}
- if (trace->metadata_path) {
- g_string_free(trace->metadata_path, TRUE);
- trace->metadata_path = NULL;
- }
+ g_string_free(trace->metadata_path, TRUE);
+ trace->metadata_path = NULL;
fs_sink_ctf_trace_class_destroy(trace->tc);
trace->tc = NULL;