mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] Print function names during do_initcall debugging
@ 2004-03-09 22:25 Jan-Benedict Glaw
  2004-03-09 23:09 ` Andrew Morton
  0 siblings, 1 reply; 2+ messages in thread
From: Jan-Benedict Glaw @ 2004-03-09 22:25 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: linux-kernel

Hi Linus!

Please merge the following patch. It prints __init function names while
all calls are executed at do_initcalls().

--- a/init/main.c	23 Feb 2004 22:50:26 -0000	1.1.1.51
+++ b/init/main.c	9 Mar 2004 22:00:19 -0000
@@ -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

-- 
   Jan-Benedict Glaw       jbglaw@lug-owl.de    . +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));

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] Print function names during do_initcall debugging
  2004-03-09 22:25 [PATCH] Print function names during do_initcall debugging Jan-Benedict Glaw
@ 2004-03-09 23:09 ` Andrew Morton
  0 siblings, 0 replies; 2+ messages in thread
From: Andrew Morton @ 2004-03-09 23:09 UTC (permalink / raw)
  To: Jan-Benedict Glaw; +Cc: torvalds, linux-kernel

Jan-Benedict Glaw <jbglaw@lug-owl.de> wrote:
>
> Please merge the following patch. It prints __init function names while
> all calls are executed at do_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(-)

diff -puN init/main.c~initcall_debug-print_symbol init/main.c
--- 25/init/main.c~initcall_debug-print_symbol	Tue Mar  9 15:07:16 2004
+++ 25-akpm/init/main.c	Tue Mar  9 15:07:59 2004
@@ -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)();
 

_


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2004-03-09 23:07 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-03-09 22:25 [PATCH] Print function names during do_initcall debugging Jan-Benedict Glaw
2004-03-09 23:09 ` Andrew Morton

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®