diff options
author | Alexander van Heukelum <heukelum@fastmail.fm> | 2008-10-04 17:12:41 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-10-13 04:33:40 -0400 |
commit | 161827903bdc124655f4cd976b9f0a5ac6ebf21c (patch) | |
tree | 4db12827a7ede3c41eadacb85ee8dfb3604272b9 | |
parent | dd6e4eba1c03c9562fced21736453396c045f869 (diff) |
dumpstack: x86: make printk_address equal
- x86_64: use %p to print an address
- make i386-version the same as the above
The result should be the same on x86_64; on i386 the
output only changes if CONFIG_KALLSYMS is turned off,
in which case the address is printed twice.
Signed-off-by: Alexander van Heukelum <heukelum@fastmail.fm>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
-rw-r--r-- | arch/x86/kernel/dumpstack_32.c | 27 | ||||
-rw-r--r-- | arch/x86/kernel/dumpstack_64.c | 4 |
2 files changed, 4 insertions, 27 deletions
diff --git a/arch/x86/kernel/dumpstack_32.c b/arch/x86/kernel/dumpstack_32.c index dc9ca7ee1c47..4e67a005c7a1 100644 --- a/arch/x86/kernel/dumpstack_32.c +++ b/arch/x86/kernel/dumpstack_32.c | |||
@@ -23,31 +23,8 @@ static int die_counter; | |||
23 | 23 | ||
24 | void printk_address(unsigned long address, int reliable) | 24 | void printk_address(unsigned long address, int reliable) |
25 | { | 25 | { |
26 | #ifdef CONFIG_KALLSYMS | 26 | printk(" [<%p>] %s%pS\n", (void *) address, |
27 | unsigned long offset = 0; | 27 | reliable ? "" : "? ", (void *) address); |
28 | unsigned long symsize; | ||
29 | const char *symname; | ||
30 | char *modname; | ||
31 | char *delim = ":"; | ||
32 | char namebuf[KSYM_NAME_LEN]; | ||
33 | char reliab[4] = ""; | ||
34 | |||
35 | symname = kallsyms_lookup(address, &symsize, &offset, | ||
36 | &modname, namebuf); | ||
37 | if (!symname) { | ||
38 | printk(" [<%08lx>]\n", address); | ||
39 | return; | ||
40 | } | ||
41 | if (!reliable) | ||
42 | strcpy(reliab, "? "); | ||
43 | |||
44 | if (!modname) | ||
45 | modname = delim = ""; | ||
46 | printk(" [<%08lx>] %s%s%s%s%s+0x%lx/0x%lx\n", | ||
47 | address, reliab, delim, modname, delim, symname, offset, symsize); | ||
48 | #else | ||
49 | printk(" [<%08lx>]\n", address); | ||
50 | #endif | ||
51 | } | 28 | } |
52 | 29 | ||
53 | static inline int valid_stack_ptr(struct thread_info *tinfo, | 30 | static inline int valid_stack_ptr(struct thread_info *tinfo, |
diff --git a/arch/x86/kernel/dumpstack_64.c b/arch/x86/kernel/dumpstack_64.c index 6f1505074db0..563554c90686 100644 --- a/arch/x86/kernel/dumpstack_64.c +++ b/arch/x86/kernel/dumpstack_64.c | |||
@@ -23,8 +23,8 @@ static int die_counter; | |||
23 | 23 | ||
24 | void printk_address(unsigned long address, int reliable) | 24 | void printk_address(unsigned long address, int reliable) |
25 | { | 25 | { |
26 | printk(" [<%016lx>] %s%pS\n", | 26 | printk(" [<%p>] %s%pS\n", (void *) address, |
27 | address, reliable ? "" : "? ", (void *) address); | 27 | reliable ? "" : "? ", (void *) address); |
28 | } | 28 | } |
29 | 29 | ||
30 | static unsigned long *in_exception_stack(unsigned cpu, unsigned long stack, | 30 | static unsigned long *in_exception_stack(unsigned cpu, unsigned long stack, |