* [patch] lockdep: special s390 print_symbol() version
@ 2006-06-28 11:24 Heiko Carstens
2006-06-28 12:06 ` Heiko Carstens
0 siblings, 1 reply; 5+ messages in thread
From: Heiko Carstens @ 2006-06-28 11:24 UTC (permalink / raw)
To: Andrew Morton
Cc: Ingo Molnar, Arjan van de Ven, Martin Schwidefsky, linux-kernel
From: Heiko Carstens <heiko.carstens@de.ibm.com>
Have a special version of print_symbol() for s390 which clears the most
significant bit of addr before calling __print_symbol(). This seems to
be better than checking/changing each place in the kernel that saves an
instruction pointer.
Without this the output would look like:
hardirqs last enabled at (30907): [<80018c6a>] 0x80018c6a
hardirqs last disabled at (30908): [<8001e48c>] 0x8001e48c
softirqs last enabled at (30904): [<8001dc96>] 0x8001dc96
softirqs last disabled at (30897): [<8001dc50>] 0x8001dc50
instead of this:
hardirqs last enabled at (19421): [<80018c72>] cpu_idle+0x176/0x1c4
hardirqs last disabled at (19422): [<8001e494>] io_no_vtime+0xa/0x1a
softirqs last enabled at (19418): [<8001dc9e>] do_softirq+0xa6/0xe8
softirqs last disabled at (19411): [<8001dc58>] do_softirq+0x60/0xe8
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Arjan van de Ven <arjan@infradead.org>
Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
---
Patch is against 2.6.17-mm3.
include/linux/kallsyms.h | 9 +++++++++
1 file changed, 9 insertions(+)
Index: linux-2.6.17-mm3/include/linux/kallsyms.h
===================================================================
--- linux-2.6.17-mm3.orig/include/linux/kallsyms.h
+++ linux-2.6.17-mm3/include/linux/kallsyms.h
@@ -57,11 +57,20 @@ do { \
#define print_fn_descriptor_symbol(fmt, addr) print_symbol(fmt, addr)
#endif
+/* need to clear the most significant bit on s390 31bit */
+#if defined(CONFIG_S390) && !defined(CONFIG_64BIT)
+#define print_symbol(fmt, addr) \
+do { \
+ __check_printsym_format(fmt, ""); \
+ __print_symbol(fmt, addr & 0x7fffffff); \
+} while(0)
+#else
#define print_symbol(fmt, addr) \
do { \
__check_printsym_format(fmt, ""); \
__print_symbol(fmt, addr); \
} while(0)
+#endif
#ifndef CONFIG_64BIT
#define print_ip_sym(ip) \
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [patch] lockdep: special s390 print_symbol() version
2006-06-28 11:24 [patch] lockdep: special s390 print_symbol() version Heiko Carstens
@ 2006-06-28 12:06 ` Heiko Carstens
2006-06-28 12:11 ` Andrew Morton
2006-06-28 12:15 ` Ingo Molnar
0 siblings, 2 replies; 5+ messages in thread
From: Heiko Carstens @ 2006-06-28 12:06 UTC (permalink / raw)
To: Andrew Morton
Cc: Ingo Molnar, Arjan van de Ven, Martin Schwidefsky, linux-kernel
> --- linux-2.6.17-mm3.orig/include/linux/kallsyms.h
> +++ linux-2.6.17-mm3/include/linux/kallsyms.h
> @@ -57,11 +57,20 @@ do { \
> #define print_fn_descriptor_symbol(fmt, addr) print_symbol(fmt, addr)
> #endif
>
> +/* need to clear the most significant bit on s390 31bit */
> +#if defined(CONFIG_S390) && !defined(CONFIG_64BIT)
> +#define print_symbol(fmt, addr) \
> +do { \
> + __check_printsym_format(fmt, ""); \
> + __print_symbol(fmt, addr & 0x7fffffff); \
> +} while(0)
> +#else
> #define print_symbol(fmt, addr) \
> do { \
> __check_printsym_format(fmt, ""); \
> __print_symbol(fmt, addr); \
> } while(0)
> +#endif
Martin made me just aware of __builtin_extract_return_addr() which will
do the trick as well and avoids adding yet another ifdef.
So, how about this one instead:
From: Heiko Carstens <heiko.carstens@de.ibm.com>
Use __builtin_extract_return_addr() in print_symbol() to deal with s390 which
has the most significant bit set in instruction pointers.
Without this the output would look like:
hardirqs last enabled at (30907): [<80018c6a>] 0x80018c6a
hardirqs last disabled at (30908): [<8001e48c>] 0x8001e48c
softirqs last enabled at (30904): [<8001dc96>] 0x8001dc96
softirqs last disabled at (30897): [<8001dc50>] 0x8001dc50
instead of this:
hardirqs last enabled at (19421): [<80018c72>] cpu_idle+0x176/0x1c4
hardirqs last disabled at (19422): [<8001e494>] io_no_vtime+0xa/0x1a
softirqs last enabled at (19418): [<8001dc9e>] do_softirq+0xa6/0xe8
softirqs last disabled at (19411): [<8001dc58>] do_softirq+0x60/0xe8
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Arjan van de Ven <arjan@infradead.org>
Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
---
include/linux/kallsyms.h | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
Index: linux-2.6.17-mm3/include/linux/kallsyms.h
===================================================================
--- linux-2.6.17-mm3.orig/include/linux/kallsyms.h
+++ linux-2.6.17-mm3/include/linux/kallsyms.h
@@ -57,11 +57,12 @@ do { \
#define print_fn_descriptor_symbol(fmt, addr) print_symbol(fmt, addr)
#endif
-#define print_symbol(fmt, addr) \
-do { \
- __check_printsym_format(fmt, ""); \
- __print_symbol(fmt, addr); \
-} while(0)
+static inline void print_symbol(const char *fmt, unsigned long addr)
+{
+ __check_printsym_format(fmt, "");
+ __print_symbol(fmt, (unsigned long)
+ __builtin_extract_return_addr((void *)addr));
+}
#ifndef CONFIG_64BIT
#define print_ip_sym(ip) \
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [patch] lockdep: special s390 print_symbol() version
2006-06-28 12:06 ` Heiko Carstens
@ 2006-06-28 12:11 ` Andrew Morton
2006-06-28 12:17 ` Martin Schwidefsky
2006-06-28 12:15 ` Ingo Molnar
1 sibling, 1 reply; 5+ messages in thread
From: Andrew Morton @ 2006-06-28 12:11 UTC (permalink / raw)
To: Heiko Carstens; +Cc: mingo, arjan, schwidefsky, linux-kernel
On Wed, 28 Jun 2006 14:06:35 +0200
Heiko Carstens <heiko.carstens@de.ibm.com> wrote:
> Martin made me just aware of __builtin_extract_return_addr() which will
> do the trick as well and avoids adding yet another ifdef.
Does gcc-3.2 support that?
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [patch] lockdep: special s390 print_symbol() version
2006-06-28 12:11 ` Andrew Morton
@ 2006-06-28 12:17 ` Martin Schwidefsky
0 siblings, 0 replies; 5+ messages in thread
From: Martin Schwidefsky @ 2006-06-28 12:17 UTC (permalink / raw)
To: Andrew Morton; +Cc: Heiko Carstens, mingo, arjan, linux-kernel
On Wed, 2006-06-28 at 05:11 -0700, Andrew Morton wrote:
> On Wed, 28 Jun 2006 14:06:35 +0200
> Heiko Carstens <heiko.carstens@de.ibm.com> wrote:
>
> > Martin made me just aware of __builtin_extract_return_addr() which will
> > do the trick as well and avoids adding yet another ifdef.
>
> Does gcc-3.2 support that?
It was present in every version of gcc we used, even 2.95.3 had it.
--
blue skies,
Martin.
Martin Schwidefsky
Linux for zSeries Development & Services
IBM Deutschland Entwicklung GmbH
"Reality continues to ruin my life." - Calvin.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [patch] lockdep: special s390 print_symbol() version
2006-06-28 12:06 ` Heiko Carstens
2006-06-28 12:11 ` Andrew Morton
@ 2006-06-28 12:15 ` Ingo Molnar
1 sibling, 0 replies; 5+ messages in thread
From: Ingo Molnar @ 2006-06-28 12:15 UTC (permalink / raw)
To: Heiko Carstens
Cc: Andrew Morton, Arjan van de Ven, Martin Schwidefsky, linux-kernel
* Heiko Carstens <heiko.carstens@de.ibm.com> wrote:
> +static inline void print_symbol(const char *fmt, unsigned long addr)
> +{
> + __check_printsym_format(fmt, "");
> + __print_symbol(fmt, (unsigned long)
> + __builtin_extract_return_addr((void *)addr));
> +}
yeah, this looks better i think than the #ifdef variant.
Ingo
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2006-06-28 12:21 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-06-28 11:24 [patch] lockdep: special s390 print_symbol() version Heiko Carstens
2006-06-28 12:06 ` Heiko Carstens
2006-06-28 12:11 ` Andrew Morton
2006-06-28 12:17 ` Martin Schwidefsky
2006-06-28 12:15 ` Ingo Molnar
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®