NAME | SYNOPSIS | DESCRIPTION | OPTIONS | EXAMPLES | ENVIRONMENT VARIABLES | FILES | EXIT STATUS | BUGS | RESOURCES | AUTHORS | COPYRIGHT | SEE ALSO | COLOPHON

BABELTRACE-RUN(1)             Babeltrace manual            BABELTRACE-RUN(1)

NAME         top

       babeltrace-run - Create a trace processing graph and run it

SYNOPSIS         top

       babeltrace run [GENERAL OPTIONS] [--omit-home-plugin-path]
                      [--omit-system-plugin-path]
                      [--plugin-path=PATH[:PATH]...]
                      [--retry-duration=DURUS]
                      --connect=CONN-RULE... COMPONENTS

DESCRIPTION         top

       The run command creates a trace processing graph and runs it.

       See babeltrace-intro(7) to learn more about the Babeltrace project
       and its core concepts.

       The run command uses libbabeltrace to dynamically load plugins which
       supply component classes. With the run command, you specify which
       component classes to instantiate as components and how they must be
       connected.

       The steps to write a babeltrace run command line are:

        1. Specify which component classes to instantiate as components and
           how. This is the COMPONENTS part of the synopsis. See Create
           components to learn more.

        2. Specify how to connect component instances together with one or
           more --connect options. See Connect components to learn more.

           Note
           The babeltrace-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.

   Create components
       To create a component, use the --component option. This option
       specifies:

       ·   Optional: The name of the component instance. You can also use
           the --name option for this.

       ·   The type of the component class to instantiate: source, filter,
           or sink.

       ·   The name of the plugin in which to find the component class to
           instantiate.

       ·   The name of the component class to instantiate.

       You can use the --component option multiple times to create multiple
       components. You can instantiate the same component class multiple
       times as different component instances.

       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 following, optional command-line options apply to the current
       component:

       --name=NAME
           Set the name of the current component to NAME.

       --params=PARAMS
           Add PARAMS to the initialization parameters of the current
           component. If PARAMS contains a key which exists in the current
           component’s initialization parameters, this parameter is
           replaced.

           See Parameters format for the format of PARAMS.

       --key=KEY followed with --value=VALUE
           Set the current component’s initialization parameter named KEY to
           the string value VALUE. If KEY exists in the current component’s
           initialization parameters, the parameter is replaced.

   Connect components
       The components which you create from component classes with the
       --component option (see Create components) can create input and
       output ports depending on their type. An output port is where
       notifications, like trace events, are sent. An input port is where
       notifications are received. For a given component instance, 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 the --connect option.

       The format of a connection rule (the argument of the --connect
       option) is:

           UP-COMP-PAT[.UP-PORT-PAT]:DOWN-COMP-PAT[.DOWN-PORT-PAT]

       UP-COMP-PATH
           Upstream component name pattern.

       UP-PORT-PAT
           Upstream port name pattern.

       DOWN-COMP-PATH
           Downstream component name pattern.

       DOWN-PORT-PAT
           Downstream port name pattern.

       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:
             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 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.
           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. For example:

           --connect='A.out*:B.in*' --connect=A:B --connect='*:C'

       With those connection rules:

       ·   Any output port of which the name starts with out of component A
           is connected to the first input port of which the name starts
           with in of component B.

       ·   Any other output port of component A is connected to the first
           available input port of component B.

       ·   Any other output port (of any component except A) is connected to
           the first available input port of component C.

       The run command fails when it cannot find an input port to which to
       connect a created output port using the provided connection rules.

       See EXAMPLES for more examples.

   Parameters format
       The format of the PARAMS option’s argument is a comma-separated list
       of NAME=VALUE assignments:

           NAME=VALUE[,NAME=VALUE]...

       NAME
           Parameter name (C identifier plus the :, ., and - characters).

       VALUE
           One of:

           ·   null, nul, NULL: null value.

           ·   true, TRUE, yes, YES: true boolean value.

           ·   false, FALSE, no, NO: false boolean value.

           ·   Binary (0b prefix), octal (0 prefix), decimal, or hexadecimal
               (0x prefix) signed 64-bit integer.

           ·   Double precision floating point number (scientific notation
               is accepted).

           ·   Unquoted string with no special characters, and not matching
               any of the null and boolean value symbols above.

           ·   Double-quoted string (accepts escape characters).

           You may put whitespaces around the individual = (assignment) and
           , (separator) characters.

       Example:

           babeltrace ... --params='many=null, fresh=yes, condition=false,
                                    squirrel=-782329, observe=3.14,
                                    simple=beef, needs-quotes="some string",
                                    escape.chars-are:allowed="a \" quote"'

           Important
           Like in the example above, make sure to single-quote the whole
           argument when you run this command from a shell.

   Plugin path
       This command loads Babeltrace plugins to perform its operation. The
       search path for Babeltrace plugins is, in this order:

        1. The colon-separated list of directories in the
           BABELTRACE_PLUGIN_PATH environment variable.

        2. The colon-separated list of directories in the --plugin-path
           option.

        3. If the --omit-home-plugin-path option is absent:
           $HOME/.local/lib/babeltrace/plugins

        4. If the --omit-system-plugin-path option is absent:
           /usr/local/lib/babeltrace/plugins

       You can use the babeltrace-list-plugins(1) command to dynamically
       list the available plugins.

OPTIONS         top

   General options
       See babeltrace(1) for more details.

       -d, --debug
           Turn the debugging mode on.

       --log-level=LVL
           Set the log level of all known Babeltrace loggers to LVL.

       -v, --verbose
           Turn the verbose mode on.

       -h, --help
           Show general help and quit.

       -V, --version
           Show version and quit.

   Component creation
       -b PARAMS, --base-params=PARAMS
           Set the current base parameters to PARAMS. You can reset the
           current base parameters with the --reset-base-params option. See
           Parameters format for the format of PARAMS.

       -c [NAME:]TYPE.PLUGIN.COMPCLS, --component=[NAME:]TYPE.PLUGIN.COMPCLS
           Create a component initially named NAME (if specified) from the
           component class of type TYPE named COMPCLS found in the plugin
           named PLUGIN, and set it as the current component.

           The available values for TYPE are:

           source, src
               Source component class.

           filter, flt
               Filter component class.

           sink
               Sink component class.

           The initial initialization parameters of this component are
           copied from the current base initialization parameters (see the
           --base-params option).

       --key=KEY
           Set the current parameter key to KEY. The next --value option
           uses this key to add a parameter to the current component.

       --name=NAME
           Set the name of the current component to NAME. The names of all
           the components in the processing graph must be unique.

       -p PARAMS, --params=PARAMS
           Add PARAMS to the initialization parameters of the current
           component. If PARAMS contains a key which exists in the current
           component’s initialization parameters, replace the parameter. See
           Parameters format for the format of PARAMS.

       -r, --reset-base-params
           Reset the current base parameters. You can set the current base
           parameters with the --base-params option.

       -v VALUE, --value=VALUE
           Add a parameter to the current component’s initialization
           parameters of which the key is the argument of the last --key
           option and the string value is VALUE. If the current component’s
           initialization parameters already contain a key named KEY,
           replace the parameter.

   Component connection
       -C CONN-RULE, --connect=CONN-RULE
           Add the connection rule CONN-RULE. See Connect components for the
           format of CONN-RULE.

   Graph configuration
       --retry-duration=DURUS
           Set the duration of a single retry to DURUS µs when a component
           reports "try again later" (busy network or file system, for
           example).

           Default: 100000 (100 ms).

   Plugin path
       --omit-home-plugin-path
           Do not search for plugins in $HOME/.local/lib/babeltrace/plugins.

       --omit-system-plugin-path
           Do not search for plugins in /usr/local/lib/babeltrace/plugins.

       --plugin-path=PATH[:PATH]...
           Add PATH to the list of paths in which dynamic plugins can be
           found.

   Command information
       -h, --help
           Show the command’s help and quit.

EXAMPLES         top

       Example 1. Create a single-port source component and a single-port
       sink component and connect them.

           $ babeltrace 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 --name option to name the current component.

           $ babeltrace run --component=src.plug.my-src --name=the-source \
                            --component=the-sink:sink.plug.my-sink \
                            --connect=the-source:the-sink

       Example 3. Use the --params option to set the current component’s
       initialization parameters.

       In this example, the --params option only applies to component the-
       source.

           $ babeltrace 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 4. Use the --key and --value options to set a current
       component’s initialization parameter.

           $ babeltrace run --component=the-source:src.my-plugin.my-src \
                            --key=path --value ~/my-traces/the-trace
                            --component=the-sink:sink.my-plugin.my-sink \
                            --connect=the-source:the-sink

       Example 5. 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: offset=1203, flag=false

       ·   Component B: offset=1203, flag=true, type=event

       ·   Component C: ratio=0.25

           $ babeltrace 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 6. 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.

           $ babeltrace 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             |
           +-----------------+    +-------------------+

ENVIRONMENT VARIABLES         top

   Babeltrace library
       BABELTRACE_COMMON_LOG_LEVEL
           Common functions’s log level. The available values are the same
           as for the --log-level option of babeltrace(1).

       BABELTRACE_COMPAT_LOG_LEVEL
           Compatibility functions’s log level. The available values are the
           same as for the --log-level option of babeltrace(1).

       BABELTRACE_TERM_COLOR
           Force the terminal color support. The available values are:

           AUTO
               Only emit terminal color codes when the standard output and
               error streams are connected to a color-capable terminal.

           NEVER
               Never emit terminal color codes.

           ALWAYS
               Always emit terminal color codes.

       BABELTRACE_DISABLE_PYTHON_PLUGINS
           Set to 1 to disable the loading of any Babeltrace Python plugin.

       BABELTRACE_LOGGING_GLOBAL_LEVEL
           Babeltrace library’s global log level. The available values are
           the same as for the --log-level option of babeltrace(1)

       BABELTRACE_NO_DLCLOSE
           Set to 1 to make the Babeltrace library leave any dynamically
           loaded modules (plugins and Python plugin provider) open at exit.
           This can be useful for debugging purposes.

       BABELTRACE_PLUGIN_PATH
           Colon-separated list of directories, in order, in which dynamic
           plugins can be found before other directories are considered.

   Python plugin provider
       BABELTRACE_PYTHON_PLUGIN_PROVIDER_LOG_LEVEL
           Python plugin provider’s log level. The available values are the
           same as for the --log-level option of babeltrace(1).

   CLI
       BABELTRACE_CLI_LOG_LEVEL
           babeltrace CLI’s log level. The available values are the same as
           for the --log-level option.

       BABELTRACE_CLI_WARN_COMMAND_NAME_DIRECTORY_CLASH
           Set to 0 to disable the warning message which babeltrace prints
           when you convert a trace with a relative path that’s also the
           name of a babeltrace command.

FILES         top

       $HOME/.local/lib/babeltrace/plugins
           User plugin directory.

       /usr/local/lib/babeltrace/plugins
           System plugin directory.

EXIT STATUS         top

       0 on success, 1 otherwise.

BUGS         top

       If you encounter any issue or usability problem, please report it on
       the Babeltrace bug tracker (see
       <https://bugs.linuxfoundation.org/buglist.cgi?product=Diamon&component=Babeltrace>).

RESOURCES         top

       The Babeltrace project shares some communication channels with the
       LTTng project (see <http://lttng.org/>).

       ·   Babeltrace website (see <http://diamon.org/babeltrace>)

       ·   Git repository (see
           <http://git.linuxfoundation.org/?p=diamon/babeltrace.git>)

       ·   EfficiOS GitHub organization (see <http://github.com/efficios/>)

       ·   Continuous integration (see
           <https://ci.lttng.org/job/babeltrace_master_build/>)

       ·   Mailing list (see <http://lists.lttng.org>) for support and
           development: lttng-dev@lists.lttng.org

       ·   IRC channel (see <irc://irc.oftc.net/lttng>): #lttng on
           irc.oftc.net

AUTHORS         top

       The Babeltrace project is the result of efforts by many regular
       developers and occasional contributors.

       The current project maintainer is Jérémie Galarneau
       <mailto:jeremie.galarneau@efficios.com>.

COPYRIGHT         top

       This command is part of the Babeltrace project.

       Babeltrace is distributed under the MIT license (see
       <https://opensource.org/licenses/MIT>).

SEE ALSO         top

       babeltrace(1), babeltrace-convert(1), babeltrace-intro(7)

COLOPHON         top

       This page is part of the babeltrace (trace read and write libraries
       and a trace converter) project.  Information about the project can be
       found at ⟨http://www.efficios.com/babeltrace⟩.  If you have a bug
       report for this manual page, send it to lttng-dev@lists.lttng.org.
       This page was obtained from the project's upstream Git repository
       ⟨git://git.efficios.com/babeltrace.git⟩ on 2017-11-25.  (At that
       time, the date of the most recent commit that was found in the repos‐
       itory was 2017-11-23.)  If you discover any rendering problems in
       this HTML version of the page, or you believe there is a better or
       more up-to-date source for the page, or you have corrections or
       improvements to the information in this COLOPHON (which is not part
       of the original manual page), send a mail to man-pages@man7.org

Babeltrace 2.0.0-pre4          5 October 2017              BABELTRACE-RUN(1)

Pages that refer to this page: babeltrace(1)babeltrace-convert(1)babeltrace-intro(7)