From: Jérémie Galarneau Date: Thu, 21 Jan 2016 17:20:27 +0000 (-0500) Subject: text plugin test X-Git-Tag: v2.0.0-pre1~843 X-Git-Url: http://git.efficios.com/?p=babeltrace.git;a=commitdiff_plain;h=4647b93a4bd9f97903acfea2d9342326cca956d6 text plugin test Signed-off-by: Jérémie Galarneau --- diff --git a/converter/babeltrace.c b/converter/babeltrace.c index 43121dc4..748cd6b8 100644 --- a/converter/babeltrace.c +++ b/converter/babeltrace.c @@ -62,7 +62,6 @@ #define NET4_URL_PREFIX "net4://" #define NET6_URL_PREFIX "net6://" -static struct bt_component_factory *component_factory; static char *opt_input_format, *opt_output_format; /* @@ -733,6 +732,7 @@ int main(int argc, char **argv) struct bt_format *fmt_write; struct bt_trace_descriptor *td_write; struct bt_context *ctx; + struct bt_component_factory *component_factory; int i; call_plugins_hooks(); diff --git a/plugins/component-factory.c b/plugins/component-factory.c index 8dc6103d..2bee2703 100644 --- a/plugins/component-factory.c +++ b/plugins/component-factory.c @@ -334,7 +334,6 @@ bt_component_factory_register_sink_component_class( goto end; } - end: return ret; } diff --git a/plugins/component.c b/plugins/component.c index c931ddf6..0b7a9baa 100644 --- a/plugins/component.c +++ b/plugins/component.c @@ -76,8 +76,7 @@ enum bt_component_status bt_component_init(struct bt_component *component, } bt_object_init(component, bt_component_destroy); - bt_get(class); - component->class = class; + component->class = bt_get(class); component->name = g_string_new(name); if (!component->name) { ret = BT_COMPONENT_STATUS_NOMEM; diff --git a/plugins/ctf/text/text.c b/plugins/ctf/text/text.c index 49a6335b..28863679 100644 --- a/plugins/ctf/text/text.c +++ b/plugins/ctf/text/text.c @@ -33,17 +33,21 @@ #include #include +static 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 *); +static +void ctf_text_plugin_exit(void); /* Initialize plug-in entry points. */ BT_PLUGIN_NAME("ctf-text"); BT_PLUGIN_AUTHOR("Jérémie Galarneau"); BT_PLUGIN_LICENSE("MIT License"); -BT_PLUGIN_EXIT(ctf_text_exit); +BT_PLUGIN_EXIT(ctf_text_plugin_exit); +/* Defines BT_PLUGIN_INIT. */ BT_PLUGIN_COMPONENT_CLASSES_BEGIN BT_PLUGIN_SINK_COMPONENT_CLASS_ENTRY(plugin_name, ctf_text_init) BT_PLUGIN_COMPONENT_CLASSES_END @@ -66,6 +70,7 @@ enum loglevel { LOGLEVEL_DEBUG = 14, }; +static const char *loglevel_str [] = { [LOGLEVEL_EMERG] = "TRACE_EMERG", [LOGLEVEL_ALERT] = "TRACE_ALERT", @@ -103,13 +108,14 @@ struct ctf_text_component { }; static -enum bt_component_status ctf_text_init(struct bt_component *component) +enum bt_component_status ctf_text_init( + struct bt_component *component) { return BT_COMPONENT_STATUS_OK; } static -void ctf_text_exit(void) +void ctf_text_plugin_exit(void) { printf("in ctf_text_exit\n"); } diff --git a/plugins/plugin.c b/plugins/plugin.c index 1a2eb115..e6afaf59 100644 --- a/plugins/plugin.c +++ b/plugins/plugin.c @@ -77,6 +77,8 @@ struct bt_plugin *bt_plugin_create(GModule *module) PLUGIN_SYMBOL_NAME, g_module_name(module)); goto error; } + + printf("Loaded plugin with name %s\n", plugin->name); if (!g_module_symbol(module, PLUGIN_SYMBOL_LICENSE, (gpointer *) &plugin->license)) {