* fix initcall_debug on ppc64/ia64 [not found] ` <20041103152628.19753cf2.akpm@osdl.org> @ 2004-11-04 21:05 ` Olaf Hering 2004-11-04 23:47 ` Andreas Schwab 2004-11-05 12:49 ` [PATCH] " Olaf Hering 0 siblings, 2 replies; 3+ messages in thread From: Olaf Hering @ 2004-11-04 21:05 UTC (permalink / raw) To: linux-kernel On Wed, Nov 03, Andrew Morton wrote: > Olaf Hering <olh@suse.de> wrote: > > > > Is a patch like that acceptable (for mainline)? Currently only the > > descriptor is printed, not the function itself. Another redirection is > > needed. > > Is this acked by Paul and Anton? If so, I'll replace __powerpc64__ with > CONFIG_PPC64 and run with it. I guess we need something like this. Just where to put it, how to name it and how to handle ia64: 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-04 21:37:19.789304911 +0100 @@ -47,6 +47,15 @@ __attribute__((format(printf,1,2))); static inline void __check_printsym_format(const char *fmt, ...) { } +#ifdef CONFIG_PPC64 +#define print_foo_symbol(fmt, addr) \ +do { \ + unsigned long *__pfs = (unsigned long*) addr; \ + print_symbol(fmt, __pfs[0]); \ +} while (0) +#else +#define print_foo_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.878455673 +0100 +++ linux-2.6.10-rc1-bk14.initcall_debug/init/main.c 2004-11-04 21:08:01.191792667 +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_foo_symbol(": %s()", (unsigned long) *call); printk("\n"); } -- USB is for mice, FireWire is for men! sUse lINUX ag, nÜRNBERG ^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: fix initcall_debug on ppc64/ia64 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 ` [PATCH] " Olaf Hering 1 sibling, 0 replies; 3+ messages in thread From: Andreas Schwab @ 2004-11-04 23:47 UTC (permalink / raw) To: Olaf Hering; +Cc: linux-kernel Olaf Hering <olh@suse.de> writes: > On Wed, Nov 03, Andrew Morton wrote: > >> Olaf Hering <olh@suse.de> wrote: >> > >> > Is a patch like that acceptable (for mainline)? Currently only the >> > descriptor is printed, not the function itself. Another redirection is >> > needed. >> >> Is this acked by Paul and Anton? If so, I'll replace __powerpc64__ with >> CONFIG_PPC64 and run with it. > > > I guess we need something like this. > Just where to put it, how to name it and how to handle ia64: The ia64 version should be identical. Andreas. -- Andreas Schwab, SuSE Labs, schwab@suse.de SuSE Linux AG, Maxfeldstraße 5, 90409 Nürnberg, Germany Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different." ^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH] fix initcall_debug on ppc64/ia64 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 1 sibling, 0 replies; 3+ messages in thread From: Olaf Hering @ 2004-11-05 12:49 UTC (permalink / raw) To: linux-kernel, Andrew Morton 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 ^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2004-11-05 12:59 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[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 ` [PATCH] " Olaf Hering
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox