We want to extend the current component params, not the base params. The
base params are already copied into the component's params when we get
the --source or --sink parameters.
Allow multiple --params (additive) to be passed to a component.
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
BT_CONFIG_COMPONENT_DEST_SOURCE;
struct bt_value *cur_base_params = NULL;
int opt;
BT_CONFIG_COMPONENT_DEST_SOURCE;
struct bt_value *cur_base_params = NULL;
int opt;
- bool cur_cfg_comp_params_set = false;
memset(&ctf_legacy_opts, 0, sizeof(ctf_legacy_opts));
memset(&text_legacy_opts, 0, sizeof(text_legacy_opts));
memset(&ctf_legacy_opts, 0, sizeof(ctf_legacy_opts));
memset(&text_legacy_opts, 0, sizeof(text_legacy_opts));
}
cur_cfg_comp_dest = BT_CONFIG_COMPONENT_DEST_SOURCE;
}
cur_cfg_comp_dest = BT_CONFIG_COMPONENT_DEST_SOURCE;
- cur_cfg_comp_params_set = false;
break;
}
case OPT_OUTPUT_FORMAT:
break;
}
case OPT_OUTPUT_FORMAT:
}
cur_cfg_comp_dest = BT_CONFIG_COMPONENT_DEST_SINK;
}
cur_cfg_comp_dest = BT_CONFIG_COMPONENT_DEST_SINK;
- cur_cfg_comp_params_set = false;
break;
}
case OPT_PARAMS:
break;
}
case OPT_PARAMS:
- if (cur_cfg_comp_params_set) {
- printf_err("Duplicate --params option for the same current component\ninstance (class %s.%s)\n",
- cur_cfg_comp->plugin_name->str,
- cur_cfg_comp->component_name->str);
- goto error;
- }
-
params = bt_value_from_arg(arg);
if (!params) {
printf_err("Invalid format for --params option's argument:\n %s\n",
params = bt_value_from_arg(arg);
if (!params) {
printf_err("Invalid format for --params option's argument:\n %s\n",
- params_to_set = bt_value_map_extend(cur_base_params,
+ params_to_set = bt_value_map_extend(cur_cfg_comp->params,
params);
BT_PUT(params);
if (!params_to_set) {
params);
BT_PUT(params);
if (!params_to_set) {
- printf_err("Cannot extend current base parameters with --params option's argument:\n %s\n",
+ printf_err("Cannot extend current component parameters with --params option's argument:\n %s\n",
arg);
goto error;
}
BT_MOVE(cur_cfg_comp->params, params_to_set);
arg);
goto error;
}
BT_MOVE(cur_cfg_comp->params, params_to_set);
- cur_cfg_comp_params_set = true;