*
* Babeltrace CTF Text Output Plugin
*
- * 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.h>
+#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>
-const char *plugin_name = "ctf-text";
-
-static enum bt_component_status ctf_text_init(struct bt_component *);
-static void ctf_text_exit(void);
+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 License");
-BT_PLUGIN_EXIT(ctf_text_exit);
+BT_PLUGIN_LICENSE("MIT");
BT_PLUGIN_COMPONENT_CLASSES_BEGIN
-BT_PLUGIN_SINK_COMPONENT_CLASS_ENTRY(plugin_name, ctf_text_init)
+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_DEBUG = 14,
};
+static
const char *loglevel_str [] = {
[LOGLEVEL_EMERG] = "TRACE_EMERG",
[LOGLEVEL_ALERT] = "TRACE_ALERT",
bool opt_print_trace_default_fields : 1;
bool opt_print_loglevel_field : 1;
bool opt_print_emf_field : 1;
- bool opt_print_callsite_field : 1;
bool opt_print_delta_field : 1;
};
static
-enum bt_component_status ctf_text_init(struct bt_component *component)
+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;
}
-
-static
-void ctf_text_exit(void)
-{
- printf("in ctf_text_exit\n");
-}