* Copyright 2019 Philippe Proulx <pproulx@efficios.com>
*/
+#include <glib.h>
+#include <stdio.h>
+
+#include <babeltrace2/babeltrace.h>
+
#define BT_COMP_LOG_SELF_COMP (fs_sink->self_comp)
#define BT_LOG_OUTPUT_LEVEL (fs_sink->log_level)
#define BT_LOG_TAG "PLUGIN/SINK.CTF.FS"
#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 "plugins/common/param-validation/param-validation.h"
-#include "fs-sink.hpp"
-#include "fs-sink-trace.hpp"
-#include "fs-sink-stream.hpp"
#include "fs-sink-ctf-meta.hpp"
+#include "fs-sink-stream.hpp"
+#include "fs-sink-trace.hpp"
+#include "fs-sink.hpp"
#include "translate-trace-ir-to-ctf-ir.hpp"
-#include "translate-ctf-ir-to-tsdl.hpp"
static const char * const in_port_name = "in";
}
BT_MESSAGE_ITERATOR_PUT_REF_AND_RESET(fs_sink->upstream_iter);
- g_free(fs_sink);
+ delete fs_sink;
end:
return;
}
-bt_component_class_initialize_method_status
-ctf_fs_sink_init(bt_self_component_sink *self_comp_sink,
- bt_self_component_sink_configuration *, const bt_value *params,
- void *)
+bt_component_class_initialize_method_status ctf_fs_sink_init(bt_self_component_sink *self_comp_sink,
+ bt_self_component_sink_configuration *,
+ const bt_value *params, void *)
{
bt_component_class_initialize_method_status status;
bt_self_component_add_port_status add_port_status;
bt_logging_level log_level =
bt_component_get_logging_level(bt_self_component_as_component(self_comp));
- fs_sink = g_new0(struct fs_sink_comp, 1);
- if (!fs_sink) {
- BT_COMP_LOG_CUR_LVL(BT_LOG_ERROR, log_level, self_comp,
- "Failed to allocate one CTF FS sink structure.");
- BT_CURRENT_THREAD_ERROR_APPEND_CAUSE_FROM_COMPONENT(
- self_comp, "Failed to allocate one CTF FS sink structure.");
- status = BT_COMPONENT_CLASS_INITIALIZE_METHOD_STATUS_MEMORY_ERROR;
- goto end;
- }
-
+ fs_sink = new fs_sink_comp;
fs_sink->log_level = log_level;
fs_sink->self_comp = self_comp;
fs_sink->output_dir_path = g_string_new(NULL);