Fix CLI to work with multiple ports and dynamically added ports
authorPhilippe Proulx <eeppeliteloop@gmail.com>
Mon, 8 May 2017 17:04:40 +0000 (13:04 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Sun, 28 May 2017 16:57:42 +0000 (12:57 -0400)
commit9009cc24dc1634ba03cbdfe6c37831f8b1ba95d3
treeaba56003e3c45da1a19842408366b760c84fff18
parentbeb0fb75663091c20765a8508162711ba828f456
Fix CLI to work with multiple ports and dynamically added ports

This patch makes the CLI actually connect component ports within the
application's graph before running it.

On the command line, you specify the connections like you used to,
except that the ports are not specific ports anymore: they are globbing
patterns (only the `*` special character is supported as of this
version) which specify: when a new upstream port matches the left part
of the connection argument (specific component and port name globbing
pattern), connect it to the first port that matches the right part
(specific component and port name globbing pattern). For example:

    src.*meow*:sink.master-*

would make babeltrace(1) connect all the ports of the component instance
`src` of which the names match `*meow*` to the next available port
of the instance `sink` of which the name matches `master-*`.

This mechanism allows to connect specific ports together, or to connect
group of ports or any ports using wildcards.

The code for the globbing pattern matching was grabbed from the
LTTng-UST project and I'm one of the copyright holders anyway.

This patch also adds a --retry-duration option to the `connect` and
`run` commands to specify how many microseconds the program should
wait when the graph returns BT_GRAPH_STATUS_AGAIN (do not wait when 0).
The default duration is 100 ms.

Some files are renamed to match what they really are. The concept of a
Babeltrace configuration (`bt_config`) is beyond the command-line
arguments: it could eventually be read from a configuration file, etc.
babeltrace-cfg-cli-args.c is a module which can create a Babeltrace
configuration out of command-line arguments.

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
16 files changed:
cli/Makefile.am
cli/babeltrace-cfg-cli-args-connect.c [new file with mode: 0644]
cli/babeltrace-cfg-cli-args-connect.h [new file with mode: 0644]
cli/babeltrace-cfg-cli-args-default.c [new file with mode: 0644]
cli/babeltrace-cfg-cli-args-default.h [new file with mode: 0644]
cli/babeltrace-cfg-cli-args.c [new file with mode: 0644]
cli/babeltrace-cfg-cli-args.h [new file with mode: 0644]
cli/babeltrace-cfg-connect.c [deleted file]
cli/babeltrace-cfg-connect.h [deleted file]
cli/babeltrace-cfg.c
cli/babeltrace-cfg.h
cli/babeltrace.c
cli/default-cfg.c [deleted file]
cli/default-cfg.h [deleted file]
common/common.c
include/babeltrace/common-internal.h
This page took 0.025465 seconds and 4 git commands to generate.