aboutsummaryrefslogtreecommitdiffstats
path: root/mm/slub.c
diff options
context:
space:
mode:
Diffstat (limited to 'mm/slub.c')
-rw-r--r--mm/slub.c44
1 files changed, 9 insertions, 35 deletions
diff --git a/mm/slub.c b/mm/slub.c
index eb5a8f93338a..2dc22160aff1 100644
--- a/mm/slub.c
+++ b/mm/slub.c
@@ -467,34 +467,8 @@ static int disable_higher_order_debug;
467 */ 467 */
468static void print_section(char *text, u8 *addr, unsigned int length) 468static void print_section(char *text, u8 *addr, unsigned int length)
469{ 469{
470 int i, offset; 470 print_hex_dump(KERN_ERR, text, DUMP_PREFIX_ADDRESS, 16, 1, addr,
471 int newline = 1; 471 length, 1);
472 char ascii[17];
473
474 ascii[16] = 0;
475
476 for (i = 0; i < length; i++) {
477 if (newline) {
478 printk(KERN_ERR "%8s 0x%p: ", text, addr + i);
479 newline = 0;
480 }
481 printk(KERN_CONT " %02x", addr[i]);
482 offset = i % 16;
483 ascii[offset] = isgraph(addr[i]) ? addr[i] : '.';
484 if (offset == 15) {
485 printk(KERN_CONT " %s\n", ascii);
486 newline = 1;
487 }
488 }
489 if (!newline) {
490 i %= 16;
491 while (i < 16) {
492 printk(KERN_CONT " ");
493 ascii[i] = ' ';
494 i++;
495 }
496 printk(KERN_CONT " %s\n", ascii);
497 }
498} 472}
499 473
500static struct track *get_track(struct kmem_cache *s, void *object, 474static struct track *get_track(struct kmem_cache *s, void *object,
@@ -625,12 +599,12 @@ static void print_trailer(struct kmem_cache *s, struct page *page, u8 *p)
625 p, p - addr, get_freepointer(s, p)); 599 p, p - addr, get_freepointer(s, p));
626 600
627 if (p > addr + 16) 601 if (p > addr + 16)
628 print_section("Bytes b4", p - 16, 16); 602 print_section("Bytes b4 ", p - 16, 16);
629
630 print_section("Object", p, min_t(unsigned long, s->objsize, PAGE_SIZE));
631 603
604 print_section("Object ", p, min_t(unsigned long, s->objsize,
605 PAGE_SIZE));
632 if (s->flags & SLAB_RED_ZONE) 606 if (s->flags & SLAB_RED_ZONE)
633 print_section("Redzone", p + s->objsize, 607 print_section("Redzone ", p + s->objsize,
634 s->inuse - s->objsize); 608 s->inuse - s->objsize);
635 609
636 if (s->offset) 610 if (s->offset)
@@ -643,7 +617,7 @@ static void print_trailer(struct kmem_cache *s, struct page *page, u8 *p)
643 617
644 if (off != s->size) 618 if (off != s->size)
645 /* Beginning of the filler is the free pointer */ 619 /* Beginning of the filler is the free pointer */
646 print_section("Padding", p + off, s->size - off); 620 print_section("Padding ", p + off, s->size - off);
647 621
648 dump_stack(); 622 dump_stack();
649} 623}
@@ -838,7 +812,7 @@ static int slab_pad_check(struct kmem_cache *s, struct page *page)
838 end--; 812 end--;
839 813
840 slab_err(s, page, "Padding overwritten. 0x%p-0x%p", fault, end - 1); 814 slab_err(s, page, "Padding overwritten. 0x%p-0x%p", fault, end - 1);
841 print_section("Padding", end - remainder, remainder); 815 print_section("Padding ", end - remainder, remainder);
842 816
843 restore_bytes(s, "slab padding", POISON_INUSE, end - remainder, end); 817 restore_bytes(s, "slab padding", POISON_INUSE, end - remainder, end);
844 return 0; 818 return 0;
@@ -987,7 +961,7 @@ static void trace(struct kmem_cache *s, struct page *page, void *object,
987 page->freelist); 961 page->freelist);
988 962
989 if (!alloc) 963 if (!alloc)
990 print_section("Object", (void *)object, s->objsize); 964 print_section("Object ", (void *)object, s->objsize);
991 965
992 dump_stack(); 966 dump_stack();
993 } 967 }