[DTrace-devel] [PATCH 2/5] module: add CONFIG_BUILTIN_RANGES option

Kris Van Hees kris.van.hees at oracle.com
Mon Oct 30 22:21:06 UTC 2023


This patch series implements what is needed to generate a modules.builtin.ranges
file that contains the data needed for DTrace (and other tracers) to know what
symbols in the core kernel belong to one (or more) built-in modules.o

It serves as a replacement for the kallmodsyms patch series.

These patches are for the *kernel*, not DTrace.  I will be posting a patch to
DTrace itself to make use of this (when available).

	Kris

On Mon, Oct 30, 2023 at 06:05:30PM -0400, Kris Van Hees via DTrace-devel wrote:
> The CONFIG_BUILTIN_RANGES option controls whether offset range data is
> generated for kernel modules that are built into the kernel image.
> 
> Signed-off-by: Kris Van Hees <kris.van.hees at oracle.com>
> ---
>  kernel/module/Kconfig | 13 +++++++++++++
>  1 file changed, 13 insertions(+)
> 
> diff --git a/kernel/module/Kconfig b/kernel/module/Kconfig
> index 33a2e991f608..5982389f0b09 100644
> --- a/kernel/module/Kconfig
> +++ b/kernel/module/Kconfig
> @@ -389,4 +389,17 @@ config MODULES_TREE_LOOKUP
>  	def_bool y
>  	depends on PERF_EVENTS || TRACING || CFI_CLANG
>  
> +config BUILTIN_RANGES
> +	bool "Generate address ramge information for builtin modules"
> +	depends on VMLINUX_MAP
> +	help
> +	  When modules are built into the kernel, there will be no module name
> +	  associated with its symbols in /proc/kallsyms.  Tracers may want to
> +	  identify synbols by module name and symbol name regardless of whether
> +	  the module is configured as loadable or not.
> +
> +	  BUILTIN_RANGES generates a file that associates offset ranges (per
> +	  ELF section) with the module(s) they below to.  It also records an
> +	  anchor symbol to determine the load address of the section.
> +
>  endif # MODULES
> -- 
> 2.39.2
> 
> 
> _______________________________________________
> DTrace-devel mailing list
> DTrace-devel at oss.oracle.com
> https://oss.oracle.com/mailman/listinfo/dtrace-devel



More information about the DTrace-devel mailing list