Module state and address in /proc/modules.
PATCH 1/1 Module state and address in /proc/modules.
The address allows oprofile and ksymoops to work again. The state is simply informative.
Rusty.
--
Anyone who quotes me in their sig is an idiot. -- Rusty Russell.
Name: Put more information in /proc/modules
Author: Stanley Wang, Rusty Russell
Status: Tested on 2.5.56
D: Puts the state of the module and the address in /proc/modules.
kernel/module.c +9 -0
@@ -1422,6 +1422,15 @@ static int m_show(struct seq_file *m, voseq_printf (m,"%s %lu" , mod->name, mod->init_size + mod->core_size);print_unload_info (m, mod); + +/* Informative for users. */ +seq_printf (m," %s" , + mod->state ==MODULE_STATE_GOING ?"Unloading" : + mod->state ==MODULE_STATE_COMING ?"Loading" : +"Live" ); +/* Used by oprofile and other similar tools. */ +seq_printf (m," 0x%p" , mod->module_core); +seq_printf (m,"\n" );return 0 ; }
Hi,
kernel/module.c static int m_show(struct seq_file *m, vo · line 1433
Quoted 3 lines · Rusty Russell
kernel/module.c +3
-0+/* Used by oprofile and other similar tools. */ +seq_printf (m," 0x%p" , mod->module_core); +
Q: How does ksymoops find out with this, how the sections are laid out?
Q: What happens if the module crashes during init?
bye, Roman