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:
This page took 0.02579 seconds and 4 git commands to generate.