From: Randy Dunlap <randy.dunlap@oracle.com>
To: Christoph Lameter <clameter@sgi.com>
Cc: Andrew Morton <akpm@linux-foundation.org>, linux-kernel@vger.kernel.org
Subject: [PATCH 2/3 -mm] slub: use lib/hexdump
Date: Wed, 30 May 2007 14:34:51 -0700 [thread overview]
Message-ID: <20070530143451.f4a844bc.randy.dunlap@oracle.com> (raw)
In-Reply-To: <Pine.LNX.4.64.0705241533510.32401@schroedinger.engr.sgi.com>
From: Randy Dunlap <randy.dunlap@oracle.com>
Convert slub error memory dump functions to use lib/hexdump routines.
Completely eliminate slub's print_section() function.
Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
---
mm/slub.c | 53 ++++++++++++-----------------------------------------
1 file changed, 12 insertions(+), 41 deletions(-)
--- linux-2622-rc2mm1-slub.orig/mm/slub.c
+++ linux-2622-rc2mm1-slub/mm/slub.c
@@ -8,6 +8,7 @@
* (C) 2007 SGI, Christoph Lameter <clameter@sgi.com>
*/
+#include <linux/kernel.h>
#include <linux/mm.h>
#include <linux/module.h>
#include <linux/bit_spinlock.h>
@@ -334,41 +335,6 @@ static int slub_debug;
static char *slub_debug_slabs;
-/*
- * Object debugging
- */
-static void print_section(char *text, u8 *addr, unsigned int length)
-{
- int i, offset;
- int newline = 1;
- char ascii[17];
-
- ascii[16] = 0;
-
- for (i = 0; i < length; i++) {
- if (newline) {
- printk(KERN_ERR "%10s 0x%p: ", text, addr + i);
- newline = 0;
- }
- printk(" %02x", addr[i]);
- offset = i % 16;
- ascii[offset] = isgraph(addr[i]) ? addr[i] : '.';
- if (offset == 15) {
- printk(" %s\n",ascii);
- newline = 1;
- }
- }
- if (!newline) {
- i %= 16;
- while (i < 16) {
- printk(" ");
- ascii[i] = ' ';
- i++;
- }
- printk(" %s\n", ascii);
- }
-}
-
static struct track *get_track(struct kmem_cache *s, void *object,
enum track_item alloc)
{
@@ -425,8 +391,8 @@ static void print_trailer(struct kmem_ca
unsigned int off; /* Offset of last byte */
if (s->flags & SLAB_RED_ZONE)
- print_section("Redzone", p + s->objsize,
- s->inuse - s->objsize);
+ print_hex_dump(KERN_ERR, " Redzone ", DUMP_PREFIX_ADDRESS,
+ 16, 1, p + s->objsize, s->inuse - s->objsize, 1);
printk(KERN_ERR "FreePointer 0x%p -> 0x%p\n",
p + s->offset,
@@ -445,7 +411,8 @@ static void print_trailer(struct kmem_ca
if (off != s->size)
/* Beginning of the filler is the free pointer */
- print_section("Filler", p + off, s->size - off);
+ print_hex_dump(KERN_ERR, " Filler ", DUMP_PREFIX_ADDRESS,
+ 16, 1, p + off, s->size - off, 1);
}
static void object_err(struct kmem_cache *s, struct page *page,
@@ -458,8 +425,10 @@ static void object_err(struct kmem_cache
printk(KERN_ERR " offset=%tu flags=0x%04lx inuse=%u freelist=0x%p\n",
object - addr, page->flags, page->inuse, page->freelist);
if (object > addr + 16)
- print_section("Bytes b4", object - 16, 16);
- print_section("Object", object, min(s->objsize, 128));
+ print_hex_dump(KERN_ERR, " Bytes b4 ", DUMP_PREFIX_ADDRESS,
+ 16, 1, object - 16, 16, 1);
+ print_hex_dump(KERN_ERR, " Object ", DUMP_PREFIX_ADDRESS, 16, 1,
+ object, min(s->objsize, 128), 1);
print_trailer(s, object);
dump_stack();
}
@@ -759,7 +728,9 @@ static void trace(struct kmem_cache *s,
page->freelist);
if (!alloc)
- print_section("Object", (void *)object, s->objsize);
+ print_hex_dump(KERN_ERR, " Object ",
+ DUMP_PREFIX_ADDRESS, 16, 1,
+ (void *)object, s->objsize, 1);
dump_stack();
}
next prev parent reply other threads:[~2007-05-30 21:36 UTC|newest]
Thread overview: 104+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-05-23 7:42 2.6.22-rc2-mm1 Andrew Morton
2007-05-23 7:48 ` 2.6.22-rc2-mm1 Andrew Morton
2007-05-23 9:22 ` 2.6.22-rc2-mm1 Rafael J. Wysocki
2007-05-23 14:47 ` 2.6.22-rc2-mm1 Alan Stern
2007-05-23 15:54 ` 2.6.22-rc2-mm1 Andrew Morton
2007-05-23 16:09 ` 2.6.22-rc2-mm1 Oleg Nesterov
2007-05-23 17:00 ` 2.6.22-rc2-mm1 Alan Stern
2007-05-23 16:21 ` 2.6.22-rc2-mm1 Oleg Nesterov
2007-05-23 18:41 ` 2.6.22-rc2-mm1 Alan Stern
2007-05-23 9:47 ` 2.6.22-rc2-mm1 Michal Piotrowski
2007-05-23 17:18 ` 2.6.22-rc2-mm1 Christoph Lameter
2007-05-23 21:05 ` 2.6.22-rc2-mm1 Michal Piotrowski
2007-05-23 22:01 ` 2.6.22-rc2-mm1 Andrew Morton
2007-05-23 22:18 ` 2.6.22-rc2-mm1 Michal Piotrowski
2007-05-23 22:27 ` 2.6.22-rc2-mm1 Christoph Lameter
2007-05-23 22:37 ` 2.6.22-rc2-mm1 Andrew Morton
2007-05-23 23:36 ` 2.6.22-rc2-mm1 Christoph Lameter
2007-05-24 1:21 ` 2.6.22-rc2-mm1 Randy Dunlap
2007-05-24 2:43 ` 2.6.22-rc2-mm1 Christoph Lameter
2007-05-24 3:00 ` 2.6.22-rc2-mm1 Christoph Lameter
2007-05-24 3:26 ` 2.6.22-rc2-mm1 Randy Dunlap
2007-05-24 7:31 ` 2.6.22-rc2-mm1 Ingo Molnar
2007-05-24 16:40 ` 2.6.22-rc2-mm1 Christoph Lameter
2007-05-24 21:20 ` 2.6.22-rc2-mm1 Christoph Lameter
2007-05-24 21:29 ` 2.6.22-rc2-mm1 Andrew Morton
2007-05-24 21:55 ` 2.6.22-rc2-mm1 Randy Dunlap
2007-05-24 22:35 ` 2.6.22-rc2-mm1 Christoph Lameter
2007-05-24 22:53 ` 2.6.22-rc2-mm1 Andrew Morton
2007-05-30 21:34 ` [PATCH 1/3] hexdump: more output formatting Randy Dunlap
2007-05-30 21:42 ` Christoph Lameter
2007-05-30 21:45 ` Randy Dunlap
2007-05-31 1:45 ` [PATCH 1/3 v2] " Randy Dunlap
2007-05-30 21:56 ` [PATCH 1/3] " Satyam Sharma
2007-05-30 22:03 ` Randy Dunlap
2007-05-30 22:11 ` Satyam Sharma
2007-05-30 22:18 ` Christoph Lameter
2007-05-30 22:41 ` Satyam Sharma
2007-05-30 22:44 ` Randy Dunlap
2007-05-30 22:48 ` Satyam Sharma
2007-05-30 22:59 ` Randy Dunlap
2007-05-30 22:25 ` Randy Dunlap
2007-05-30 22:36 ` Jesper Juhl
2007-05-30 23:04 ` Randy Dunlap
2007-05-30 23:07 ` Jesper Juhl
2007-05-30 21:34 ` Randy Dunlap [this message]
2007-05-30 21:45 ` [PATCH 2/3 -mm] slub: use lib/hexdump Christoph Lameter
2007-05-30 21:48 ` Randy Dunlap
2007-05-30 21:51 ` Christoph Lameter
2007-05-30 21:54 ` Randy Dunlap
2007-05-30 22:03 ` Christoph Lameter
2007-05-30 22:06 ` Randy Dunlap
2007-05-31 1:39 ` Randy Dunlap
2007-05-23 22:24 ` 2.6.22-rc2-mm1 Christoph Lameter
2007-05-23 12:01 ` 2.6.22-rc2-mm1 Gabriel C
2007-05-23 16:01 ` 2.6.22-rc2-mm1 Andrew Morton
2007-05-23 15:02 ` 2.6.22-rc2-mm1 William Lee Irwin III
2007-05-23 15:28 ` 2.6.22-rc2-mm1 William Lee Irwin III
2007-05-23 16:08 ` 2.6.22-rc2-mm1 William Lee Irwin III
2007-05-23 16:29 ` 2.6.22-rc2-mm1 William Lee Irwin III
2007-05-23 17:27 ` 2.6.22-rc2-mm1 William Lee Irwin III
2007-05-23 23:17 ` 2.6.22-rc2-mm1 Zan Lynx
2007-05-23 23:27 ` 2.6.22-rc2-mm1 Andrew Morton
2007-05-23 23:40 ` 2.6.22-rc2-mm1 Jiri Kosina
2007-05-24 3:28 ` 2.6.22-rc2-mm1 Dmitry Torokhov
2007-05-24 7:28 ` 2.6.22-rc2-mm1 Jiri Kosina
2007-05-30 14:08 ` [PATCH] Input: i8042 - cleanup of debug code (was Re: 2.6.22-rc2-mm1) Jiri Kosina
2007-05-30 14:27 ` Dmitry Torokhov
2007-05-30 14:30 ` Jiri Kosina
[not found] ` <1180058760.7001.6.camel@oberon.rnd.esoft.com>
2007-05-25 7:23 ` 2.6.22-rc2-mm1 Jiri Kosina
2007-05-23 23:50 ` 2.6.22-rc2-mm1 Andrew Morton
2007-05-24 10:36 ` rmmod e1000 hangs (Was Re: 2.6.22-rc2-mm1) Jeremy Fitzhardinge
2007-05-24 10:47 ` Herbert Xu
2007-05-24 10:54 ` Herbert Xu
2007-05-24 14:44 ` Kok, Auke
2007-05-25 12:54 ` Herbert Xu
2007-05-25 13:04 ` Herbert Xu
2007-05-25 13:32 ` Herbert Xu
2007-05-25 22:12 ` Kok, Auke
2007-05-25 23:48 ` Jeff Garzik
2007-05-26 0:10 ` Herbert Xu
2007-05-25 21:20 ` idle=poll burns my box [was Re: 2.6.22-rc2-mm1] J.A. Magallón
2007-05-25 21:52 ` Andrew Morton
2007-05-26 15:59 ` 2.6.22-rc2-mm1 Tilman Schmidt
2007-05-26 16:01 ` 2.6.22-rc2-mm1 Andrew Morton
2007-05-27 22:16 ` 2.6.22-rc2-mm1 Tilman Schmidt
2007-05-27 22:41 ` 2.6.22-rc2-mm1 Kay Sievers
2007-05-28 17:22 ` 2.6.22-rc2-mm1 Cornelia Huck
2007-05-29 7:56 ` 2.6.22-rc2-mm1 Kay Sievers
2007-05-29 7:25 ` 2.6.22-rc2-mm1 Cornelia Huck
2007-05-29 14:43 ` 2.6.22-rc2-mm1 Matt Mackall
2007-05-29 16:55 ` 2.6.22-rc2-mm1 Tilman Schmidt
2007-05-29 17:25 ` 2.6.22-rc2-mm1 Cornelia Huck
2007-06-01 12:38 ` 2.6.22-rc2-mm1 Greg KH
2007-07-03 8:50 ` 2.6.22-rc2-mm1 Cornelia Huck
2007-07-12 6:00 ` 2.6.22-rc2-mm1 Greg KH
2007-05-28 10:27 ` 2.6.22-rc2-mm1 - a different BUG: at mm/slab.c:777 __find_general_cachep() Valdis.Kletnieks
2007-05-28 10:43 ` Pekka Enberg
2007-05-28 11:12 ` Valdis.Kletnieks
2007-05-29 4:22 ` 2.6.22-rc2-mm1: SLUB Randy Dunlap
2007-05-29 17:13 ` Christoph Lameter
2007-05-29 18:13 ` Randy Dunlap
2007-05-29 18:30 ` Christoph Lameter
2007-05-29 18:32 ` Christoph Lameter
2007-05-29 18:59 ` Randy Dunlap
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20070530143451.f4a844bc.randy.dunlap@oracle.com \
--to=randy.dunlap@oracle.com \
--cc=akpm@linux-foundation.org \
--cc=clameter@sgi.com \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome