#include <babeltrace/common-internal.h>
#include "babeltrace-cfg.h"
#include "babeltrace-cfg-cli-args-connect.h"
#include <babeltrace/common-internal.h>
#include "babeltrace-cfg.h"
#include "babeltrace-cfg-cli-args-connect.h"
struct bt_config_component *comp = g_ptr_array_index(comps, i);
if (strcmp(name, comp->instance_name->str) == 0) {
struct bt_config_component *comp = g_ptr_array_index(comps, i);
if (strcmp(name, comp->instance_name->str) == 0) {
struct bt_config_component *comp;
comp = find_component(cfg, connection->upstream_comp_name->str);
struct bt_config_component *comp;
comp = find_component(cfg, connection->upstream_comp_name->str);
if (!comp) {
snprintf(error_buf, error_buf_size,
"Invalid connection: cannot find upstream component `%s`:\n %s\n",
if (!comp) {
snprintf(error_buf, error_buf_size,
"Invalid connection: cannot find upstream component `%s`:\n %s\n",
if (!comp) {
snprintf(error_buf, error_buf_size,
"Invalid connection: cannot find downstream component `%s`:\n %s\n",
if (!comp) {
snprintf(error_buf, error_buf_size,
"Invalid connection: cannot find downstream component `%s`:\n %s\n",
src_comp = find_component(cfg,
connection->upstream_comp_name->str);
src_comp = find_component(cfg,
connection->upstream_comp_name->str);
dst_comp = find_component(cfg,
connection->downstream_comp_name->str);
dst_comp = find_component(cfg,
connection->downstream_comp_name->str);
if (src_comp->type == BT_COMPONENT_CLASS_TYPE_SOURCE) {
if (dst_comp->type != BT_COMPONENT_CLASS_TYPE_FILTER &&
if (src_comp->type == BT_COMPONENT_CLASS_TYPE_SOURCE) {
if (dst_comp->type != BT_COMPONENT_CLASS_TYPE_FILTER &&
src_comp_name = g_ptr_array_index(path, path->len - 1);
for (conn_i = 0; conn_i < cfg->cmd_data.run.connections->len; conn_i++) {
src_comp_name = g_ptr_array_index(path, path->len - 1);
for (conn_i = 0; conn_i < cfg->cmd_data.run.connections->len; conn_i++) {
for (i = 0; i < comps->len; i++) {
struct bt_config_component *comp = g_ptr_array_index(comps, i);
for (i = 0; i < comps->len; i++) {
struct bt_config_component *comp = g_ptr_array_index(comps, i);
comp->instance_name->str)) {
snprintf(error_buf, error_buf_size,
"Component `%s` is not connected\n",
comp->instance_name->str)) {
snprintf(error_buf, error_buf_size,
"Component `%s` is not connected\n",
struct bt_config_connection *connection =
g_ptr_array_index(cfg->cmd_data.run.connections, i);
struct bt_config_connection *connection =
g_ptr_array_index(cfg->cmd_data.run.connections, i);
- cfg->cmd_data.run.sources, connected_components,
+ cfg->cmd_data.run.sources,
+ bt_value_borrow_from_private(connected_components),
error_buf, error_buf_size);
if (ret) {
goto end;
}
ret = validate_all_components_connected_in_array(
error_buf, error_buf_size);
if (ret) {
goto end;
}
ret = validate_all_components_connected_in_array(
- cfg->cmd_data.run.filters, connected_components,
+ cfg->cmd_data.run.filters,
+ bt_value_borrow_from_private(connected_components),
error_buf, error_buf_size);
if (ret) {
goto end;
}
ret = validate_all_components_connected_in_array(
error_buf, error_buf_size);
if (ret) {
goto end;
}
ret = validate_all_components_connected_in_array(
- cfg->cmd_data.run.sinks, connected_components,
+ cfg->cmd_data.run.sinks,
+ bt_value_borrow_from_private(connected_components),
connection->downstream_comp_name->str,
connection->downstream_port_glob->str);
connection->downstream_comp_name->str,
connection->downstream_port_glob->str);
flat_connection_name->str)) {
snprintf(error_buf, error_buf_size,
"Duplicate connection:\n %s\n",
flat_connection_name->str)) {
snprintf(error_buf, error_buf_size,
"Duplicate connection:\n %s\n",
if (flat_connection_name) {
g_string_free(flat_connection_name, TRUE);
if (flat_connection_name) {
g_string_free(flat_connection_name, TRUE);
cfg_connection = cfg_connection_from_arg(arg);
if (!cfg_connection) {
snprintf(error_buf, error_buf_size, "Cannot parse --connect option's argument:\n %s\n",
cfg_connection = cfg_connection_from_arg(arg);
if (!cfg_connection) {
snprintf(error_buf, error_buf_size, "Cannot parse --connect option's argument:\n %s\n",