NAME
babeltrace2-filter.lttng-utils.debug-info - Babeltrace 2's debugging information filter component class for LTTng tracesDESCRIPTION
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.Messages without debugging information | | +----------------------------+ | | flt.lttng-utils.debug-info | | | | '->@ in out @--> Messages with +----------------------------+ debugging information
Executable path or name followed with
@ADDR or +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.
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 operating system’s native format. This format is recognized by a filter.lttng-utils.debug-info component: it can translate the instruction pointer field of an event’s common context to a source file and line number, along with the name of the surrounding function.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. 1.Add the ip and vpid context
fields to user space event records:
See lttng-add-context(1) for more details.
$ lttng add-context --userspace --type=ip --type=vpid
2.Enable the LTTng-UST state dump events:
See lttng-enable-event(1) and lttng-ust(3) for more details.
$ lttng enable-event --userspace 'lttng_ust_statedump:*'
1.Do the previous steps (add context fields
and enable the LTTng-UST state dump events).
2.Enable the LTTng-UST dynamic linker tracing
helper events:
See lttng-ust-dl(3) for more details.
$ lttng enable-event --userspace 'lttng_ust_dl:*'
3.When you are ready to trace, start your
application with the LD_PRELOAD environment variable set to
liblttng-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 is to reduce the executable’s file size or simply to facilitate sharing the debugging information. 1.Within the executable file itself.
2.Through the build ID method in the
/usr/lib/debug/.build-id directory.
3.In the various possible debug link
locations.
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.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 default
debug_info.
full-path=yes [optional boolean]
Use the full path when writing the executable
name ( bin) and source file name (src) fields in the
debug_info context field of the created events.
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
inSingle input port.
Output
outSingle 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>).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:
[email protected]
•IRC channel (see
<irc://irc.oftc.net/lttng>): #lttng on irc.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>)