BABELTRACE2-RUN(1)
π BABELTRACE2-RUN(1) β the Babeltrace 2 manual, bestie edition π
okay so this is babeltrace2-run from the Babeltrace 2 manual, and it's genuinely one of my faves, no cap π«Ά
β¨ NAME β¨
babeltrace2-run β make a Babeltrace 2 trace processing graph and then, like, run it π
πΈ SYNOPSIS πΈ
babeltrace2 [GENERAL OPTIONS] run [--retry-duration=TIME-US]
[--allowed-mip-versions=VERSION]
--connect=CONN-RULE... COMPONENTS
π¦ DESCRIPTION π¦
The run command creates a Babeltrace 2 trace processing graph and runs it. That's it, that's the vibe. β¨
Go read babeltrace2-intro(7) if you wanna know more about the Babeltrace 2 project and its core concepts β it's giving required reading, lowkey.
The run command dynamically loads Babeltrace 2 plugins which supply component classes. With run, you say which component classes to instantiate as components, and how to connect them together. You're the main character here, fr fr π
The steps to write a babeltrace2 run command line are:
- Specify which component classes to instantiate as components with many
--componentoptions, and how to configure them.
This is the COMPONENTS part of the synopsis. Peep βCreate componentsβ below to learn more.
- Specify how to connect components together with one or more
--connectoptions.
See βConnect componentsβ to learn more.
Note π Thebabeltrace2-convert(1)command is a specialization of theruncommand for the very common case of converting one or more traces: it generates aruncommand line and executes it. You can use its--run-argsor--run-args-0option to make it print the equivalentruncommand line instead. iconic behaviour honestly.
π Create components π
To create a component, use the --component option. This option specifies:
- The name of the component, unique amongst all the component names of the trace processing graph.
- The type of the component class to instantiate:
source,filter, orsink. - The name of the plugin in which to find the component class to instantiate.
- The name of the component class to instantiate.
Use the --component option multiple times to create multiple components. You can instantiate the same component class multiple times as different components β go off, honestly π
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). yes bestie, the spotlight moves, that's just how it is.
The --params=PARAMS option adds parameters to the initialization parameters of the current component. If PARAMS contains a key which exists in the initialization parameters of the current component, then this parameter is replaced. not merged, not vibed with β replaced. π
π Connect components π
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β Upstream component name pattern.UP-PORT-PATβ Upstream (output) port name pattern.DOWN-COMP-PATβ Downstream component name pattern.DOWN-PORT-PATβ Downstream (input) 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 (--connect options, in order):
If the component name of the output port matches UP-COMP-PAT and the
output port 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 \. β οΈ don't sleep on those backslashes, bestie.
When you don't specify UP-PORT-PAT or DOWN-PORT-PAT, they're 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:
- Any output port of which the name starts with
outof componentAto the first input port of which the name starts withinof componentB. - Any other output port of component
Ato the first available input port of componentB. - Any other output port (of any component except
A) to the first available input port of componentC.
The run command fails when it cannot find an input port to which to connect a given output port using the provided connection rules. it's giving "no match found" and it's not shy about it π
See βEXAMPLESβ for more examples. π
β¨ OPTIONS β¨
okay bestie, this is the part where you actually get to drive π every single flag, default, and value, all of it, no skips.
π General π
these ones go before the command name, like a lil pre-game ritual. see babeltrace2(1) for the full tea.
-d,--debugβ legacy option, lowkey just--log-level=TRACEwearing a lil hat.-l LVL,--log-level=LVLβ crank the log level of every known Babeltrace 2 logger toLVL. all of them. at once. iconic.--omit-home-plugin-pathβ don't go looking for plugins in$HOME/.local/lib/babeltrace2/plugins. leave that folder alone fr.--omit-system-plugin-pathβ don't go looking for plugins in/usr/local/lib/babeltrace2/pluginseither. not today.--plugin-path=PATH[:PATH]...β addPATHto the list of places we hunt for plugins. stack as many as you want.-v,--verboseβ legacy option, and it's giving--log-level=INFO.
π¦ Component creation π¦
peep "Create components" for the deep lore β¨
-b PARAMS,--base-params=PARAMSβ set the current base parameters toPARAMS.
you can wipe the current base parameters back to nothing with the --reset-base-params option.
for how PARAMS is formatted, check the --params option below π
-c NAME:COMP-CLS-TYPE.PLUGIN-NAME.COMP-CLS-NAME,--component=NAME:COMP-CLS-TYPE.PLUGIN-NAME.COMP-CLS-NAMEβ make a component calledNAMEfrom the component class of typeCOMP-CLS-TYPEnamedCOMP-CLS-NAME, living inside the plugin namedPLUGIN-NAME, and make it the current component. main character behavior.
the values you can use for TYPE are:
source,srcβ source component class.filter,fltβ filter component class.sinkβ sink component class.
this component's initial initialization parameters get copied from the current base initialization parameters (that's the --base-params option up there).
-l LVL,--log-level=LVLβ set the log level of the current component toLVL.
the values you can use for LVL are:
NONE,Nβ logging? off. disabled. gone.FATAL,Fβ severe errors that make execution abort immediately.
this level should be enabled in production. yes really.
ERROR,Eβ errors that might still let execution keep going.
usually, once one or more errors get reported at this level, the application, plugin, or library won't do anything more useful β but it should still exit cleanly.
this level should be enabled in production.
WARN,WARNING,Wβ unexpected situations that still let execution continue.
this level should be enabled in production.
INFO,Iβ informational messages that highlight progress or important states of the application, plugins, or library.
this level can be enabled in production.
DEBUG,Dβ debugging info, with a higher level of detail than theTRACElevel.
this level should NOT be enabled in production. not even a little.
TRACE,Tβ low-level debugging context info.
this level should NOT be enabled in production. periodt.
-p PARAMS,--params=PARAMSβ addPARAMSto the initialization parameters of the current component.
if PARAMS has a key that already exists in the current component's initialization parameters, the parameter gets replaced. no duplicates allowed, we're not doing that.
the format of PARAMS is a comma-separated list of NAME=VALUE assignments:
NAME=VALUE[,NAME=VALUE]...
NAMEβ parameter name (a C identifier, plus the:,., and-characters).VALUEβ one of:null,nul,NULL: a null value.true,TRUE,yes,YES: a true boolean value.false,FALSE,no,NO: a false boolean value.- binary (
0bprefix), octal (0prefix), decimal, or hexadecimal (0xprefix) unsigned (with+prefix) or signed 64-bit integer. - double precision floating point number (scientific notation is accepted, slay).
- unquoted string with no special characters, and not matching any of the null and boolean value symbols above.
- double-quoted string (accepts escape characters).
- array, formatted as an opening
[, a comma-separated list ofVALUE, and a closing]. - map, formatted as an opening
{, a comma-separated list ofNAME=VALUEassignments, and a closing}.
you may put whitespaces around the individual = (assignment), , (separator), [ (array beginning), ] (array end), { (map beginning), and } (map end) characters. go off.
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}'
Important β just like the example above, make sure you single-quote the whole argument when you run this from a shell, because it can absolutely contain a ton of special characters. protect it bestie π«Ά
-r,--reset-base-paramsβ reset the current base parameters. clean slate energy.
you can set the current base parameters with the --base-params option.
π Component connection π
-x CONN-RULE,--connect=CONN-RULEβ add the connection ruleCONN-RULE.
the format of CONN-RULE is:
UP-COMP-PAT[.UP-PORT-PAT]:DOWN-COMP-PAT[.DOWN-PORT-PAT]
UP-COMP-PATβ upstream component name pattern.UP-PORT-PATβ upstream (output) port name pattern.DOWN-COMP-PATβ downstream component name pattern.DOWN-PORT-PATβ downstream (input) port name pattern.
see "Connect components" to learn more π
β Graph configuration β
-m VERSION,--allowed-mip-versions=VERSIONβ only let the graph honour versionVERSION(0or1) of the Message Interchange Protocol (MIP), instead of allowing both versions. pick a lane.--retry-duration=TIME-USβ set the duration of a single retry toTIME-USΒ΅s for when a sink component reports "try again later" (busy network or file system, for example). we wait, we try again, we slay.
default: 100000 (100 ms).
π Command information π
-h,--helpβ show the command help and quit. the "just tell me what to do" button.
π EXAMPLES π
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 initialization parameters of the current component.
in this example, the --params option only applies to component the-source. it's loyal like that.
$ 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 β
offset=1203, flag=false - Component B β
offset=1203, flag=true, type=event - Component C β
ratio=0.25
$ 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 whose name starts with foo gets connected to a B input port whose name starts with nin. any other A output port gets connected to a B input port whose name starts with oth.
the order of the --connect options matters here bestie, this is the whole plot twist: the opposite order would create a system where the first rule is always satisfied, and any A output port β whatever its name β would get connected to a B input port with a name starting 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 |
+-----------------+ +-------------------+
β¨ ENVIRONMENT VARIABLES β¨
ok so the vibes are configurable, bestie π these env vars are how you whisper sweet nothings to the Babeltrace 2 library, the Python bindings, and the CLI. they're grouped by who listens to them π
πΈ Babeltrace 2 library
BABELTRACE_EXEC_ON_ABORT=CMDLINEβ run the command lineCMDLINEwhen literally any part of the Babeltrace 2 project unexpectedly aborts. it gets parsed like a UNIX 98 shell would parse it, no cap. the app only actually aborts when the command you ran returns β and it fully ignores that command's exit status, so don't come for it about return codes π
β οΈ this variable is straight-up ignored when the application has the setuid or setgid access right flag set. security said no π
BABELTRACE_TERM_COLOR=(AUTO | NEVER | ALWAYS)β forces the terminal color support for thebabeltrace2(1)program and the project plugins. yes queen, you can override the vibes π
the available values are:
AUTOβ only emit terminal color codes when the standard output and error streams are connected to a color-capable terminal. it reads the room first πNEVERβ never emit terminal color codes. monochrome era πALWAYSβ always emit terminal color codes. colorful even when nobody asked, iconic behavior β¨
BABELTRACE_TERM_COLOR_BRIGHT_MEANS_BOLD=0β set this to0to emit SGR codes90to97for bright colors (SGR = those ANSI escape code guys, see <https://en.wikipedia.org/wiki/ANSI_escape_code>) instead of doing the bold thing (SGR code1) plus standard color codes (SGR codes30to37). it's giving "choose your fighter" π₯BABELTRACE_PLUGIN_PATH=PATHSβ sets the list of directories, in order, where dynamic plugins can be found before any other directories are considered, toPATHS. the separator is a colon (or a semicolon on Windows, because of course πͺ).LIBBABELTRACE2_DISABLE_PYTHON_PLUGINS=1β disables the loading of any Babeltrace 2 Python plugin. python girlies sit this one out ππ«LIBBABELTRACE2_INIT_LOG_LEVEL=LVLβ forces the initial log level of the Babeltrace 2 library to beLVL. if this env var is set, it overrides the log level set by the--log-leveloption for the Babeltrace 2 library logger. env var said "I'm the main character now" π
the available values for LVL are:
NONE,Nβ logging is disabled. silence, but make it chic π€«FATAL,Fβ severe errors that lead the execution to abort immediately. this level should be enabled in production. very much "this is fine but also everything is on fire" π₯ERROR,Eβ errors that might still allow the execution to continue. 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. we love a graceful exit πWARN,WARNING,Wβ unexpected situations which still allow the execution to continue. this level should be enabled in production. "not ideal but we move" energy π«ΆINFO,Iβ informational messages that highlight progress or important states of the application, plugins, or library. this level can be enabled in production. cute little progress updates β¨DEBUG,Dβ debugging information, with a higher level of details than theTRACElevel. this level should NOT be enabled in production. it's a lot π«£TRACE,Tβ low-level debugging context information. this level should NOT be enabled in production. the most extra level, fr fr π
LIBBABELTRACE2_NO_DLCLOSE=1β makes the Babeltrace 2 library leave any dynamically loaded modules (plugins and plugin providers) open at exit. this can be useful for debugging purposes. it's like never leaving the group chat, for science π§ͺLIBBABELTRACE2_PLUGIN_PROVIDER_DIR=DIRβ sets the directory from which the Babeltrace 2 library dynamically loads plugin provider shared objects toDIR. if this env var is set, it overrides the default plugin provider directory. moving day π
π¦ Babeltrace 2 Python bindings
BABELTRACE_PYTHON_BT2_LOG_LEVEL=LVLβ forces the Babeltrace 2 Python bindings log level to beLVL. if this env var is set, it overrides the log level set by the--log-leveloption for the Python bindings logger. python gets its own volume knob ποΈ
the available values for LVL are:
NONE,Nβ logging is disabled. β¨FATAL,Fβ severe errors that lead the execution to abort immediately. this level should be enabled in production. πERROR,Eβ errors that might still allow the execution to continue. 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β unexpected situations which still allow the execution to continue. this level should be enabled in production. π«ΆINFO,Iβ informational messages that highlight progress or important states of the application, plugins, or library. this level can be enabled in production. β¨DEBUG,Dβ debugging information, with a higher level of details than theTRACElevel. this level should NOT be enabled in production. π«£TRACE,Tβ low-level debugging context information. this level should NOT be enabled in production. π
π CLI
BABELTRACE_CLI_LOG_LEVEL=LVLβ forces the log level of the log level babeltrace2 CLI to beLVL. if this env var is set, it overrides the log level set by the--log-leveloption for the CLI logger. yes, the CLI gets its own too π
the available values for LVL are:
NONE,Nβ logging is disabled. β¨FATAL,Fβ severe errors that lead the execution to abort immediately. this level should be enabled in production. πERROR,Eβ errors that might still allow the execution to continue. 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β unexpected situations which still allow the execution to continue. this level should be enabled in production. π«ΆINFO,Iβ informational messages that highlight progress or important states of the application, plugins, or library. this level can be enabled in production. β¨DEBUG,Dβ debugging information, with a higher level of details than theTRACElevel. this level should NOT be enabled in production. π«£TRACE,Tβ low-level debugging context information. this level should NOT be enabled in production. π
BABELTRACE_CLI_WARN_COMMAND_NAME_DIRECTORY_CLASH=0β disables the warning message thatbabeltrace2-convert(1)prints when you convert a trace with a relative path that's also the name of a babeltrace2 command. yeah that collision is real and it's annoying, this shuts it up πBABELTRACE_DEBUG=1β legacy variable: equivalent to setting the--log-leveloption toTRACE. it's giving old money, throwback vibes π°οΈBABELTRACE_VERBOSE=1β legacy variable: equivalent to setting the--log-leveloption toINFO. also vintage, also valid π
π FILES π
$HOME/.local/lib/babeltrace2/pluginsβ user plugin directory. your personal stash π«Ά/usr/local/lib/babeltrace2/pluginsβ system plugin directory. the shared one π/usr/local/lib/babeltrace2/plugin-providersβ system plugin provider directory. where the providers hang out β¨
πͺ EXIT STATUS πͺ
0 on success, 1 otherwise.
that's it, that's the whole personality. either you ate or you didn't π
π BUGS π
if you encounter any issue or usability problem, please report it on the Babeltrace bug tracker (see <https://bugs.lttng.org/projects/babeltrace>). don't suffer in silence bestie, tell the maintainers, they want to know, fr fr π«Ά
π RESOURCES π
the Babeltrace project shares some communication channels with the LTTng project (see <https://lttng.org/>). yes, they're mutuals π€
- Babeltrace website (see <https://babeltrace.org/>) π
- Mailing list (see <https://lists.lttng.org>) for support and development:
lttng-dev@lists.lttng.orgπ§ - IRC channel (see <irc://irc.oftc.net/lttng>):
#lttngonirc.oftc.netπ¬ - Bug tracker (see <https://bugs.lttng.org/projects/babeltrace>) π
- Git repository (see <https://git.efficios.com/?p=babeltrace.git>) π³
- GitHub project (see <https://github.com/efficios/babeltrace>) π
- Continuous integration (see <https://ci.lttng.org/view/Babeltrace/>) βοΈ
- Code review (see <https://review.lttng.org/q/project:babeltrace>) π
π AUTHORS π
the Babeltrace 2 project is the result of hard work by many regular developers and occasional contributors. every single one of them ate, no crumbs left π«Ά
the current project maintainer is JΓ©rΓ©mie Galarneau <mailto:jeremie.galarneau@efficios.com>. say hi, he's the main character rn π
βοΈ COPYRIGHT βοΈ
this command is part of the Babeltrace 2 project.
Babeltrace is distributed under the MIT license (see <https://opensource.org/licenses/MIT>). free as in "go off, do your thing" β¨
π SEE ALSO π
babeltrace2-intro(7), babeltrace2(1), babeltrace2-convert(1)
go read those too, they're the rest of the lore π
and that's the whole page, bestie!! π this was Babeltrace 2.1.2, dated 14 September 2019, and it's the BABELTRACE2-RUN(1) manual β you're officially a Babeltrace 2 girlie now, go convert some traces πβ¨
π¦ where this page comes from
- fedora 43: babeltrace2 2.1.2-3.fc43 Β· MIT AND GPL-2.0-only
- fedora 44: babeltrace2 2.1.2-5.fc44 Β· MIT AND GPL-2.0-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms