All of lore.kernel.org
 help / color / mirror / Atom feed
From: Olaf Hering <olh@suse.de>
To: linux-kernel@vger.kernel.org, Andrew Morton <akpm@osdl.org>
Subject: [PATCH] fix initcall_debug on ppc64/ia64
Date: Fri, 5 Nov 2004 13:49:22 +0100	[thread overview]
Message-ID: <20041105124922.GA25239@suse.de> (raw)
In-Reply-To: <20041104210547.GA16238@suse.de>


ia64 and ppc64 have function descriptors.
Booting with initcall_debug will print the descriptor address, not the
address and name of the actual function. Another redirection is
required.

Tested on ppc, ppc64 and ia64.

Signed-off-by: Olaf Hering <olh@suse.de>

diff -purNx tags linux-2.6.9/include/linux/kallsyms.h linux-2.6.10-rc1-bk14.initcall_debug/include/linux/kallsyms.h
--- linux-2.6.9/include/linux/kallsyms.h	2004-10-18 23:53:06.000000000 +0200
+++ linux-2.6.10-rc1-bk14.initcall_debug/include/linux/kallsyms.h	2004-11-05 10:27:48.722687802 +0100
@@ -47,6 +47,16 @@ __attribute__((format(printf,1,2)));
 static inline void __check_printsym_format(const char *fmt, ...)
 {
 }
+/* ia64 and ppc64 use function descriptors, which contain the real address */
+#if defined(CONFIG_IA64) || defined(CONFIG_PPC64)
+#define print_fn_descriptor_symbol(fmt, addr)		\
+do {						\
+	unsigned long *__faddr = (unsigned long*) addr;		\
+	print_symbol(fmt, __faddr[0]);		\
+} while (0)
+#else
+#define print_fn_descriptor_symbol(fmt, addr) print_symbol(fmt, addr)
+#endif
 
 #define print_symbol(fmt, addr)			\
 do {						\
diff -purNx tags linux-2.6.9/init/main.c linux-2.6.10-rc1-bk14.initcall_debug/init/main.c
--- linux-2.6.9/init/main.c	2004-11-04 21:01:04.000000000 +0100
+++ linux-2.6.10-rc1-bk14.initcall_debug/init/main.c	2004-11-05 10:19:32.254301065 +0100
@@ -604,7 +604,7 @@ static void __init do_initcalls(void)
 
 		if (initcall_debug) {
 			printk(KERN_DEBUG "Calling initcall 0x%p", *call);
-			print_symbol(": %s()", (unsigned long) *call);
+			print_fn_descriptor_symbol(": %s()", (unsigned long) *call);
 			printk("\n");
 		}
 
-- 
USB is for mice, FireWire is for men!

sUse lINUX ag, nÜRNBERG

      parent reply	other threads:[~2004-11-05 12:59 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20041102195130.GA13589@suse.de>
     [not found] ` <20041103152628.19753cf2.akpm@osdl.org>
2004-11-04 21:05   ` fix initcall_debug on ppc64/ia64 Olaf Hering
2004-11-04 23:47     ` Andreas Schwab
2004-11-05 12:49     ` Olaf Hering [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20041105124922.GA25239@suse.de \
    --to=olh@suse.de \
    --cc=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.