This introdues a new tool, dwarf2ctf, which runs at modpost time whenever any
module or any part of the core kernel is changed, extracting the debugging
information from the kernel build tree, deduplicating it, and emitting it in
Sun's Compact Type Format into gzipped files in a new .ctf directory. These
files are then linked into the kernel modules as new sections named .SUNW_ctf.
One file is emitted per kernel module, whether builtin or no, as well as one
file for types that are used by no modules, and one file for types shared
between more than one of the other files. As the built-in modules and shared
types have no module of their own to go into, they are placed in a new
dtrace_ctf.ko module (which serves no other purpose: loading it is useless).
DTrace userspace will no longer start if this module is not present.
Due to the extensive sharing of types, dwarf2ctf must run whenever any object
files at all are changed, and may trigger relinks of modules that you would not
otherwise think had changed.
Standalone modules also have CTF generated for them, but never share types with
any other modules.
Because dwarf2ctf is slow enough to be annoying when running frequent kernel
builds to debug some unrelated problem, a new CONFIG_DT_DISABLE_CTF debugging
configuraton option is added, which suppresses CTF generation entirely.
This commit introduces new kernel build-time dependencies on elfutils and the
new libdtrace-ctf package (shared with dtrace userspace). No new runtime
dependencies are introduced.
Signed-off-by: Nick Alcock <nick.alcock@oracle.com>