Commit 9f930d75 authored by Andrew Morton's avatar Andrew Morton Committed by James Bottomley

[PATCH] slab debug: symbolic output in caller tracking

use print_symbol() to decode the offender's program counter.
parent 2bf34c12
...@@ -82,6 +82,7 @@ ...@@ -82,6 +82,7 @@
#include <linux/compiler.h> #include <linux/compiler.h>
#include <linux/seq_file.h> #include <linux/seq_file.h>
#include <linux/notifier.h> #include <linux/notifier.h>
#include <linux/kallsyms.h>
#include <asm/uaccess.h> #include <asm/uaccess.h>
/* /*
...@@ -801,11 +802,15 @@ static void check_poison_obj(kmem_cache_t *cachep, void *addr) ...@@ -801,11 +802,15 @@ static void check_poison_obj(kmem_cache_t *cachep, void *addr)
printk(KERN_ERR "Slab corruption: start=%p, expend=%p, " printk(KERN_ERR "Slab corruption: start=%p, expend=%p, "
"problemat=%p\n", addr, addr+size-1, end); "problemat=%p\n", addr, addr+size-1, end);
if (cachep->flags & SLAB_STORE_USER) { if (cachep->flags & SLAB_STORE_USER) {
void *pc;
if (cachep->flags & SLAB_RED_ZONE) if (cachep->flags & SLAB_RED_ZONE)
printk(KERN_ERR "Last user: [<%p>]\n", *(void**)(addr+size+BYTES_PER_WORD)); pc = *(void**)(addr+size+BYTES_PER_WORD);
else else
printk(KERN_ERR "Last user: [<%p>]\n", *(void**)(addr+size)); pc = *(void**)(addr+size);
printk(KERN_ERR "Last user: [<%p>]", pc);
print_symbol("(%s)", (unsigned long)pc);
printk("\n");
} }
printk(KERN_ERR "Data: "); printk(KERN_ERR "Data: ");
for (s = 0; s < size; s++) { for (s = 0; s < size; s++) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment