plugins/Makefile
plugins/ctf/Makefile
plugins/ctf/reader/Makefile
- plugins/ctf/text/Makefile
+ plugins/ctf/lttng-live/Makefile
+ plugins/text/Makefile
babeltrace.pc
babeltrace-ctf.pc
])
* @param component_class Component class of which to get the description
* @returns Description of the component class, or NULL.
*/
-extern const char *bt_component_class_get_name(
+extern const char *bt_component_class_get_description(
struct bt_component_class *component_class);
/**
*/
#include <babeltrace/plugin/component-class.h>
+#include <babeltrace/values.h>
#include <stdio.h>
#ifdef __cplusplus
#define BT_PLUGIN_INIT(_x) bt_plugin_init_func __bt_plugin_init = (_x)
#define BT_PLUGIN_EXIT(_x) bt_plugin_exit_func __bt_plugin_exit = (_x)
-#define BT_PLUGIN_COMPONENT_CLASSES_BEGIN \
- enum bt_component_status __bt_plugin_register_component_classes(\
- struct bt_component_factory *factory) \
+#define BT_PLUGIN_COMPONENT_CLASSES_BEGIN \
+ static enum bt_component_status __bt_plugin_register_component_classes( \
+ struct bt_component_factory *factory) \
{
#define BT_PLUGIN_SOURCE_COMPONENT_CLASS_ENTRY(_name, description, _init) \
bt_component_factory_register_sink_component_class(factory, \
_name, _description, _init);
-#define BT_PLUGIN_COMPONENT_CLASSES_END\
- \
- return BT_COMPONENT_STATUS_OK;\
-}\
- \
- BT_PLUGIN_INIT(__bt_plugin_register_component_classes);\
+#define BT_PLUGIN_COMPONENT_CLASSES_END \
+ return BT_COMPONENT_STATUS_OK; \
+} \
+ \
+ BT_PLUGIN_INIT(__bt_plugin_register_component_classes); \
#endif /* BABELTRACE_PLUGIN_MACROS_H */
*/
extern const char *bt_plugin_get_license(struct bt_plugin *plugin);
+/**
+ * Get the decription of a plug-in.
+ *
+ * @param plugin An instance of a plug-in
+ * @returns Plug-in description or NULL if none is available
+ */
+extern const char *bt_plugin_get_description(struct bt_plugin *plugin);
+
/**
* Get the path of a plug-in.
*
* SOFTWARE.
*/
+#include <babeltrace/plugin/component.h>
+
#ifdef __cplusplus
extern "C" {
#endif
*/
#include <stdint.h>
+#include <babeltrace/plugin/component.h>
#ifdef __cplusplus
extern "C" {
AM_CFLAGS = $(PACKAGE_CFLAGS) -I$(top_srcdir)/include
-SUBDIRS = . ctf
+SUBDIRS = . ctf text
lib_LTLIBRARIES = libbabeltrace-plugin.la
AM_CFLAGS = $(PACKAGE_CFLAGS) -I$(top_srcdir)/include
-SUBDIRS = text
+SUBDIRS = reader lttng-live
+
+lib_LTLIBRARIES = libbabeltrace-plugin-ctf.la
+
+# Plug-in system library
+libbabeltrace_plugin_ctf_la_SOURCES = symbols.c
+
+# Request that the linker keeps all static library objects.
+libbabeltrace_plugin_ctf_la_LDFLAGS = \
+ $(LD_NO_AS_NEEDED) -version-info $(BABELTRACE_LIBRARY_VERSION)
+# -Wl,--whole-archive,reader/.libs/libbabeltrace-plugin-ctf-reader.a,--no-whole-archive
+
+libbabeltrace_plugin_ctf_la_LIBADD = \
+ $(top_builddir)/lib/libbabeltrace.la \
+ $(top_builddir)/formats/ctf/libbabeltrace-ctf.la \
+ $(top_builddir)/plugins/libbabeltrace-plugin.la \
+ $(top_builddir)/plugins/ctf/reader/libbabeltrace-plugin-ctf-reader.la \
+ $(top_builddir)/plugins/ctf/lttng-live/libbabeltrace-plugin-ctf-lttng-live.la
--- /dev/null
+AM_CFLAGS = $(PACKAGE_CFLAGS) -I$(top_srcdir)/include
+
+libbabeltrace_plugin_ctf_lttng_live_la_SOURCES = lttng-live.c
+
+noinst_HEADERS = lttng-live-internal.h
+noinst_LTLIBRARIES = libbabeltrace-plugin-ctf-lttng-live.la
+
+# Request that the linker keeps all static library objects.
+libbabeltrace_plugin_ctf_lttng_live_la_LDFLAGS = \
+ $(LD_NO_AS_NEEDED)
+
+libbabeltrace_plugin_ctf_lttng_live_la_LIBADD = \
+ $(top_builddir)/lib/libbabeltrace.la \
+ $(top_builddir)/formats/ctf/libbabeltrace-ctf.la \
+ $(top_builddir)/plugins/libbabeltrace-plugin.la
--- /dev/null
+#ifndef BABELTRACE_PLUGIN_CTF_LTTNG_LIVE_INTERNAL_H
+#define BABELTRACE_PLUGIN_CTF_LTTNG_LIVE_INTERNAL_H
+
+/*
+ * BabelTrace - LTTng-live client Component
+ *
+ * Copyright 2016 Jérémie Galarneau <jeremie.galarneau@efficios.com>
+ *
+ * Author: Jérémie Galarneau <jeremie.galarneau@efficios.com>
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
+#include <babeltrace/babeltrace-internal.h>
+#include <babeltrace/plugin/component.h>
+
+#define LTTNG_LIVE_COMPONENT_NAME "lttng-live"
+#define LTTNG_LIVE_COMPONENT_DESCRIPTION "Component implementing an LTTng-live client."
+
+BT_HIDDEN
+enum bt_component_status lttng_live_init(struct bt_component *source,
+ struct bt_value *params);
+
+#endif /* BABELTRACE_PLUGIN_CTF_LTTNG_LIVE_INTERNAL_H */
--- /dev/null
+/*
+ * lttng-live.c
+ *
+ * Babeltrace CTF LTTng-live Client Component
+ *
+ * Copyright 2016 Jérémie Galarneau <jeremie.galarneau@efficios.com>
+ *
+ * Author: Jérémie Galarneau <jeremie.galarneau@efficios.com>
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
+#include "lttng-live-internal.h"
+#include <babeltrace/plugin/source.h>
+
+BT_HIDDEN
+enum bt_component_status lttng_live_init(struct bt_component *component,
+ struct bt_value *params)
+{
+ return BT_COMPONENT_STATUS_OK;
+}
AM_CFLAGS = $(PACKAGE_CFLAGS) -I$(top_srcdir)/include
-SUBDIRS = .
-
-lib_LTLIBRARIES = libbabeltrace-plugin-ctf-reader.la
+noinst_HEADERS = reader-internal.h
+noinst_LTLIBRARIES = libbabeltrace-plugin-ctf-reader.la
# Plug-in system library
libbabeltrace_plugin_ctf_reader_la_SOURCES = \
# Request that the linker keeps all static librarie objects.
libbabeltrace_plugin_ctf_reader_la_LDFLAGS = \
- -Wl,--no-as-needed -version-info $(BABELTRACE_LIBRARY_VERSION)
+ -Wl,--no-as-needed
libbabeltrace_plugin_ctf_reader_la_LIBADD = \
$(top_builddir)/lib/libbabeltrace.la \
#define BABELTRACE_PLUGIN_CTF_READER_INTERNAL_H
/*
- * BabelTrace - CTF Reader plug-in internal
+ * BabelTrace - CTF Reader Component
*
- * Copyright 2015 Jérémie Galarneau <jeremie.galarneau@efficios.com>
+ * Copyright 2016 Jérémie Galarneau <jeremie.galarneau@efficios.com>
*
* Author: Jérémie Galarneau <jeremie.galarneau@efficios.com>
*
* SOFTWARE.
*/
-#ifdef __cplusplus
-extern "C" {
-#endif
+#include <babeltrace/babeltrace-internal.h>
+#include <babeltrace/plugin/component.h>
+#define READER_COMPONENT_NAME "ctf"
+#define READER_COMPONENT_DESCRIPTION "Component used to read on-disk CTF traces."
-
-#ifdef __cplusplus
-}
-#endif
+BT_HIDDEN
+enum bt_component_status ctf_init(struct bt_component *source,
+ struct bt_value *params);
#endif /* BABELTRACE_PLUGIN_CTF_READER_INTERNAL_H */
/*
* reader.c
*
- * Babeltrace CTF Reader Plugin
+ * Babeltrace CTF Reader Component
*
- * Copyright 2015 Jérémie Galarneau <jeremie.galarneau@efficios.com>
+ * Copyright 2016 Jérémie Galarneau <jeremie.galarneau@efficios.com>
*
* Author: Jérémie Galarneau <jeremie.galarneau@efficios.com>
*
* SOFTWARE.
*/
-#include <babeltrace/plugin/plugin-lib.h>
-#include <babeltrace/plugin/plugin-system.h>
-#include <babeltrace/plugin/plugin.h>
-#include <glib.h>
-#include <stdio.h>
+#include "reader-internal.h"
+#include <babeltrace/plugin/source.h>
-const char *plugin_name = "ctf";
-
-struct ctf_reader {
- int a;
-};
-
-enum bt_plugin_type bt_plugin_lib_get_type(void)
+BT_HIDDEN
+enum bt_component_status ctf_init(struct bt_component *component,
+ struct bt_value *params)
{
- return BT_PLUGIN_TYPE_SOURCE;
+ return BT_COMPONENT_STATUS_OK;
}
-const char *bt_plugin_lib_get_format_name(void)
-{
- return plugin_name;
-}
-static
-void ctf_reader_destroy(struct bt_plugin *plugin)
-{
- struct ctf_reader *reader;
-
- if (!plugin) {
- return;
- }
-
- reader = bt_plugin_get_private_data(plugin);
- if (!reader) {
- return;
- }
-
- g_free(reader);
-}
-
-static
-struct bt_notification_iterator *ctf_reader_iterator_create(
- struct bt_plugin *plugin)
-{
- return NULL;
-}
-
-struct bt_plugin *bt_plugin_lib_create(struct bt_object *params)
-{
- struct bt_plugin *plugin = NULL;
- struct ctf_reader *reader = g_new0(struct ctf_reader, 1);
-
- plugin = bt_plugin_source_create(plugin_name, reader,
- ctf_reader_destroy, ctf_reader_iterator_create);
- if (!plugin) {
- goto error;
- }
-
-end:
- return plugin;
-error:
- if (reader) {
- g_free(reader);
- }
- goto end;
-}
--- /dev/null
+/*
+ * symbols.c
+ *
+ * Babeltrace CTF Plug-in Registration Symbols
+ *
+ * Copyright 2016 Jérémie Galarneau <jeremie.galarneau@efficios.com>
+ *
+ * Author: Jérémie Galarneau <jeremie.galarneau@efficios.com>
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
+#include <babeltrace/plugin/plugin-macros.h>
+#include "reader/reader-internal.h"
+#include "lttng-live/lttng-live-internal.h"
+
+/* Initialize plug-in entry points. */
+BT_PLUGIN_NAME("ctf");
+BT_PLUGIN_DESCRIPTION("Babeltrace CTF plug-in.");
+BT_PLUGIN_AUTHOR("Jérémie Galarneau");
+BT_PLUGIN_LICENSE("MIT");
+
+BT_PLUGIN_COMPONENT_CLASSES_BEGIN
+BT_PLUGIN_SOURCE_COMPONENT_CLASS_ENTRY(READER_COMPONENT_NAME,
+ READER_COMPONENT_DESCRIPTION, ctf_init);
+BT_PLUGIN_SOURCE_COMPONENT_CLASS_ENTRY(LTTNG_LIVE_COMPONENT_NAME,
+ LTTNG_LIVE_COMPONENT_DESCRIPTION, lttng_live_init);
+BT_PLUGIN_COMPONENT_CLASSES_END
+
+++ /dev/null
-AM_CFLAGS = $(PACKAGE_CFLAGS) -I$(top_srcdir)/include
-
-SUBDIRS = .
-
-lib_LTLIBRARIES = libbabeltrace-plugin-ctf-text.la
-
-# Plug-in system library
-libbabeltrace_plugin_ctf_text_la_SOURCES = \
- text.c
-
-# Request that the linker keeps all static library objects.
-libbabeltrace_plugin_ctf_text_la_LDFLAGS = \
- $(LD_NO_AS_NEEDED) -version-info $(BABELTRACE_LIBRARY_VERSION)
-
-libbabeltrace_plugin_ctf_text_la_LIBADD = \
- $(top_builddir)/lib/libbabeltrace.la \
- $(top_builddir)/formats/ctf/libbabeltrace-ctf.la \
- $(top_builddir)/plugins/libbabeltrace-plugin.la
+++ /dev/null
-/*
- * text.c
- *
- * Babeltrace CTF Text Output Plugin
- *
- * Copyright 2016 Jérémie Galarneau <jeremie.galarneau@efficios.com>
- *
- * Author: Jérémie Galarneau <jeremie.galarneau@efficios.com>
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
-
-#include <babeltrace/plugin/plugin-macros.h>
-#include <babeltrace/plugin/component.h>
-#include <babeltrace/plugin/sink.h>
-#include <babeltrace/plugin/notification/notification.h>
-#include <glib.h>
-#include <stdio.h>
-#include <stdbool.h>
-
-static
-enum bt_component_status ctf_text_init(struct bt_component *,
- struct bt_value *params);
-
-/* Initialize plug-in entry points. */
-BT_PLUGIN_NAME("ctf-text");
-BT_PLUGIN_DESCRIPTION("Babeltrace text output plug-in.");
-BT_PLUGIN_AUTHOR("Jérémie Galarneau");
-BT_PLUGIN_LICENSE("MIT");
-
-BT_PLUGIN_COMPONENT_CLASSES_BEGIN
-BT_PLUGIN_SINK_COMPONENT_CLASS_ENTRY("text", "Formats CTF-IR to text. Formerly known as ctf-text.", ctf_text_init)
-BT_PLUGIN_COMPONENT_CLASSES_END
-
-enum loglevel {
- LOGLEVEL_EMERG = 0,
- LOGLEVEL_ALERT = 1,
- LOGLEVEL_CRIT = 2,
- LOGLEVEL_ERR = 3,
- LOGLEVEL_WARNING = 4,
- LOGLEVEL_NOTICE = 5,
- LOGLEVEL_INFO = 6,
- LOGLEVEL_DEBUG_SYSTEM = 7,
- LOGLEVEL_DEBUG_PROGRAM = 8,
- LOGLEVEL_DEBUG_PROCESS = 9,
- LOGLEVEL_DEBUG_MODULE = 10,
- LOGLEVEL_DEBUG_UNIT = 11,
- LOGLEVEL_DEBUG_FUNCTION = 12,
- LOGLEVEL_DEBUG_LINE = 13,
- LOGLEVEL_DEBUG = 14,
-};
-
-static
-const char *loglevel_str [] = {
- [LOGLEVEL_EMERG] = "TRACE_EMERG",
- [LOGLEVEL_ALERT] = "TRACE_ALERT",
- [LOGLEVEL_CRIT] = "TRACE_CRIT",
- [LOGLEVEL_ERR] = "TRACE_ERR",
- [LOGLEVEL_WARNING] = "TRACE_WARNING",
- [LOGLEVEL_NOTICE] = "TRACE_NOTICE",
- [LOGLEVEL_INFO] = "TRACE_INFO",
- [LOGLEVEL_DEBUG_SYSTEM] = "TRACE_DEBUG_SYSTEM",
- [LOGLEVEL_DEBUG_PROGRAM] = "TRACE_DEBUG_PROGRAM",
- [LOGLEVEL_DEBUG_PROCESS] = "TRACE_DEBUG_PROCESS",
- [LOGLEVEL_DEBUG_MODULE] = "TRACE_DEBUG_MODULE",
- [LOGLEVEL_DEBUG_UNIT] = "TRACE_DEBUG_UNIT",
- [LOGLEVEL_DEBUG_FUNCTION] = "TRACE_DEBUG_FUNCTION",
- [LOGLEVEL_DEBUG_LINE] = "TRACE_DEBUG_LINE",
- [LOGLEVEL_DEBUG] = "TRACE_DEBUG",
-};
-
-struct ctf_text_component {
- bool opt_print_all_field_names : 1;
- bool opt_print_scope_field_names : 1;
- bool opt_print_header_field_names : 1;
- bool opt_print_context_field_names : 1;
- bool opt_print_payload_field_names : 1;
- bool opt_print_all_fields : 1;
- bool opt_print_trace_field : 1;
- bool opt_print_trace_domain_field : 1;
- bool opt_print_trace_procname_field : 1;
- bool opt_print_trace_vpid_field : 1;
- bool opt_print_trace_hostname_field : 1;
- bool opt_print_trace_default_fields : 1;
- bool opt_print_loglevel_field : 1;
- bool opt_print_emf_field : 1;
- bool opt_print_delta_field : 1;
-};
-
-static
-enum bt_component_status ctf_text_init(
- struct bt_component *component, struct bt_value *params)
-{
- printf("ctf_text_init\n");
- return BT_COMPONENT_STATUS_OK;
-}
--- /dev/null
+AM_CFLAGS = $(PACKAGE_CFLAGS) -I$(top_srcdir)/include
+
+SUBDIRS = .
+
+lib_LTLIBRARIES = libbabeltrace-plugin-ctf-text.la
+
+# Plug-in system library
+libbabeltrace_plugin_ctf_text_la_SOURCES = \
+ text.c
+
+# Request that the linker keeps all static library objects.
+libbabeltrace_plugin_ctf_text_la_LDFLAGS = \
+ $(LD_NO_AS_NEEDED) -version-info $(BABELTRACE_LIBRARY_VERSION)
+
+libbabeltrace_plugin_ctf_text_la_LIBADD = \
+ $(top_builddir)/lib/libbabeltrace.la \
+ $(top_builddir)/formats/ctf/libbabeltrace-ctf.la \
+ $(top_builddir)/plugins/libbabeltrace-plugin.la
--- /dev/null
+/*
+ * text.c
+ *
+ * Babeltrace CTF Text Output Plugin
+ *
+ * Copyright 2016 Jérémie Galarneau <jeremie.galarneau@efficios.com>
+ *
+ * Author: Jérémie Galarneau <jeremie.galarneau@efficios.com>
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
+#include <babeltrace/plugin/plugin-macros.h>
+#include <babeltrace/plugin/component.h>
+#include <babeltrace/plugin/sink.h>
+#include <babeltrace/plugin/notification/notification.h>
+#include <stdio.h>
+#include <stdbool.h>
+
+static
+enum bt_component_status ctf_text_init(struct bt_component *,
+ struct bt_value *params);
+
+/* Initialize plug-in entry points. */
+BT_PLUGIN_NAME("ctf-text");
+BT_PLUGIN_DESCRIPTION("Babeltrace text output plug-in.");
+BT_PLUGIN_AUTHOR("Jérémie Galarneau");
+BT_PLUGIN_LICENSE("MIT");
+
+BT_PLUGIN_COMPONENT_CLASSES_BEGIN
+BT_PLUGIN_SINK_COMPONENT_CLASS_ENTRY("text", "Formats CTF-IR to text. Formerly known as ctf-text.", ctf_text_init)
+BT_PLUGIN_COMPONENT_CLASSES_END
+
+enum loglevel {
+ LOGLEVEL_EMERG = 0,
+ LOGLEVEL_ALERT = 1,
+ LOGLEVEL_CRIT = 2,
+ LOGLEVEL_ERR = 3,
+ LOGLEVEL_WARNING = 4,
+ LOGLEVEL_NOTICE = 5,
+ LOGLEVEL_INFO = 6,
+ LOGLEVEL_DEBUG_SYSTEM = 7,
+ LOGLEVEL_DEBUG_PROGRAM = 8,
+ LOGLEVEL_DEBUG_PROCESS = 9,
+ LOGLEVEL_DEBUG_MODULE = 10,
+ LOGLEVEL_DEBUG_UNIT = 11,
+ LOGLEVEL_DEBUG_FUNCTION = 12,
+ LOGLEVEL_DEBUG_LINE = 13,
+ LOGLEVEL_DEBUG = 14,
+};
+
+static
+const char *loglevel_str [] = {
+ [LOGLEVEL_EMERG] = "TRACE_EMERG",
+ [LOGLEVEL_ALERT] = "TRACE_ALERT",
+ [LOGLEVEL_CRIT] = "TRACE_CRIT",
+ [LOGLEVEL_ERR] = "TRACE_ERR",
+ [LOGLEVEL_WARNING] = "TRACE_WARNING",
+ [LOGLEVEL_NOTICE] = "TRACE_NOTICE",
+ [LOGLEVEL_INFO] = "TRACE_INFO",
+ [LOGLEVEL_DEBUG_SYSTEM] = "TRACE_DEBUG_SYSTEM",
+ [LOGLEVEL_DEBUG_PROGRAM] = "TRACE_DEBUG_PROGRAM",
+ [LOGLEVEL_DEBUG_PROCESS] = "TRACE_DEBUG_PROCESS",
+ [LOGLEVEL_DEBUG_MODULE] = "TRACE_DEBUG_MODULE",
+ [LOGLEVEL_DEBUG_UNIT] = "TRACE_DEBUG_UNIT",
+ [LOGLEVEL_DEBUG_FUNCTION] = "TRACE_DEBUG_FUNCTION",
+ [LOGLEVEL_DEBUG_LINE] = "TRACE_DEBUG_LINE",
+ [LOGLEVEL_DEBUG] = "TRACE_DEBUG",
+};
+
+struct ctf_text_component {
+ bool opt_print_all_field_names : 1;
+ bool opt_print_scope_field_names : 1;
+ bool opt_print_header_field_names : 1;
+ bool opt_print_context_field_names : 1;
+ bool opt_print_payload_field_names : 1;
+ bool opt_print_all_fields : 1;
+ bool opt_print_trace_field : 1;
+ bool opt_print_trace_domain_field : 1;
+ bool opt_print_trace_procname_field : 1;
+ bool opt_print_trace_vpid_field : 1;
+ bool opt_print_trace_hostname_field : 1;
+ bool opt_print_trace_default_fields : 1;
+ bool opt_print_loglevel_field : 1;
+ bool opt_print_emf_field : 1;
+ bool opt_print_delta_field : 1;
+};
+
+static
+enum bt_component_status ctf_text_init(
+ struct bt_component *component, struct bt_value *params)
+{
+ printf("ctf_text_init\n");
+ return BT_COMPONENT_STATUS_OK;
+}