BABELTRACE2-FILTER.LTTNG-UTILS.DEBUG-INFO(7)
π BABELTRACE2-FILTER.LTTNG-UTILS.DEBUG-INFO π
okay bestie, welcome to the babeltrace2-filter.lttng-utils.debug-info page β she's a Babeltrace 2 filter component class whose whole personality is making LTTng traces say where they came from. we're talking debugging information filter component class for LTTng traces, and honestly? iconic. π
β¨ NAME β¨
babeltrace2-filter.lttng-utils.debug-info β Babeltrace 2: Debugging information filter component class for LTTng traces
πΈ DESCRIPTION πΈ
A Babeltrace 2 filter.lttng-utils.debug-info message iterator creates and emits copies of upstream messages, augmenting LTTng event messages with debugging information when it's available and possible. like, she's not changing your messages, she's giving them a glow-up β¨
Messages without
debugging information
|
| +----------------------------+
| | flt.lttng-utils.debug-info |
| | |
'->@ in out @--> Messages with
+----------------------------+ debugging information
See babeltrace2-intro(7) to learn more about the Babeltrace 2 project and its core concepts. (iykyk π«Ά)
A filter.lttng-utils.debug-info message iterator uses the LTTng state dump events as well as the ip (instruction pointer) and vpid (process ID) common context fields of the event to locate and read the corresponding debugging information. The message iterator can find the extra debugging information in an executable file or in a directory containing debugging information which the compiler creates. she's basically a detective with a magnifying glass π
The new LTTng events (copies of the original ones with added debugging information) contain, when possible, a new event common context structure field (besides the ip field) named debug_info by default β you can use the debug-info-field-name parameter to choose another name, because your naming era is valid too π
This structure field contains the following fields:
bin[string] β Executable path or name followed with@ADDRor+ADDR, where ADDR is the address (hexadecimal) where it was loaded while being traced.
@ADDR means ADDR is an absolute address, and +ADDR means ADDR is a relative address.
Examples: my-program@0x4b7fdd23, my-program+0x18d7c.
func[string] β Function name followed with+OFFSET, where OFFSET is the offset (hexadecimal) from the beginning of the function symbol in the executable file.
Example: load_user_config+0x194.
src[string] β Source file path or name followed with:LINE, where LINE is the line number in this source file at which the event occurred.
Example: user-config.c:1025.
Any of the previous fields can be an empty string if the debugging information was not available for the analyzed original LTTng event. she tried her best, okay π
A filter.lttng-utils.debug-info message iterator systematically copies the upstream messages, but it only augments compatible LTTng event classes. This means that the message iterator copies messages of non-LTTng trace (see βLTTng prerequisitesβ) without alteration. no notes, no edits, just vibes π
π οΈ Compile an executable for debugging information analysis π οΈ
With GCC or Clang, you need to compile the program or library source files in debug mode with the -g option. This option makes the compiler generate debugging information in the native format of the operating system. This format is recognized by a filter.lttng-utils.debug-info component: it can translate the instruction pointer field of an event common context to a source file and line number, along with the name of the surrounding function. it's giving translation services π
Important β οΈ This component class only supports the debugging information in DWARF format, version 2 or later. Use the-gdwarfor-gdwarf-VERSION(where VERSION is the DWARF version) compiler options to explicitly generate DWARF debugging information. no old DWARF energy allowed, periodt.
If you don't compile the source files of the executable with the -g option or with an equivalent option, then no DWARF information is available: the message iterator uses ELF symbols from the executable file instead. In this case, the events that the message iterator creates don't contain the source file and line number (see the src field), but only the name of the nearest function symbol with an offset in bytes to the location in the executable from which the LTTng event occurred (see the func field). so like, she's working with less info and she's still showing up. queen behavior π
If the executable file has neither ELF symbols nor DWARF information, then the filter.lttng-utils.debug-info message iterator cannot map the event to its source location: the message iterator still copies the upstream messages but without altering them. she's not gonna invent lore that doesn't exist π
π₯ LTTng prerequisites π₯
A filter.lttng-utils.debug-info message iterator can only analyze user space events which LTTng (see <https://lttng.org>) 2.8.0 or later generates.
To get debugging information for LTTng-UST events which occur in executables and libraries which the system loader loads (what you can see with ldd(1)):
- Add the
ipandvpidcontext fields to user space event records:
$ lttng add-context --userspace --type=ip --type=vpid
See lttng-add-context(1) for more details.
- Enable the LTTng-UST state dump events:
$ lttng enable-event --userspace 'lttng_ust_statedump:*'
See lttng-enable-event(1) and lttng-ust(3) for more details.
To get debugging information for LTTng-UST events which occur in dynamically loaded objects, for example plugins:
- Do the previous steps (add context fields and enable the LTTng-UST state dump events).
- Enable the LTTng-UST dynamic linker tracing helper events:
$ lttng enable-event --userspace 'lttng_ust_dl:*'
See lttng-ust-dl(3) for more details.
- When you are ready to trace, start your application with the
LD_PRELOADenvironment variable set toliblttng-ust-dl.so:
$ LD_PRELOAD=liblttng-ust-dl.so my-app
π Separate debugging information π
You can store DWARF debugging information outside the executable itself, whether it's to reduce the file size of the executable or simply to facilitate sharing the debugging information. Marie Kondo would approve π§Ή
This is usually achieved via one of two mechanisms, namely build ID and debug link. Their use and operation is described in the Debugging Information in Separate Files (see <https://sourceware.org/gdb/onlinedocs/gdb/Separate-Debug-Files.html>) section of GDB's documentation.
A filter.lttng-utils.debug-info message iterator can find separate debugging information files automatically, as long as they meet the requirements stated in this manual page.
The debugging information lookup order is the same as GDB's, namely:
- Within the executable file itself.
- Through the build ID method in the
/usr/lib/debug/.build-iddirectory. - In the various possible debug link locations.
The message iterator uses the first debugging information file that it finds. first come first served bestie π«Ά
You can use the debug-info-dir initialization parameter to override the default /usr/lib/debug directory used in the build ID and debug link methods.
Note π It's currently not possible to make this component search for debugging information in multiple directories. one directory at a time, she's monogamous like that π
π¦ Target prefix π¦
The debugging information analysis that a filter.lttng-utils.debug-info message iterator performs uses the paths to the executables as collected during tracing as the default mechanism to resolve DWARF and ELF information.
If the trace was recorded on a separate machine, however, then you can use the target-prefix parameter to specify a prefix directory, that is, the root of the target file system. long distance relationship, but make it paths π
For example, if the path of an instrumented executable is /usr/bin/foo on the target system, then you can place this file at /home/user/target/usr/bin/foo on the system on which you use a filter.lttng-utils.debug-info component. In this case, the target prefix to use is /home/user/target.
π INITIALIZATION PARAMETERS π
debug-info-dir=DIR[optional string] β Use DIR as the directory from which to load debugging information with the build ID and debug link methods instead of/usr/lib/debug.debug-info-field-name=NAME[optional string] β Name the debugging information structure field in the common context of the created events NAME instead of the defaultdebug_info.full-path=VAL[optional boolean] β If VAL is true, then use the full path when writing the executable name (bin) and source file name (src) fields in thedebug_infocontext field of the created events.
Default: false.
target-prefix=DIR[optional string] β Use DIR as the root directory of the target file system instead of/.
π§ PORTS π§
+----------------------------+
| flt.lttng-utils.debug-info |
| |
@ in out @
+----------------------------+
π₯ Input
inβ Single input port.
π€ Output
outβ Single output port.
π BUGS π
If you encounter any issue or usability problem, please report it on the Babeltrace bug tracker (see <https://bugs.lttng.org/projects/babeltrace>). she wants your feedback, fr fr π
π 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 π
The Babeltrace 2 project is the result of hard work by many regular developers and occasional contributors. main character energy from the whole squad, honestly π
The current project maintainer is JΓ©rΓ©mie Galarneau <mailto:jeremie.galarneau@efficios.com>.
β COPYRIGHT β
This component class 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-plugin-lttng-utils(7), lttng(1), lttng-add-context(1)
and that's the whole page, bestie!! π this was BABELTRACE2-FILTER() from the Babeltrace 2 project, written up by the lovely folks at Efficios β go read the others too, they ate. π
β¨π¦
BABELTRACE2-FILTER() β Babeltrace 2 project, Efficios. mwah, bye!! π
π¦ 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
- nixos 26.05: babeltrace2 2.1.2
- nixpkgs unstable: babeltrace2 2.1.2
- ubuntu resolute: babeltrace2 2.1.2-1build2 Β· MIT
- ubuntu stonking: babeltrace2 2.1.2-1build2 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms