BABELTRACE2-CONVERT(1)
π¦ babeltrace2-convert π¦
part of the Babeltrace 2 manual
πΈ NAME πΈ
babeltrace2-convert β bestie, this is the glow-up machine: it takes one or more traces and converts them to a given format. π
β¨ SYNOPSIS β¨
Okay so there's a whole handful of ways to call this, and each one is a different vibe. Sit with me:
Pretty-print (plain text) the events, in order, of one or more traces:
babeltrace2 [GENERAL OPTIONS] [convert] [--retry-duration=TIME-US]
[--allowed-mip-versions=VERSION] TRACE-PATH...
Convert one or more traces to a given format:
babeltrace2 [GENERAL OPTIONS] [convert] [--retry-duration=TIME-US]
[--allowed-mip-versions=VERSION] CONVERSION ARGS
Get the equivalent babeltrace2-run(1) command arguments to convert one or more traces to a given format:
babeltrace2 [GENERAL OPTIONS] [convert] [--retry-duration=TIME-US]
[--allowed-mip-versions=VERSION]
(--run-args | --run-args-0) CONVERSION ARGS
Print the metadata text of a CTF trace:
babeltrace2 [GENERAL OPTIONS] [convert] [--output=OUTPATH]
--output-format=ctf-metadata TRACE-PATH
Print the available remote LTTng tracing sessions (the docs live over at <https://lttng.org/docs/#doc-lttng-live>, iykyk):
babeltrace2 [GENERAL OPTIONS] [convert] [--output=OUTPATH]
--input-format=lttng-live URL
π DESCRIPTION π
The convert command takes one or more traces and converts them to a given format β and lowkey, it can run filters along the conversion path too. Filters in the middle? Iconic behavior.
Go read babeltrace2-intro(7) if you wanna learn more about the Babeltrace 2 project and its core concepts. π«Ά
Note πconvertis the defaultbabeltrace2(1)command, so most of the time you don't even have to say its name out loud. These two are literally equivalent β as long as the...part doesn't start with the name of anotherbabeltrace2(1)command, likerunorlist-plugins:$ babeltrace2 convert ... $ babeltrace2 ...But if you need to be 100% sure you're running theconvertcommand? Then writebabeltrace2 convertexplicitly. No cap. π
More specifically, the convert command creates a conversion graph.
A conversion graph is a specialized trace processing graph focused on the conversion of one or more traces to another format, possibly filtering or modifying their events and other messages in the process. Once the source streams are merged, a conversion graph is a linear chain of components:
+----------+
| source 1 @-.
+----------+ |
| +-------+
+----------+ '->@ | +---------+ +------------+
| source 2 @--->@ muxer @--->@ trimmer @--->@ debug-info @-.
+----------+ .->@ | +---------+ +------------+ |
| +-------+ |
+----------+ | .----------------------------------------'
| ... @-' | +---------------+ +------+
+----------+ '->@ other filters |--->@ sink |
+---------------+ +------+
Note that the trimmer, the debugging information, and the other filters are optional. See "Create implicit components from options" to learn how to turn them on. β¨
If you need a different trace processing graph layout, then go use the more flexible babeltrace2-run(1) command instead.
Like with the babeltrace2-run(1) command, you can create components explicitly with the --component option (see "Create explicit components"). You can also use one of the many specific convert command options (see "Create implicit components from options") and non-option arguments (see "Create implicit components from non-option arguments") to create implicit components.
An implicit component is a component which is created and added to the conversion graph without an explicit instantiation through the --component option. An implicit component is easier to create than an explicit component β that's literally the whole reason the convert command exists, because you can also create and run a conversion graph with the generic babeltrace2-run(1) command. π
For example, you can specify one or more CTF trace paths as non-option arguments to pretty-print the merged events to the standard output:
$ babeltrace2 /path/to/trace /path/to/other/trace
That is the equivalent of creating and connecting together:
- One
source.ctf.fscomponents with itsinputsinitialization parameter set to/path/to/trace. - One
source.ctf.fscomponents with itsinputsinitialization parameter set to/path/to/other/trace. - A
filter.utils.muxercomponent. - A
sink.text.prettycomponent.
Which creates this conversion graph:
+------------+ +-----------------+ +------------------+
| src.ctf.fs | | flt.utils.muxer | | sink.text.pretty |
| [ctf-fs] | | [muxer] | | [pretty] |
| | | | | |
| stream0 @--->@ in0 out @--->@ in |
| stream1 @--->@ in1 | +------------------+
| stream2 @--->@ in2 |
| stream3 @--->@ in3 |
+------------+ | |
| |
+------------+ | |
| src.ctf.fs | | |
| [ctf-fs-2] | | |
| | | |
| stream0 @--->@ in4 |
| stream1 @--->@ in5 |
+------------+ @ in6 |
+-----------------+
And it's equivalent to this babeltrace2-run(1) command line:
$ babeltrace2 run --component=ctf-fs:src.ctf.fs \
--params='inputs=["/path/to/trace"] \
--component=ctf-fs-2:src.ctf.fs \
--params='inputs=["/path/to/other/trace"] \
--component=muxer:filter.utils.muxer \
--component=pretty:sink.text.pretty \
--connect=ctf*:muxer --connect=muxer:pretty
You can use the --run-args option to make the convert command print its equivalent run command arguments instead of creating and running the conversion graph. The printed arguments are escaped for shells, which means you can use them as-is on the command line and possibly add more options to the run command:
$ babeltrace2 run $(babeltrace2 --run-args /path/to/trace) ...
The --run-args-0 option is like the --run-args option, except the printed arguments are NOT escaped and they're separated by a null character instead of a space. Super useful when the resulting arguments aren't the direct input of a shell β for example, if you're passing them to xargs -0. π§
See "EXAMPLES" for usage examples.
π Create explicit components π
To explicitly create a component, use the --component option. This option specifies:
- Optional: The name of the component.
- 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.
You can use the --component option multiple times to create multiple components, and you can instantiate the same component class multiple times as different component instances. Slay. π
Immediately following a --component option on the command line, the created component is known as the current component (until the next --component option or non-option argument).
The following command-line options apply to the current component:
--log-level=LVLβ Set the log level of the current component toLVL.--params=PARAMSβ AddPARAMSto the initialization parameters of the current component. IfPARAMScontains a key which exists in the initialization parameters of the current component, then replace the parameter.
See "EXAMPLES" for usage examples.
π Create implicit components from non-option arguments π
When you specify a non-option argument to the convert command, it tries to find one or more components which can handle that argument. It's giving matchmaker energy fr fr. π
For example, with this command line:
$ babeltrace2 /path/to/trace
If /path/to/trace is a CTF trace directory, then the convert command creates a source.ctf.fs component to handle this specific trace.
This automatic source component discovery mechanism is possible thanks to component classes which support the babeltrace.support-info query object (see babeltrace2-query-babeltrace.support-info(7)).
The non-option argument can also be a directory. If no component can handle that specific directory, then the convert command traverses that directory and recursively tries to find compatible components for each file and subdirectory. Which means a single non-option argument can lead to the creation of many implicit components. The way that one little argument can just spawn a whole squadβ¦ π
The following command-line options apply to ALL the implicit components created from the last non-option argument:
--log-level=LVLβ Set the log level of those implicit components toLVL.--params=PARAMSβ AddPARAMSto the initialization parameters of those implicit components. For a given implicit component, ifPARAMScontains a key which exists in the initialization parameters of this component, then replace the parameter.
Note that it's also possible for two non-option arguments to cause the creation of a single implicit component. For example, if you specify:
$ babeltrace2 /path/to/chunk1 /path/to/chunk2
where /path/to/chunk1 and /path/to/chunk2 are paths to chunks of the same logical CTF trace, then the convert command creates a single source.ctf.fs component which receives both paths at initialization time. When this happens, any --log-level or --params option that you specify to one of them applies to that single implicit component. For example:
$ babeltrace2 /path/to/chunk1 --params=clock-class-offset-s=450 \
/path/to/chunk2 --params=clock-class-offset-ns=98 \
--log-level=INFO
Here, the single implicit component gets both the clock-class-offset-s and clock-class-offset-ns initialization parameters, plus the INFO log level. Look at them sharing. π«Ά
For backward compatibility with thebabeltrace(1)program, theconvertcommand ignores any non-option argument which does not cause the creation of any component. In that case, it emits a warning log statement and continues.
π Create implicit components from options π
There are many ways to create implicit components from options with the convert command:
- To create an implicit
filter.utils.trimmercomponent (stream trimmer), specify the--begin,--end, or--timerangeoption.
Examples:
$ babeltrace2 /path/to/trace --begin=22:14:38 --end=22:15:07
$ babeltrace2 /path/to/trace --timerange=22:14:38,22:15:07
$ babeltrace2 /path/to/trace --end=12:31:04.882928015
- to make an implicit
filter.lttng-utils.debug-info(that's the one that sprinkles debugging info onto compatible LTTng events, bestie β¨), just pass any of--debug-info,--debug-info-dir,--debug-info-full-path, or--debug-info-target-prefix. Any one of them. It's giving choose-your-own-adventure π
Examples, since examples are the moment:
$ babeltrace2 /path/to/trace --debug-info
$ babeltrace2 /path/to/trace \
--debug-info-target-prefix=/tmp/tgt-root
$ babeltrace2 /path/to/trace --debug-info-full-path
- to make an implicit
sink.text.prettycomponent (pretty text output going to stdout or to a file, iconic behavior honestly π), you specify no other sink components at all, explicit or implicit.
Like, the implicit sink.text.pretty component is just there by default, main character energy. But the second any other explicit or implicit sink component shows up, the convert command stops auto-creating it. Not me gatekeeping pretty output but okay π«Ά
The --clock-cycles, --clock-date, --clock-gmt, --clock-seconds, --color, --fields, --names, and --no-delta options all apply to the implicit sink.text.pretty component. Every single one, no cap.
And --output without --output-format=ctf makes the implicit sink.text.pretty component write its content to a file β except the warnings for backward compatibility with the babeltrace(1) program. Yeah. Those stay warning-ing. iykyk.
Examples:
$ babeltrace2 /path/to/trace
$ babeltrace2 /path/to/trace --no-delta
$ babeltrace2 /path/to/trace --output=/tmp/pretty-out
- to make an implicit
sink.utils.dummycomponent (which produces, and I cannot stress this enough, no output whatsoever π), you pass--output-format=dummy.
Example:
$ babeltrace2 /path/to/trace --output-format=dummy
- to make an implicit
sink.ctf.fscomponent (that's CTF traces written out to the file system, we love a glow-up πΈ), you pass--output-format=ctfand--output=DIRwhere DIR is the base output directory.
Example:
$ babeltrace2 /path/to/input/trace --output-format=ctf \
--output=my-traces
Now, as of this version, a sink.ctf.fs component generates CTF 2 traces by default (peep <https://diamon.org/ctf/>). If you're out here wanting CTF 1.8 instead (see <https://diamon.org/ctf/v1.8.3/>), you gotta create an explicit sink.ctf.fs component β scroll down to βCreate explicit componentsβ β and use the ctf-version="1" initialization parameter:
$ babeltrace2 /path/to/input/trace --component=sink.ctf.fs \
--params='path="my-traces",ctf-version="1"'
You can absolutely combine multiple methods to create multiple implicit components at once. Like, the multitasking is real. For example, trim an LTTng (CTF) trace, add debugging information to it, and write it out as another CTF trace, all in one lil line:
$ babeltrace2 /path/to/input/trace --timerange=22:14:38,22:15:07 \
--debug-info --output-format=ctf --output=out-dir
The equivalent babeltrace2-run(1) command of this convert command is:
$ babeltrace2 run --component=auto-disc-source-ctf-fs:source.ctf.fs \
--params='inputs=["/path/to/input/trace"]' \
--component=sink-ctf-fs:sink.ctf.fs \
--params='path="out-dir"' \
--component=muxer:filter.utils.muxer \
--component=trimmer:filter.utils.trimmer \
--params='begin="22:14:38"' \
--params='end="22:15:07"' \
--component=debug-info:filter.lttng-utils.debug-info \
--connect=auto-disc-source-ctf-fs:muxer \
--connect=muxer:trimmer \
--connect=trimmer:debug-info \
--connect=debug-info:sink-ctf-fs
The order of the implicit component options documented in this subsection isnβt significant. So don't stress about sequencing, bestie. It doesn't matter π
See βEXAMPLESβ for more examples. (There are so many more.)
β¨ OPTIONS β¨
π General π
You can use those options before the command name. Yep, before. Front-loaded.
See babeltrace2(1) for more details.
-d,--debugβ Legacy option, bestie: this is equivalent to--log-level=TRACE.-lLVL,--log-level=LVL β Set the log level of all known Babeltrace 2 loggers to LVL.--omit-home-plugin-pathβ Donβt search for plugins in$HOME/.local/lib/babeltrace2/plugins.--omit-system-plugin-pathβ Donβt search for plugins in/usr/local/lib/babeltrace2/plugins.--plugin-path=PATH[:PATH]...β Add PATH to the list of paths in which plugins can be found.-v,--verboseβ Legacy option: this is equivalent to--log-level=INFO.
π¦ Explicit component creation π¦
See βCreate explicit componentsβ to learn how to use the following option.
-c[NAME:]COMP-CLS-TYPE.PLUGIN-NAME.COMP-CLS-NAME,--component=[NAME:]COMP-CLS-TYPE.PLUGIN-NAME.COMP-CLS-NAME β Create a component named NAME (if you specified one, that is) from the component class of type COMP-CLS-TYPE named COMP-CLS-NAME found in the plugin named PLUGIN-NAME, and set it as the current component. π
The available values for COMP-CLS-TYPE are:
source,srcβ Source component class.filter,fltβ Filter component class.sinkβ Sink component class.
π§ Common component creation π§
See βCreate explicit componentsβ and βCreate implicit components from non-option argumentsβ to learn how to use the following options.
These options apply to either the current explicit component (that's the last --component option) or to ALL the implicit components created from the last non-option argument. Both. Yes. It's giving versatile.
-lLVL,--log-level=LVL β Set the log level of the current component(s) to LVL.
The available values for LVL are:
NONE,Nβ Logging is disabled. Radio silence π«₯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. (So like, it's done, but it leaves politely.)
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. Ma'am. Please.
TRACE,Tβ Low-level debugging context information.
This level should NOT be enabled in production. Fr fr.
-pPARAMS,--params=PARAMS β Add PARAMS to the initialization parameters of the current component(s).
If PARAMS contains a key which already exists in the initialization parameters of the current component(s), then replace the parameter. Out with the old, in with the new π
The format of PARAMS 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 (
0bprefix), octal (0prefix), decimal, or hexadecimal (0xprefix) unsigned (with+prefix) or 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).
- Array, formatted as an opening
[, a comma-separated list of VALUE, 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. Live your life, add the spaces πΈ
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 β Like in the example above, make sure to single-quote the whole argument when you run this command from a shell, because it can contain so many special characters. Protect your lil string, bestie π«Ά
π Legacy options to create implicit components π
-iFORMAT,--input-format=FORMAT β Force theconvertcommand to create components from a specific component class for non-option arguments (see βCreate implicit components from non-option argumentsβ), or list available remote LTTng tracing sessions.
The available values for FORMAT are:
ctfβ Use thesource.ctf.fscomponent class.
Each non-option argument of the command line is a CTF trace or CTF trace chunk.
See babeltrace2-source.ctf.fs(7) to learn more about this component class.
lttng-liveβ Depending on the format of the first non-option argument:net[4]://RDHOST[:RDPORT]β List the available remote LTTng tracing sessions for the LTTng relay daemon at the address RDHOST and port RDPORT (5344if not specified), and then exit. That's it. List and dip πnet[4]://RDHOST[:RDPORT]/host/TGTHOST/SESSIONβ Use thesource.ctf.lttng-livecomponent class.
See babeltrace2-source.ctf.lttng-live(7) to learn more about this component class and the URL format.
You can specify at most one --input-format option. One. Uno. Don't push it π
-oFORMAT,--output-format=FORMAT β Create an implicit sink component with format FORMAT, or print the metadata text of a CTF trace.
The available values for FORMAT are:
textβ Create an implicitsink.text.prettycomponent.
See βImplicit sink.text.pretty componentβ.
See babeltrace2-sink.text.pretty(7) to learn more about this component class.
ctfβ Create an implicitsink.ctf.fscomponent. Specify the base output path with the--outputoption.
As of this version, a sink.ctf.fs component generates CTF 2 traces by default (peep https://diamon.org/ctf/ for the deets). Wanna write CTF 1.8 instead (that's https://diamon.org/ctf/v1.8.3/)? Then you gotta make an explicit sink.ctf.fs component (scroll to βCreate explicit componentsβ) and hand it the ctf-version="1" initialization parameter. Periodt. π
Go read babeltrace2-sink.ctf.fs(7) to learn more about this component class, bestie. β¨
dummy
Creates an implicit sink.utils.dummy component.
See babeltrace2-sink.utils.dummy(7) to learn more about this component class. π¦
ctf-metadata
Prints the metadata text of a CTF trace and dips. π«Ά
The first non-option argument is the path to the CTF trace.
You can specify at most one --output-format option. Not two. Not three. One. π
Implicit source.ctf.fs component(s)
See babeltrace2-source.ctf.fs(7) to learn more about this component class. π
--clock-force-correlateβ Sets theforce-clock-class-origin-unix-epochinitialization parameter of all the implicitsource.ctf.fscomponents totrue.
That force-clock-class-origin-unix-epoch parameter makes every clock class it creates have a Unix epoch origin. Super useful when you need the clock classes of multiple traces to be compatible even when they're lowkey not compatible on their own. π«
--clock-offset=SECβ Sets theclock-class-offset-sinitialization parameter of all the implicitsource.ctf.fscomponents toSEC.
The clock-class-offset-s parameter adds SEC seconds to the offsets of all the clock classes that the component creates. β°
You can combine this option with --clock-offset-ns.
--clock-offset-ns=NSβ Sets theclock-class-offset-nsinitialization parameter of all the implicitsource.ctf.fscomponents toNS.
The clock-class-offset-ns parameter adds NS nanoseconds to the offsets of all the clock classes that the component creates. β¨
You can combine this option with --clock-offset-s.
Implicit filter.utils.trimmer component
If you specify at least one of the following options, boom, you've created an implicit filter.utils.trimmer component. π
See babeltrace2-filter.utils.trimmer(7) to learn more about this component class.
--begin=TIMEβ Sets thebegininitialization parameter of the component toTIME.
You cannot use this option with the --timerange option. Pick a lane bestie π€
The format of TIME is one of:
YYYY-MM-DD HH:II[:SS[.NANO]]
HH:II[:SS[.NANO]]
[-]SEC[.NANO]
YYYYβ 4-digit year.MMβ 2-digit month (January is01, because we count like normal people π ).DDβ 2-digit day.HHβ 2-digit hour (24-hour format).IIβ 2-digit minute.SSβ 2-digit second.NANOβ Nanoseconds (up to nine digits).SECβ Seconds since origin.
--end=TIMEβ Sets theendinitialization parameter of the component toTIME.
You cannot use this option with the --timerange option.
See the --begin option for the format of TIME. π
--timerange=BEGIN,ENDβ Equivalent to--begin=BEGINand--end=END. Two birds, one flag, slay. π¦
You can also surround the whole argument with [ and ].
Implicit filter.lttng-utils.debug-info component
If you specify at least one of the following options, you create an implicit filter.lttng-utils.debug-info component. Heads up: this component only alters compatible LTTng events. π§
See babeltrace2-filter.lttng-utils.debug-info(7) to learn more about this component class.
--debug-infoβ Creates an implicitfilter.lttng-utils.debug-infocomponent.
This option is useless if you specify any of the options below. Like, don't even bother. π
--debug-info-dir=DIRβ Sets thedebug-info-dirinitialization parameter of the component toDIR.
The debug-info-dir parameter tells the component where to go hunting for the debugging information it needs when it's not chilling inside the actual executable files. π
--debug-info-full-pathβ Sets thefull-pathinitialization parameter of the component totrue.
When the full-path parameter is true, the component writes the full (absolute) paths to files in its debugging information fields instead of just the short names. No more mystery meat paths. β¨
--debug-info-target-prefix=PREFIXβ Sets thetarget-prefixinitialization parameter of the component toPREFIX.
The target-prefix parameter is a path to prepend to the paths to executables recorded in the trace. For example, if a trace contains the executable path /usr/bin/ls in its state dump events, and you specify --debug-info-target-prefix=/home/user/boards/xyz/root, then the component opens the /home/user/boards/xyz/root/usr/bin/ls file to find debugging information. Obsessed with a good prefix. π
Implicit sink.text.pretty component
If you specify at least one of the following options, then you force the sink component of the convert command to be an implicit sink.text.pretty component.
See babeltrace2-sink.text.pretty(7) to learn more about this component class. πΈ
--clock-cyclesβ Sets theclock-secondsinitialization parameter of the component totrue.
The clock-cycles parameter makes the component print the event time in clock cycles. β±οΈ
Yeah bestie, the original page literally saysclock-secondsright there for--clock-cycles. I'm just the messenger, I don't write the docs, I only vibe with them. π
--clock-dateβ Sets theclock-dateinitialization parameter of the component totrue.
The clock-date parameter makes the component print the date and the time of events. π
--clock-gmtβ Sets theclock-gmtinitialization parameter of the component totrue.
The clock-gmt parameter makes the component not apply the local timezone to the printed times. GMT girlies rise π
--clock-secondsβ Sets theclock-secondsinitialization parameter of the component totrue.
The clock-seconds parameter makes the component print the event times in seconds since the Unix epoch. β³
--color=WHENβ Sets thecolorinitialization parameter of the component toWHEN.
The available values for WHEN are:
autoβ Only emit terminal color codes when the standard output and error streams are connected to a color-capable terminal. She reads the room. πneverβ Never emit terminal color codes. π«πalwaysβ Always emit terminal color codes. Rainbow mode, no matter what. π
The auto and always values have no effect if the BABELTRACE_TERM_COLOR environment variable is set to NEVER.
--fields=FIELD[,FIELD]...β For eachFIELD, sets thefield-FIELDinitialization parameter of the component totrue.
For example, --fields=trace,loglevel,emf sets the field-trace, field-loglevel, and field-emf initialization parameters to true. π«Ά
The available value for FIELD are:
tracetrace:hostnametrace:domaintrace:procnametrace:vpidloglevelemfcallsite
--names=NAME[,NAME]...β For eachNAME, sets thename-NAMEinitialization parameter of the component totrue.
For example, --names=payload,scope sets the name-payload and name-scope initialization parameters to true. β¨
The available value for NAME are:
payloadcontextscopeheader
--no-deltaβ Sets theno-deltainitialization parameter of the component totrue.
When the no-delta parameter is true, the component doesn't print the duration since the last event on the line. Delta who? Never heard of her. π
Shared options
-w PATH,--output=PATHβ With--output-format=ctf-metadataor--input-format=lttng-live(when printing the available remote LTTng tracing sessions), write the text to the filePATHinstead of the standard output.
When you specify --output-format=ctf, set the path initialization parameter of the implicit sink.ctf.fs component to PATH.
Without any specified sink component β explicit or implicit β force the sink component of the convert command to be an implicit sink.text.pretty component and set its path initialization parameter to PATH.
See babeltrace2-sink.ctf.fs(7) and babeltrace2-sink.text.pretty(7) to learn more about those component classes. π
Equivalent babeltrace2 run arguments
--run-argsβ Prints the equivalentbabeltrace2-run(1)arguments instead of creating and running the conversion graph.
The printed arguments are space-separated and individually escaped for safe shell input. So you can copy-paste without fear. π«Ά
You cannot use this option with the --run-args-0 or --stream-intersection option.
--run-args-0β Prints the equivalentbabeltrace2-run(1)arguments instead of creating and running the conversion graph.
The printed arguments are separated with a null character and NOT escaped for safe shell input. Different vibe, different rules. π
You cannot use this option with the --run-args or --stream-intersection option.
Conversion graph configuration
-m VERSION,--allowed-mip-versions=VERSIONβ Only allows the conversion graph to honour versionVERSION(0or1) of the Message Interchange Protocol (MIP) instead of allowing both versions. Pick one, bestie. π--retry-duration=TIME-USβ Sets the duration of a single retry toTIME-USΒ΅s when a sink component reports βtry again laterβ (busy network or file system, for example). She's patient but not that patient. β°
Default: 100000 (100 ms).
--stream-intersectionβ Enables the stream intersection mode. π₯
In this mode, for each trace, the convert command filters out the events and other messages which aren't in the time range where all the trace streams are active.
To use this option, all the source components, explicit and implicit, must have classes which support the babeltrace.trace-infos query object (see babeltrace2-query-babeltrace.trace-infos(7)). The only component class of the Babeltrace 2 project which supports this query object is source.ctf.fs. That's the whole guest list. π
You cannot use this option with the --run-args or --run-args-0 option.
Other legacy options
The following options exist for backward compatibility with the babeltrace(1) program. Ancient artifacts, but make no mistake, they still hit. πΊβ¨
-d,--debugβ Legacy option: this is equivalent to--log-level=TRACE, where--log-levelis the general option (not the--log-leveloption of this command). Yes, the naming is giving chaos. π-v,--verboseβ Legacy option: this is equivalent to--log-level=INFO, where--log-levelis the general option (not the--log-leveloption of this command).
This option also sets the verbose parameter of the implicit sink.text.pretty component (see babeltrace2-sink.text.pretty(7)) to true. π£οΈ
Command information
-h,--helpβ Shows the command help and quits. Your lil cheat sheet, bestie. π
Example 1. Pretty-print the events, in order, of one or more CTF traces. π
No args, no stress β just hand it your trace(s) and it spills every event in order. One trace, the same trace twice, or a whole lil squad of them:
$ babeltrace2 my-ctf-traces
$ babeltrace2 my-ctf-traces
$ babeltrace2 my-ctf-trace-1 my-ctf-trace-2 my-ctf-trace-3
Example 2. Trim a CTF trace and pretty-print the events. βοΈ
Give it a --begin, an --end, both, or a --timerange β whatever vibe you're on:
$ babeltrace2 my-ctf-trace --begin=22:55:43.658582931 \
--end=22:55:46.967687564
$ babeltrace2 my-trace --begin=22:55:43.658582931
$ babeltrace2 my-trace --end=22:55:46.967687564
$ babeltrace2 my-trace --timerange=22:55:43,22:55:46.967687564
Example 3. Trim a CTF trace, enable the stream intersection mode, and write a CTF trace. π₯
Trim it, flip on --stream-intersection, then write the whole thing back out as CTF:
$ babeltrace2 my-ctf-trace --stream-intersection \
--timerange=22:55:43,22:55:46.967687564 \
--output-format=ctf --output=out-ctf-trace
Example 4. Print the available remote LTTng sessions (through LTTng live). π‘
Peep which remote sessions are out there:
$ babeltrace2 --input-format=lttng-live net://localhost
Example 5. Pretty-print LTTng live events. π
Just point at a live session URL and watch the events roll in:
$ babeltrace2 net://localhost/host/myhostname/my-session-name
Example 6. Record LTTng live traces to the file system (as CTF 1.8 traces). πΎ
Save that live stream straight to disk β with session-not-found-action=end so it knows what to do if the session ghosts you, and ctf-version="1" for the CTF 1.8 flavor:
$ babeltrace2 net://localhost/host/myhostname/my-session-name \
--params=session-not-found-action=end \
--component=sink.ctf.fs \
--params='path="out-ctf-traces",ctf-version="1"'
Example 7. Read a CTF trace as fast as possible using a dummy output. β‘
You don't want output, you want speed. Dummy sink it is:
$ babeltrace2 my-trace --output-format=dummy
Example 8. Read three CTF traces in stream intersection mode, add debugging information, and pretty-print them to a file. π
Three traces, intersected, debug info sprinkled in, and everything lands in pretty-out instead of your terminal:
$ babeltrace2 ctf-trace1 ctf-trace2 ctf-trace3 --stream-intersection \
--debug-info --output=pretty-out
Example 9. Pretty-print a CTF trace and traces from an explicit source component, with the event times showed in seconds since the Unix epoch. π
Mix a plain trace with a hand-picked source component, and show timestamps as seconds-since-epoch with --clock-seconds:
$ babeltrace2 ctf-trace --component=src.my-plugin.my-src \
--params='path="spec-trace",output-some-event-type=yes' \
--clock-seconds
Example 10. Send LTTng live events to an explicit sink component. π
Live events, but they go wherever you say:
$ babeltrace2 net://localhost/host/myhostname/mysession \
--component=sink.my-plugin.my-sink
Example 11. Trim a CTF trace, add debugging information, apply an explicit filter component, and write as a CTF trace. π§
Trim + debug info + your own filter component (with its own --params) + CTF output. The full glow-up pipeline:
$ babeltrace2 /path/to/ctf/trace --timerange=22:14:38,22:15:07 \
--debug-info --component=filter.my-plugin.my-filter \
--params=criteria=xyz,ignore-abc=yes \
--output-format=ctf --output=out-ctf-trace
Example 12. Print the metadata text of a CTF trace. π
Just the metadata, nothing else:
$ babeltrace2 /path/to/ctf/trace --output-format=ctf-metadata
πΈ ENVIRONMENT VARIABLES πΈ
Babeltrace 2 library
BABELTRACE_EXEC_ON_ABORT=CMDLINEβ runs the command lineCMDLINE, parsed like a UNIX 98 shell, whenever any part of the Babeltrace 2 project unexpectedly aborts. π
The application only aborts after that executed command returns β and it straight-up ignores that command's exit status.
This environment variable gets ignored when the application has the setuid or the setgid access right flag set. π©
BABELTRACE_TERM_COLOR=(AUTO | NEVER | ALWAYS)β forces the terminal color support for thebabeltrace2(1)program and the project plugins. π¨
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_TERM_COLOR_BRIGHT_MEANS_BOLD=0β set it to0to emit SGR (seehttps://en.wikipedia.org/wiki/ANSI_escape_code) codes90to97for bright colors instead of bold (SGR code1) and standard color codes (SGR codes30to37).BABELTRACE_PLUGIN_PATH=PATHSβ sets the list of directories, in order, in which dynamic plugins can be found before other directories are considered, toPATHS(colon-separated, or semicolon on Windows).LIBBABELTRACE2_DISABLE_PYTHON_PLUGINS=1β disables the loading of any Babeltrace 2 Python plugin. ππ«LIBBABELTRACE2_INIT_LOG_LEVEL=LVLβ forces the initial log level of the Babeltrace 2 library to beLVL.
If this environment variable is set, then 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β 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.
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. πLIBBABELTRACE2_PLUGIN_PROVIDER_DIR=DIRβ sets the directory from which the Babeltrace 2 library dynamically loads plugin provider shared objects toDIR.
If this environment variable is set, then it overrides the default plugin provider directory.
Babeltrace 2 Python bindings
BABELTRACE_PYTHON_BT2_LOG_LEVEL=LVLβ forces the Babeltrace 2 Python bindings log level to beLVL.
If this environment variable is set, then it overrides the log level set by the --log-level option for the Python bindings logger.
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 levelbabeltrace2CLI to beLVL. (Yes, that sentence is doing the most, but that's literally what it says. π)
If this environment variable is set, then it overrides the log level set by the --log-level option for the CLI logger.
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 whichbabeltrace2-convert(1)prints when you convert a trace with a relative path that's also the name of ababeltrace2command.BABELTRACE_DEBUG=1β legacy variable: equivalent to setting the--log-leveloption toTRACE. π°οΈBABELTRACE_VERBOSE=1β legacy variable: equivalent to setting the--log-leveloption toINFO. π°οΈ
π¦ FILES π¦
$HOME/.local/lib/babeltrace2/pluginsβ user plugin directory./usr/local/lib/babeltrace2/pluginsβ system plugin directory./usr/local/lib/babeltrace2/plugin-providersβ system plugin provider directory.
β EXIT STATUS β
0 on success, 1 otherwise. That's it, that's the whole range, no in-between drama. π―
π 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, they wanna know. π«Ά
π RESOURCES π
The Babeltrace project shares some communication channels with the LTTng project (see https://lttng.org/).
- 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
Babeltrace 2 is literally the glow-up result of so many people's hard work, bestie β regular devs showing up every day and occasional contributors dropping in with that main character energy. Everyone ate. π
The current project maintainer is JΓ©rΓ©mie Galarneau <mailto:jeremie.galarneau@efficios.com>. Respect the crown. π«Ά
π COPYRIGHT
This command is part of the Babeltrace 2 project. Slay.
Babeltrace is distributed under the MIT license (see <https://opensource.org/licenses/MIT>). No cap, that's the whole license vibe. β¨
π¦ SEE ALSO
iykyk β go read the intro one if you're new here, it's giving tutorial energy. π
okay bestie that's the whole page, you made it to the end, I'm so proud of you ππ
This lil masterpiece is from Babeltrace 2.1.2, dated 13 December 2024, and the manual page is filed under BABELTRACE2-CONVERT(1). Go convert something iconic. ππβ
π¦ 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