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 (0b prefix), octal (0 prefix), decimal, or hexadecimal (0x prefix) 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 of NAME=VALUE assignments, 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 line CMDLINE, 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 the babeltrace2(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 to 0 and 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, to PATHS πŸ“‚. PATHS is 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 be LVL πŸ“Š. If this env var is set, it overrides the log level set by the --log-level option for the Babeltrace 2 library logger. The LVL values 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 the TRACE level. 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 to DIR πŸ“. 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 be LVL 🐍✨. If this env var is set, it overrides the log level set by the --log-level option for the Python bindings logger. The LVL values 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 the TRACE level. 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 level babeltrace2 CLI to be LVL πŸ’» (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-level option for the CLI logger. The LVL values 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 the TRACE level. 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 which babeltrace2-convert(1) prints when you convert a trace with a relative path that’s also the name of a babeltrace2 command πŸ™ˆ.
  • BABELTRACE_DEBUG=1 β€” Legacy variable: equivalent to setting the --log-level option to TRACE πŸ§“.
  • BABELTRACE_VERBOSE=1 β€” Legacy variable: equivalent to setting the --log-level option to INFO πŸ§“.

πŸ“ 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/).


✍️ 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 πŸ‘‘.


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