* Copyright 2019 Philippe Proulx <pproulx@efficios.com>
*/
+#include <glib.h>
+#include <stdio.h>
+
+#include <babeltrace2/babeltrace.h>
+
#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 "logging/comp-logging.h"
-#include <babeltrace2/babeltrace.h>
-#include <stdio.h>
-#include <stdbool.h>
-#include <glib.h>
#include "common/assert.h"
-#include "ctfser/ctfser.h"
-#include "translate-trace-ir-to-ctf-ir.hpp"
-#include "translate-ctf-ir-to-tsdl.hpp"
-#include "fs-sink.hpp"
-#include "fs-sink-trace.hpp"
+#include "fs-sink-ctf-meta.hpp"
#include "fs-sink-stream.hpp"
+#include "fs-sink-trace.hpp"
+#include "fs-sink.hpp"
+#include "translate-ctf-ir-to-tsdl.hpp"
+#include "translate-trace-ir-to-ctf-ir.hpp"
/*
* Sanitizes `path` so as to:
return unique_full_path;
}
-BT_HIDDEN
void fs_sink_trace_destroy(struct fs_sink_trace *trace)
{
GString *tsdl = NULL;
fs_sink_ctf_trace_destroy(trace->trace);
trace->trace = NULL;
- g_free(trace);
+ delete trace;
g_string_free(tsdl, TRUE);
g_hash_table_remove(trace->fs_sink->traces, ir_trace);
}
-BT_HIDDEN
struct fs_sink_trace *fs_sink_trace_create(struct fs_sink_comp *fs_sink, const bt_trace *ir_trace)
{
int ret;
- struct fs_sink_trace *trace = g_new0(struct fs_sink_trace, 1);
+ fs_sink_trace *trace = new fs_sink_trace;
bt_trace_add_listener_status trace_status;
- if (!trace) {
- goto end;
- }
-
trace->log_level = fs_sink->log_level;
trace->fs_sink = fs_sink;
trace->ir_trace = ir_trace;