lttng-modules
lttng-modules copied to clipboard
Add events to enumerate kernel symbols
The kernel symbols in the trace allow to resolve function pointers automatically from the trace's data. This can be useful for events having function pointers as fields, like timers, or the callstack-kernel context which lists the kernel addresses of the current callstack.
Details on overhead and event count can be found in the specific commits.
kallsyms_symbol_value() was introduced in kernel v5.0. Before that, module.c seems to access st_value field directly. We might want to introduce a wrapper in lttng-modules to use kallsyms_symbol_value for kernels 5.0+, and access the field directly prior to that.
Don't put extra time on this until we discuss the overall approach.
Dumping 5MB worth of data in a statedump, mostly repeating information available from ELF and DWARF, seems inefficient.
We might want to do like lttng-ust statedump, where we dump base addresses where libraries are loaded, their path, and build ID. We just need to fetch the information required to map address back to offsets in the kernel image and in kernel modules. The rest could be done offline.