diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2008-07-14 15:12:53 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-07-14 15:12:53 -0400 |
commit | 7daf705f362e349983e92037a198b8821db198af (patch) | |
tree | cf51f77b975718852dc5819dfe90c02a1c1a6bd5 | |
parent | bce7f793daec3e65ec5c5705d2457b81fe7b5725 (diff) |
Start using the new '%pS' infrastructure to print symbols
This simplifies the code significantly, and was the whole point of the
exercise.
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r-- | arch/x86/kernel/traps_64.c | 25 | ||||
-rw-r--r-- | mm/slub.c | 5 |
2 files changed, 3 insertions, 27 deletions
diff --git a/arch/x86/kernel/traps_64.c b/arch/x86/kernel/traps_64.c index adff76ea97c4..f1a95d105953 100644 --- a/arch/x86/kernel/traps_64.c +++ b/arch/x86/kernel/traps_64.c | |||
@@ -104,30 +104,7 @@ int kstack_depth_to_print = 12; | |||
104 | 104 | ||
105 | void printk_address(unsigned long address, int reliable) | 105 | void printk_address(unsigned long address, int reliable) |
106 | { | 106 | { |
107 | #ifdef CONFIG_KALLSYMS | 107 | printk(" [<%016lx>] %s%pS\n", address, reliable ? "": "? ", (void *) address); |
108 | unsigned long offset = 0, symsize; | ||
109 | const char *symname; | ||
110 | char *modname; | ||
111 | char *delim = ":"; | ||
112 | char namebuf[KSYM_NAME_LEN]; | ||
113 | char reliab[4] = ""; | ||
114 | |||
115 | symname = kallsyms_lookup(address, &symsize, &offset, | ||
116 | &modname, namebuf); | ||
117 | if (!symname) { | ||
118 | printk(" [<%016lx>]\n", address); | ||
119 | return; | ||
120 | } | ||
121 | if (!reliable) | ||
122 | strcpy(reliab, "? "); | ||
123 | |||
124 | if (!modname) | ||
125 | modname = delim = ""; | ||
126 | printk(" [<%016lx>] %s%s%s%s%s+0x%lx/0x%lx\n", | ||
127 | address, reliab, delim, modname, delim, symname, offset, symsize); | ||
128 | #else | ||
129 | printk(" [<%016lx>]\n", address); | ||
130 | #endif | ||
131 | } | 108 | } |
132 | 109 | ||
133 | static unsigned long *in_exception_stack(unsigned cpu, unsigned long stack, | 110 | static unsigned long *in_exception_stack(unsigned cpu, unsigned long stack, |
@@ -431,9 +431,8 @@ static void print_track(const char *s, struct track *t) | |||
431 | if (!t->addr) | 431 | if (!t->addr) |
432 | return; | 432 | return; |
433 | 433 | ||
434 | printk(KERN_ERR "INFO: %s in ", s); | 434 | printk(KERN_ERR "INFO: %s in %pS age=%lu cpu=%u pid=%d\n", |
435 | __print_symbol("%s", (unsigned long)t->addr); | 435 | s, t->addr, jiffies - t->when, t->cpu, t->pid); |
436 | printk(" age=%lu cpu=%u pid=%d\n", jiffies - t->when, t->cpu, t->pid); | ||
437 | } | 436 | } |
438 | 437 | ||
439 | static void print_tracking(struct kmem_cache *s, void *object) | 438 | static void print_tracking(struct kmem_cache *s, void *object) |