From: Philippe Proulx Date: Sat, 13 May 2017 19:57:10 +0000 (-0400) Subject: cli/babeltrace.c: do not call load_all_plugins() in commands X-Git-Url: http://drtracing.org/?a=commitdiff_plain;h=db95fa296e9961acf52ae6e6b0462fbd5d76748d;p=deliverable%2Fbabeltrace.git cli/babeltrace.c: do not call load_all_plugins() in commands main() already calls load_all_plugins() when the configuration asks to. Signed-off-by: Philippe Proulx Signed-off-by: Jérémie Galarneau --- diff --git a/cli/babeltrace.c b/cli/babeltrace.c index 4a0a25c56..a5f8072c7 100644 --- a/cli/babeltrace.c +++ b/cli/babeltrace.c @@ -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.");