diff --git a/arch/arm64/configs/vendor/lahaina_consolidate.config b/arch/arm64/configs/vendor/lahaina_consolidate.config index e264ad16b0b0..a387948293b6 100644 --- a/arch/arm64/configs/vendor/lahaina_consolidate.config +++ b/arch/arm64/configs/vendor/lahaina_consolidate.config @@ -48,3 +48,4 @@ CONFIG_USB_F_FS_IPC_LOGGING=y CONFIG_DYNAMIC_DEBUG=y CONFIG_QTI_PMIC_GLINK_CLIENT_DEBUG=y # CONFIG_HH_DISABLE_UART is not set +CONFIG_DEBUG_MODULE_LOAD_INFO=y diff --git a/kernel/module.c b/kernel/module.c index 2a4ff2960cbd..28d49f3841e9 100644 --- a/kernel/module.c +++ b/kernel/module.c @@ -2238,6 +2238,10 @@ static void free_module(struct module *mod) /* Free lock-classes; relies on the preceding sync_rcu(). */ lockdep_free_key_range(mod->core_layout.base, mod->core_layout.size); +#ifdef CONFIG_DEBUG_MODULE_LOAD_INFO + pr_info("Unloaded %s: module core layout, start: 0x%pK size: 0x%x\n", + mod->name, mod->core_layout.base, mod->core_layout.size); +#endif /* Finally, free the core (containing the module structure) */ module_memfree(mod->core_layout.base); } diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug index dfe0cfebdc09..86bcec772e94 100644 --- a/lib/Kconfig.debug +++ b/lib/Kconfig.debug @@ -186,6 +186,18 @@ config DYNAMIC_DEBUG_CORE the case of embedded system where the kernel image size is sensitive for people. +config DEBUG_MODULE_LOAD_INFO + bool "Use prints for module info under a debug flag" + help + If you say Y here the resulting kernel image will include + debug prints which was kept under DEBUG_MODULE_LOAD_INFO. + This will be used by developer to debug loadable modules in + the kernel. + Say Y here only if you plan to debug the kernel. + Not to be enabled on production builds. + + If unsure, say N. + endmenu # "printk and dmesg options" menu "Compile-time checks and compiler options"