BABELTRACE2-QUERY(1)
π babeltrace2-query β query an object from a Babeltrace 2 component class
okay bestie, so this is the manual page for babeltrace2-query, and it's genuinely one of the slayest little corners of Babeltrace 2. it's a whole thing. sit down, hydrate, let's go π«Ά
β¨ NAME β¨
babeltrace2-query β query an object from a Babeltrace 2 component class
π¦ SYNOPSIS π¦
babeltrace2 [GENERAL OPTIONS] query [--params=PARAMS]
COMP-CLS-TYPE.PLUGIN-NAME.COMP-CLS-NAME OBJECT
πΈ DESCRIPTION πΈ
okay so the query command does exactly one thing and it does it gorgeously: it queries the object named OBJECT from the component class named COMP-CLS-NAME of the type COMP-CLS-TYPE, found in the Babeltrace 2 plugin named PLUGIN-NAME, and then it prints the results. that's the whole vibe. it's giving "ask and you shall receive" β¨
if you wanna actually understand the Babeltrace 2 project and its core concepts, go read babeltrace2-intro(7). no cap, it's worth it.
the available values for COMP-CLS-TYPE are, and this is the whole menu:
source,srcβ source component class πfilter,fltβ filter component class πsinkβ sink component class π¦
now, the exact object names and the parameters that a given component class expects? those are described in that component class's own documentation, bestie. babeltrace2-help(1) can generally provide this information, so that's your go-to when you're lost.
you can use the --params option to pass parameters to the query operation of the component class. it's how you tell it what you actually want.
heads up: the output of the query command can look like YAML (see <https://yaml.org/>), but it is not guaranteed to be YAML-compliant. it's giving YAML energy, not YAML certification π don't pipe it into your strictest YAML parser and act shocked.
and yeah, there's a whole βEXAMPLESβ section down there. we'll get to it. it eats. π₯
π OPTIONS π
π General
you can use those options before the command name. yes, before. order matters, queen.
see babeltrace2(1) for more details.
-d,--debugβ legacy option: this is equivalent to--log-level=TRACE.-l LVL,--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. just. skip it. π--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.
π Query parameters
-p PARAMS,--params=PARAMSβ set the query parameters to PARAMS.
the format of PARAMS is a comma-separated list of NAME=VALUE assignments, like so:
NAME=VALUE[,NAME=VALUE]...
NAME
parameter name (C identifier plus the :, ., and - characters). yes those characters are allowed in there, iykyk.
VALUE
one of these bad boys:
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. breathe, bestie. space it out. π
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, as it can contain many special characters. seriously. your shell will absolutely snatch your params otherwise and you'll be sad. π
π§ Command information
-h,--helpβ show the command help and quit.
π EXAMPLES π
Example 1. Query the available tracing sessions of a local LTTng relay daemon.
$ babeltrace2 query src.ctf.lttng-live sessions \
--params='url="net://localhost"'
Example 2. Query the metadata info (includes the decoded plain text) of a CTF trace located on the local file system.
$ babeltrace2 query src.ctf.fs metadata-info \
--params='inputs=["/path/to/trace"]'
Example 3. Query the trace infos of a CTF trace located on the local file system.
$ babeltrace2 query src.ctf.fs babeltrace.trace-infos \
--params='inputs=["/path/to/trace"]'
Example 4. Query some object from a sink component class without parameters.
$ babeltrace2 query sink.my-plugin.my-sink some-object
and that's it for part 1, bestie β there's more coming, don't go anywhere π
π ENVIRONMENT VARIABLES π
okay bestie, listen up β these are the env vars that make babeltrace2 do its little tricks behind the scenes β¨ they're giving secret menu energy, and you're about to be in the know π
π§ Babeltrace 2 library π§
BABELTRACE_EXEC_ON_ABORT=CMDLINEβ Run the command lineCMDLINE, parsed like a UNIX 98 shell, whenever any part of the Babeltrace 2 project unexpectedly aborts π. The application only actually aborts after the executed command returns β it ignores the command's exit status like it's not even there. And heads up: this whole thing is ignored if the app has the setuid or setgid access right flag set π«.BABELTRACE_TERM_COLOR=(AUTO | NEVER | ALWAYS)β Force terminal color support for thebabeltrace2(1)program and the project plugins π¨. The values you can pick 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. Ever. No rainbow for you ππ«.ALWAYSβ Always emit terminal color codes, no matter what.
BABELTRACE_TERM_COLOR_BRIGHT_MEANS_BOLD=0β Set it to0and it emits SGR codes 90 to 97 for bright colors instead of bold (SGR code 1) plus standard color codes (SGR codes 30 to 37) π₯. If you need the SGR lore:https://en.wikipedia.org/wiki/ANSI_escape_code.BABELTRACE_PLUGIN_PATH=PATHSβ Set the list of directories, in order, where dynamic plugins can be found before other directories are considered, toPATHSπ.PATHSis colon-separated, or semicolon on Windows.LIBBABELTRACE2_DISABLE_PYTHON_PLUGINS=1β Disable the loading of any Babeltrace 2 Python plugin ππ«.LIBBABELTRACE2_INIT_LOG_LEVEL=LVLβ Force 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. TheLVLvalues 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β Make the Babeltrace 2 library leave any dynamically loaded modules (plugins and plugin providers) open at exit π. This can be useful for debugging purposes, iykyk.LIBBABELTRACE2_PLUGIN_PROVIDER_DIR=DIRβ Set 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.
π Babeltrace 2 Python bindings π
BABELTRACE_PYTHON_BT2_LOG_LEVEL=LVLβ Force 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. TheLVLvalues 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β Force the log level of the log levelbabeltrace2CLI to beLVLπ» (yes, it says "log level of the log level", we don't make the rules, we just report them π). If this env var is set, it overrides the log level set by the--log-leveloption for the CLI logger. TheLVLvalues 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β Disable 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 the whole vibe β simple, clean, periodt π
.
π BUGS π
If you encounter any issue or usability problem, please report it on the Babeltrace bug tracker: https://bugs.lttng.org/projects/babeltrace π they want to hear from you, bestie.
π RESOURCES π
The Babeltrace project shares some communication channels with the LTTng project (see https://lttng.org/).
- Babeltrace website:
https://babeltrace.org/π - Mailing list:
https://lists.lttng.orgfor support and development:lttng-dev@lists.lttng.orgπ§ - IRC channel:
irc://irc.oftc.net/lttngβ#lttngonirc.oftc.netπ¬ - Bug tracker:
https://bugs.lttng.org/projects/babeltraceπ - Git repository:
https://git.efficios.com/?p=babeltrace.gitποΈ - GitHub project:
https://github.com/efficios/babeltraceπ - Continuous integration:
https://ci.lttng.org/view/Babeltrace/βοΈ - Code review:
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 π.
The current project maintainer is JΓ©rΓ©mie Galarneau jeremie.galarneau@efficios.com π.
βοΈ COPYRIGHT βοΈ
This command is part of the Babeltrace 2 project.
Babeltrace is distributed under the MIT license (see https://opensource.org/licenses/MIT).
π SEE ALSO π
babeltrace2-intro(7), babeltrace2(1)
xoxo, this was Babeltrace 2.1.2, dated 14 September 2019, for BABELTRACE2-QUERY(1) πβ¨π¦
π¦ 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