BABELTRACE2-RUN(1) | Babeltrace 2 manual | BABELTRACE2-RUN(1) |
babeltrace2-run - Create a Babeltrace 2 trace processing graph and run it
babeltrace2 [GENERAL OPTIONS] run [--retry-duration=TIME-US]
--connect=CONN-RULE... COMPONENTS
The run command creates a Babeltrace 2 trace processing graph and runs it.
See babeltrace2-intro(7) to learn more about the Babeltrace 2 project and its core concepts.
The run command dynamically loads Babeltrace 2 plugins which supply component classes. With the run command, you specify which component classes to instantiate as components and how to connect them.
The steps to write a babeltrace2 run command line are:
This is the COMPONENTS part of the synopsis. See “Create components” to learn more.
See “Connect components” to learn more.
The babeltrace2-convert(1) command is a specialization of the run command for the very common case of converting one or more traces: it generates a run command line and executes it. You can use its --run-args or --run-args-0 option to make it print the equivalent run command line instead.
To create a component, use the --component option. This option specifies:
Use the --component option multiple times to create multiple components. You can instantiate the same component class multiple times as different components.
At any point in the command line, the --base-params sets the current base initialization parameters and the --reset-base-params resets them. When you specify a --component option, its initial initialization parameters are a copy of the current base initialization parameters.
Immediately following a --component option on the command line, the created component is known as the current component (until the next --component option).
The --params=PARAMS option adds parameters to the current component’s initialization parameters. If PARAMS contains a key which exists in the current component’s initialization parameters, this parameter is replaced.
The components which you create from component classes with the --component option (see “Create components”) add input and output ports depending on their type. An output port is from where messages, like trace events, are sent. An input port is where messages are received. For a given component, each port has a unique name.
The purpose of the run command is to create a trace processing graph, that is, to know which component ports to connect together. The command achieves this with the help of the connection rules that you provide with one or more --connect=CONN-RULE options.
The format of CONN-RULE is:
UP-COMP-PAT[.UP-PORT-PAT]:DOWN-COMP-PAT[.DOWN-PORT-PAT]
UP-COMP-PAT
UP-PORT-PAT
DOWN-COMP-PAT
DOWN-PORT-PAT
When a source or filter component adds a new output port within the processing graph, the run command does the following to find an input port to connect it to:
For each connection rule (--connect options, in order):
If the output port's component's name matches UP-COMP-PAT and the
output port's name matches UP-PORT-PAT:
For each component COMP in the trace processing graph:
If the name of COMP matches DOWN-COMP-PAT:
Select the first input port of COMP of which the name matches
DOWN-PORT-PAT, or fail with no match. No possible connection: fail with no match.
UP-COMP-PAT, UP-PORT-PAT, DOWN-COMP-PAT, and DOWN-PORT-PAT are globbing patterns where only the wildcard character, *, is special: it matches zero or more characters. You must escape the *, ?, [, ., :, and \ characters with \.
When you do not specify UP-PORT-PAT or DOWN-PORT-PAT, they are equivalent to *.
You can leverage this connection mechanism to specify fallbacks with a careful use of wildcards, as the order of the --connect options on the command line is significant. For example:
--connect='A.out*:B.in*' --connect=A:B --connect='*:C'
With those connection rules, the run command connects:
The run command fails when it cannot find an input port to which to connect a given output port using the provided connection rules.
See “EXAMPLES” for more examples.
You can use those options before the command name.
See babeltrace2(1) for more details.
-d, --debug
-l LVL, --log-level=LVL
--omit-home-plugin-path
--omit-system-plugin-path
--plugin-path=PATH[:PATH]...
-v, --verbose
See “Create components” for more details.
-b PARAMS, --base-params=PARAMS
You can reset the current base parameters with the --reset-base-params option.
See the --params option for the format of PARAMS.
-c NAME:COMP-CLS-TYPE.PLUGIN-NAME.COMP-CLS-NAME, --component=NAME:COMP-CLS-TYPE.PLUGIN-NAME.COMP-CLS-NAME
The available values for TYPE are:
source, src
filter, flt
sink
The initial initialization parameters of this component are copied from the current base initialization parameters (see the --base-params option).
-l LVL, --log-level=LVL
The available values for LVL are:
NONE, N
FATAL, F
This level should be enabled in production.
ERROR, E
Usually, once one or more errors are reported at this level, the application, plugin, or library won’t perform any more useful task, but it should still exit cleanly.
This level should be enabled in production.
WARN, WARNING, W
This level should be enabled in production.
INFO, I
This level can be enabled in production.
DEBUG, D
This level should NOT be enabled in production.
TRACE, T
This level should NOT be enabled in production.
-p PARAMS, --params=PARAMS
If PARAMS contains a key which exists in the current component’s initialization parameters, replace the parameter.
The format of PARAMS is a comma-separated list of NAME=VALUE assignments:
NAME=VALUE[,NAME=VALUE]...
NAME
VALUE
You may put whitespaces around the individual = (assignment), , (separator), [ (array beginning), ] (array end), { (map beginning), and } (map end) characters.
Example:
--params='many=null, fresh=yes, condition=false, squirrel=-782329,
play=+23, observe=3.14, simple=beef,
needs-quotes="some string",
escape.chars-are:allowed="a \" quote",
things=[1, "hello", 2.71828],
frog={slow=2, bath=[bike, 23], blind=NO}'
-r, --reset-base-params
You can set the current base parameters with the --base-params option.
-x CONN-RULE, --connect=CONN-RULE
The format of CONN-RULE is:
UP-COMP-PAT[.UP-PORT-PAT]:DOWN-COMP-PAT[.DOWN-PORT-PAT]
UP-COMP-PAT
UP-PORT-PAT
DOWN-COMP-PAT
DOWN-PORT-PAT
See “Connect components” to learn more.
--retry-duration=TIME-US
Default: 100000 (100 ms).
-h, --help
Example 1. Create a single-port source component and a single-port sink component and connect them.
$ babeltrace2 run --component=A:src.plug.my-src \
--component=B:sink.plug.my-sink \
--connect=A:B
Possible resulting graph:
+-----------------+ +-------------------+ | src.plug.my-src | | sink.plug.my-sink | | [A] | | [B] | | | | | | out @--->@ in | +-----------------+ +-------------------+
Example 2. Use the --params option to set the current component’s initialization parameters.
In this example, the --params option only applies to component the-source.
$ babeltrace2 run --component=the-source:src.my-plugin.my-src \
--params=offset=123,flag=true \
--component=the-sink:sink.my-plugin.my-sink \
--connect=the-source:the-sink
Example 3. Use the --base-params and --reset-base-params options to set and reset the current base initialization parameters.
In this example, the effective initialization parameters of the created components are:
Component A
Component B
Component C
$ babeltrace2 run --base-params=offset=1203,flag=false \
--component=A:src.plugin.compcls \
--component=B:flt.plugin.compcls \
--params=flag=true,type=event \
--reset-base-params \
--component=C:sink.plugin.compcls \
--params=ratio=0.25 \
--connect=A:B --connect=B:C
Example 4. Specify a component connection fallback rule.
In this example, any A output port of which the name starts with foo is connected to a B input port of which the name starts with nin. Any other A output port is connected to a B input port of which the name starts with oth.
The order of the --connect options is important here: the opposite order would create a system in which the first rule is always satisfied, and any A output port, whatever its name, would be connected to a B input port with a name that starts with oth.
$ babeltrace2 run --component=A:src.plug.my-src \
--component=B:sink.plug.my-sink \
--connect='A.foo*:B:nin*' --connect='A:B.oth*'
Possible resulting graph:
+-----------------+ +-------------------+ | src.plug.my-src | | sink.plug.my-sink | | [A] | | [B] | | | | | | foot @--->@ nine | | foodies @--->@ ninja | | some-port @--->@ othello | | hello @--->@ other | +-----------------+ +-------------------+
BABELTRACE_EXEC_ON_ABORT=CMDLINE
The application only aborts when the executed command returns, ignoring its exit status.
This environment variable is ignored when the application has the setuid or the setgid access right flag set.
BABELTRACE_TERM_COLOR=(AUTO | NEVER | ALWAYS)
The available values are:
AUTO
NEVER
ALWAYS
BABELTRACE_TERM_COLOR_BRIGHT_MEANS_BOLD=0
BABELTRACE_PLUGIN_PATH=PATHS
LIBBABELTRACE2_DISABLE_PYTHON_PLUGINS=1
LIBBABELTRACE2_INIT_LOG_LEVEL=LVL
If this environment variable is set, it overrides the log level set by the --log-level option for the Babeltrace 2 library logger.
The available values for LVL are:
NONE, N
FATAL, F
This level should be enabled in production.
ERROR, E
Usually, once one or more errors are reported at this level, the application, plugin, or library won’t perform any more useful task, but it should still exit cleanly.
This level should be enabled in production.
WARN, WARNING, W
This level should be enabled in production.
INFO, I
This level can be enabled in production.
DEBUG, D
This level should NOT be enabled in production.
TRACE, T
This level should NOT be enabled in production.
LIBBABELTRACE2_NO_DLCLOSE=1
LIBBABELTRACE2_PLUGIN_PROVIDER_DIR=DIR
If this environment variable is set, it overrides the default plugin provider directory.
BABELTRACE_PYTHON_BT2_LOG_LEVEL=LVL
If this environment variable is set, it overrides the log level set by the --log-level option for the Python bindings logger.
The available values for LVL are:
NONE, N
FATAL, F
This level should be enabled in production.
ERROR, E
Usually, once one or more errors are reported at this level, the application, plugin, or library won’t perform any more useful task, but it should still exit cleanly.
This level should be enabled in production.
WARN, WARNING, W
This level should be enabled in production.
INFO, I
This level can be enabled in production.
DEBUG, D
This level should NOT be enabled in production.
TRACE, T
This level should NOT be enabled in production.
BABELTRACE_CLI_LOG_LEVEL=LVL
If this environment variable is set, it overrides the log level set by the --log-level option for the CLI logger.
The available values for LVL are:
NONE, N
FATAL, F
This level should be enabled in production.
ERROR, E
Usually, once one or more errors are reported at this level, the application, plugin, or library won’t perform any more useful task, but it should still exit cleanly.
This level should be enabled in production.
WARN, WARNING, W
This level should be enabled in production.
INFO, I
This level can be enabled in production.
DEBUG, D
This level should NOT be enabled in production.
TRACE, T
This level should NOT be enabled in production.
BABELTRACE_CLI_WARN_COMMAND_NAME_DIRECTORY_CLASH=0
BABELTRACE_DEBUG=1
BABELTRACE_VERBOSE=1
$HOME/.local/lib/babeltrace2/plugins
/usr/lib/babeltrace2/plugins
/usr/lib/babeltrace2/plugin-providers
0 on success, 1 otherwise.
If you encounter any issue or usability problem, please report it on the Babeltrace bug tracker (see <https://bugs.lttng.org/projects/babeltrace>).
The Babeltrace project shares some communication channels with the LTTng project (see <https://lttng.org/>).
The Babeltrace 2 project is the result of hard work by many regular developers and occasional contributors.
The current project maintainer is Jérémie Galarneau <mailto:jeremie.galarneau@efficios.com>.
This command is part of the Babeltrace 2 project.
Babeltrace is distributed under the MIT license (see <https://opensource.org/licenses/MIT>).
babeltrace2-intro(7), babeltrace2(1), babeltrace2-convert(1)
14 September 2019 | Babeltrace 2.0.4 |