Print function names during do_initcall debugging
PATCH 1/1 Print function names during do_initcall debugging
Hi Linus!
Please merge the following patch. It prints __init function names while all calls are executed at do_initcalls().
init/main.c +5 -2
@@ -36,6 +36,7 @@#include <linux/profile.h> #include <linux/rcupdate.h> #include <linux/moduleparam.h> +#include <linux/kallsyms.h> #include <linux/writeback.h> #include <linux/cpu.h> #include <linux/efi.h>
@@ -495,8 +496,10 @@for (call = &__initcall_start; call < &__initcall_end; call++) {char *msg; -if (initcall_debug) -printk ("calling initcall 0x%p\n" , *call); +if (initcall_debug) { +printk (KERN_DEBUG "Calling initcall 0x%p: " , *call); +print_symbol ("%s()\n" , (unsigned long ) *call); + } (*call)();
MfG, JBG
Signature · 4 lines
Jan-Benedict Glaw [email protected] . +49-172-7608481 "Eine Freie Meinung in einem Freien Kopf | Gegen Zensur | Gegen Krieg fuer einen Freien Staat voll Freier Bürger" | im Internet! | im Irak! ret = do_actions((curr | FREE_SPEECH) & ~(NEW_COPYRIGHT_LAW | DRM | TCPA));
Quoted 3 lines · Jan-Benedict Glaw
Please merge the following patch. It prints
__initfunction names while all calls are executed atdo_initcalls().
Nice, thanks. I tried to do this in the original patch but the kallsyms stuff wasn't set up at that stage. Someone must have moved something.
However I suspect you didn't test it with CONFIG_KALLSYMS=n: it will be missing newlines in the output.
25-akpm/init/main.c | 8 ++++++-- 1 files changed, 6 insertions(+), 2 deletions(-)
init/main.c renamed from init/main.c~initcall_debug-print_symbol +6 -2
@@ -37,6 +37,7 @@#include <linux/profile.h> #include <linux/rcupdate.h> #include <linux/moduleparam.h> +#include <linux/kallsyms.h> #include <linux/writeback.h> #include <linux/cpu.h> #include <linux/efi.h>
@@ -513,8 +514,11 @@ static void __init do_initcalls(void)for (call = &__initcall_start; call < &__initcall_end; call++) {char *msg; -if (initcall_debug) -printk ("calling initcall 0x%p\n" , *call); +if (initcall_debug) { +printk (KERN_DEBUG "Calling initcall 0x%p" , *call); +print_symbol (": %s()" , (unsigned long ) *call); +printk ("\n" ); + } (*call)();
_