From: Arjan van de Ven , Rusty Russell The patch below resolves the "Not Yet Implemented" print_modules() thing. This is a really useful feature for distros; it allows us to do statistical analysis on which modules are present how often in oopses compared to how often they are used normally. In addition it helps to spot candidates for certain bugs without having to go back to the customer asking for this information. --- 25-akpm/include/linux/module.h | 5 ++++- 25-akpm/kernel/module.c | 11 +++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff -puN include/linux/module.h~implement-print_modules include/linux/module.h --- 25/include/linux/module.h~implement-print_modules 2004-05-12 21:07:19.455981216 -0700 +++ 25-akpm/include/linux/module.h 2004-05-12 21:07:19.460980456 -0700 @@ -24,7 +24,6 @@ /* Not Yet Implemented */ #define MODULE_SUPPORTED_DEVICE(name) -#define print_modules() /* v850 toolchain uses a `_' prefix for all user symbols */ #ifndef MODULE_SYMBOL_PREFIX @@ -425,6 +424,7 @@ const struct exception_table_entry *sear int register_module_notifier(struct notifier_block * nb); int unregister_module_notifier(struct notifier_block * nb); +extern void print_modules(void); #else /* !CONFIG_MODULES... */ #define EXPORT_SYMBOL(sym) #define EXPORT_SYMBOL_GPL(sym) @@ -505,6 +505,9 @@ static inline int unregister_module_noti #define module_put_and_exit(code) do_exit(code) +static inline void print_modules(void) +{ +} #endif /* CONFIG_MODULES */ #define symbol_request(x) try_then_request_module(symbol_get(x), "symbol:" #x) diff -puN kernel/module.c~implement-print_modules kernel/module.c --- 25/kernel/module.c~implement-print_modules 2004-05-12 21:07:19.456981064 -0700 +++ 25-akpm/kernel/module.c 2004-05-12 21:07:19.472978632 -0700 @@ -2045,6 +2045,17 @@ struct module *module_text_address(unsig return NULL; } +/* Don't grab lock, we're oopsing. */ +void print_modules(void) +{ + struct module *mod; + + printk("Modules linked in:"); + list_for_each_entry(mod, &modules, list) + printk(" %s", mod->name); + printk("\n"); +} + #ifdef CONFIG_MODVERSIONS /* Generate the signature for struct module here, too, for modversions. */ void struct_module(struct module *mod) { return; } _