cli/babeltrace.c: do not call load_all_plugins() in commands
authorPhilippe Proulx <eeppeliteloop@gmail.com>
Sat, 13 May 2017 19:57:10 +0000 (15:57 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Sun, 28 May 2017 16:57:43 +0000 (12:57 -0400)
main() already calls load_all_plugins() when the configuration asks to.

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
cli/babeltrace.c

index 4a0a25c56aa2e5a90308178e98acbdbcbe2a5571..a5f8072c7d69001415a06a73108ca23a85d56ebb 100644 (file)
@@ -688,15 +688,10 @@ void print_plugin_info(struct bt_plugin *plugin)
 static
 int cmd_query(struct bt_config *cfg)
 {
-       int ret;
+       int ret = 0;
        struct bt_component_class *comp_cls = NULL;
        struct bt_value *results = NULL;
 
-       ret = load_all_plugins(cfg->plugin_paths);
-       if (ret) {
-               goto end;
-       }
-
        comp_cls = find_component_class(cfg->cmd_data.query.cfg_component->plugin_name->str,
                cfg->cmd_data.query.cfg_component->comp_cls_name->str,
                cfg->cmd_data.query.cfg_component->type);
@@ -758,15 +753,10 @@ end:
 static
 int cmd_help(struct bt_config *cfg)
 {
-       int ret;
+       int ret = 0;
        struct bt_plugin *plugin = NULL;
        size_t i;
 
-       ret = load_all_plugins(cfg->plugin_paths);
-       if (ret) {
-               goto end;
-       }
-
        plugin = find_plugin(cfg->cmd_data.help.cfg_component->plugin_name->str);
        if (!plugin) {
                BT_LOGE("Cannot find plugin: plugin-name=\"%s\"",
@@ -870,11 +860,6 @@ int cmd_list_plugins(struct bt_config *cfg)
        int ret = 0;
        int plugins_count, component_classes_count = 0, i;
 
-       ret = load_all_plugins(cfg->plugin_paths);
-       if (ret) {
-               goto end;
-       }
-
        printf("From the following plugin paths:\n\n");
        print_value(stdout, cfg->plugin_paths, 2);
        printf("\n");
@@ -1576,11 +1561,6 @@ int cmd_run(struct bt_config *cfg)
        int ret = 0;
        struct cmd_run_ctx ctx = { 0 };
 
-       ret = load_all_plugins(cfg->plugin_paths);
-       if (ret) {
-               goto error;
-       }
-
        /* Initialize the command's context and the graph object */
        if (cmd_run_ctx_init(&ctx, cfg)) {
                BT_LOGE_STR("Cannot initialize the command's context.");
This page took 0.027834 seconds and 4 git commands to generate.