text plugin test
authorJérémie Galarneau <jeremie.galarneau@efficios.com>
Thu, 21 Jan 2016 17:20:27 +0000 (12:20 -0500)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Sat, 27 May 2017 16:57:26 +0000 (12:57 -0400)
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
converter/babeltrace.c
plugins/component-factory.c
plugins/component.c
plugins/ctf/text/text.c
plugins/plugin.c

index 43121dc43f0a6c42a63131bbbf6c14466ad233d2..748cd6b80040977d51afde9357fef108f2009e90 100644 (file)
@@ -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();
index 8dc6103d9f530ebfa3b90ca0019ad94756b90de2..2bee2703a56bc351c11e81787963dc8726fb98ce 100644 (file)
@@ -334,7 +334,6 @@ bt_component_factory_register_sink_component_class(
                goto end;
        }
 
-       
 end:
        return ret;
 }
index c931ddf62053d42c400e5966d459aca109211795..0b7a9baa431c214bb0a382a5723efc054f70c0bd 100644 (file)
@@ -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;
index 49a6335be44a1dba2eb4b4b206d145983465aaf3..28863679efaf90cdff3e0bc43d5bc594febf63b9 100644 (file)
 #include <glib.h>
 #include <stdio.h>
 
+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");
 }
index 1a2eb11555d1585a62b3348f636d08f7dab0da4f..e6afaf59ca3275c2f21594aaea34e8d73152bb95 100644 (file)
@@ -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))
        {
This page took 0.026961 seconds and 4 git commands to generate.