#define BT_COMP_LOG_SELF_COMP (trace->fs_sink->self_comp)
#define BT_LOG_OUTPUT_LEVEL (trace->log_level)
#define BT_LOG_TAG "PLUGIN/SINK.CTF.FS/TRACE"
-#include "plugins/comp-logging.h"
+#include "logging/comp-logging.h"
#include <babeltrace2/babeltrace.h>
#include <stdio.h>
return unique_path;
}
+/*
+ * Disable `deprecated-declarations` warnings for
+ * lttng_validate_datetime() because we're using `GTimeVal` and
+ * g_time_val_from_iso8601() which are deprecated since GLib 2.56
+ * (Babeltrace supports older versions too).
+ */
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
+
/*
* Validate that the input string `datetime` is an ISO8601-compliant string (the
* format used by LTTng in the metadata).
return ret;
}
+#pragma GCC diagnostic pop
+
static
int append_lttng_trace_path_ust_uid(const struct fs_sink_trace *trace,
GString *path, const bt_trace *tc)
g_string_append_printf(path, G_DIR_SEPARATOR_S "%" PRId64,
bt_value_integer_signed_get(v));
- v = bt_trace_borrow_environment_entry_value_by_name_const(tc, "isa_length");
+ v = bt_trace_borrow_environment_entry_value_by_name_const(tc, "architecture_bit_width");
if (!v || !bt_value_is_signed_integer(v)) {
- BT_COMP_LOGI_STR("Couldn't get environment value: name=\"isa_length\"");
+ BT_COMP_LOGI_STR("Couldn't get environment value: name=\"architecture_bit_width\"");
goto error;
}
GString *make_trace_path_rel(const struct fs_sink_trace *trace)
{
GString *path = NULL;
+ const char *trace_name;
if (trace->fs_sink->assume_single_trace) {
/* Use output directory directly */
}
/* Otherwise, use the trace name, if available. */
- const char *trace_name = bt_trace_get_name(trace->ir_trace);
+ trace_name = bt_trace_get_name(trace->ir_trace);
if (trace_name) {
path = g_string_new(trace_name);
goto end;
fh = fopen(trace->metadata_path->str, "wb");
if (!fh) {
BT_COMP_LOGF_ERRNO("In trace destruction listener: "
- "cannot open metadata file for writing: ",
+ "cannot open metadata file for writing",
": path=\"%s\"", trace->metadata_path->str);
- abort();
+ bt_common_abort();
}
len = fwrite(tsdl->str, sizeof(*tsdl->str), tsdl->len, fh);
if (len != tsdl->len) {
BT_COMP_LOGF_ERRNO("In trace destruction listener: "
- "cannot write metadata file: ",
+ "cannot write metadata file",
": path=\"%s\"", trace->metadata_path->str);
- abort();
+ bt_common_abort();
}
if (!trace->fs_sink->quiet) {
trace->path = NULL;
}
- g_string_free(trace->metadata_path, TRUE);
- trace->metadata_path = NULL;
-
- fs_sink_ctf_trace_destroy(trace->trace);
- trace->trace = NULL;
- g_free(trace);
-
-end:
if (fh) {
int ret = fclose(fh);
if (ret != 0) {
BT_COMP_LOGW_ERRNO("In trace destruction listener: "
- "cannot close metadata file: ",
+ "cannot close metadata file",
": path=\"%s\"", trace->metadata_path->str);
}
}
- if (tsdl) {
- g_string_free(tsdl, TRUE);
- }
+ g_string_free(trace->metadata_path, TRUE);
+ trace->metadata_path = NULL;
+
+ fs_sink_ctf_trace_destroy(trace->trace);
+ trace->trace = NULL;
+ g_free(trace);
+ g_string_free(tsdl, TRUE);
+
+end:
return;
}