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>
This commit is contained in:
Родитель
bce7f793da
Коммит
7daf705f36
|
@ -104,30 +104,7 @@ int kstack_depth_to_print = 12;
|
||||||
|
|
||||||
void printk_address(unsigned long address, int reliable)
|
void printk_address(unsigned long address, int reliable)
|
||||||
{
|
{
|
||||||
#ifdef CONFIG_KALLSYMS
|
printk(" [<%016lx>] %s%pS\n", address, reliable ? "": "? ", (void *) address);
|
||||||
unsigned long offset = 0, symsize;
|
|
||||||
const char *symname;
|
|
||||||
char *modname;
|
|
||||||
char *delim = ":";
|
|
||||||
char namebuf[KSYM_NAME_LEN];
|
|
||||||
char reliab[4] = "";
|
|
||||||
|
|
||||||
symname = kallsyms_lookup(address, &symsize, &offset,
|
|
||||||
&modname, namebuf);
|
|
||||||
if (!symname) {
|
|
||||||
printk(" [<%016lx>]\n", address);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (!reliable)
|
|
||||||
strcpy(reliab, "? ");
|
|
||||||
|
|
||||||
if (!modname)
|
|
||||||
modname = delim = "";
|
|
||||||
printk(" [<%016lx>] %s%s%s%s%s+0x%lx/0x%lx\n",
|
|
||||||
address, reliab, delim, modname, delim, symname, offset, symsize);
|
|
||||||
#else
|
|
||||||
printk(" [<%016lx>]\n", address);
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static unsigned long *in_exception_stack(unsigned cpu, unsigned long stack,
|
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)
|
||||||
if (!t->addr)
|
if (!t->addr)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
printk(KERN_ERR "INFO: %s in ", s);
|
printk(KERN_ERR "INFO: %s in %pS age=%lu cpu=%u pid=%d\n",
|
||||||
__print_symbol("%s", (unsigned long)t->addr);
|
s, t->addr, jiffies - t->when, t->cpu, t->pid);
|
||||||
printk(" age=%lu cpu=%u pid=%d\n", jiffies - t->when, t->cpu, t->pid);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void print_tracking(struct kmem_cache *s, void *object)
|
static void print_tracking(struct kmem_cache *s, void *object)
|
||||||
|
|
Загрузка…
Ссылка в новой задаче