lttng-modules icon indicating copy to clipboard operation
lttng-modules copied to clipboard

Add events to enumerate kernel symbols

Open tahini opened this issue 6 years ago • 2 comments

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.

tahini avatar Jun 19 '19 17:06 tahini

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.

compudj avatar Oct 18 '19 16:10 compudj

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.

compudj avatar Oct 18 '19 19:10 compudj