Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1760951AbXE3WHF (ORCPT ); Wed, 30 May 2007 18:07:05 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1760444AbXE3WGq (ORCPT ); Wed, 30 May 2007 18:06:46 -0400 Received: from agminet01.oracle.com ([141.146.126.228]:19071 "EHLO agminet01.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1760389AbXE3WGo (ORCPT ); Wed, 30 May 2007 18:06:44 -0400 Message-ID: <465DF566.7000000@oracle.com> Date: Wed, 30 May 2007 15:06:30 -0700 From: Randy Dunlap User-Agent: Thunderbird 1.5.0.5 (X11/20060719) MIME-Version: 1.0 To: Christoph Lameter CC: Andrew Morton , linux-kernel@vger.kernel.org Subject: Re: [PATCH 2/3 -mm] slub: use lib/hexdump References: <20070523004233.5ae5f6fd.akpm@linux-foundation.org> <4654AC94.6080601@googlemail.com> <20070523150122.f9946f37.akpm@linux-foundation.org> <20070523153730.e0e9e91d.akpm@linux-foundation.org> <20070523182145.7d7f1f7e.randy.dunlap@oracle.com> <20070524073131.GA17501@elte.hu> <20070524142908.f39f42ea.akpm@linux-foundation.org> <20070524145517.1f32cd94.randy.dunlap@oracle.com> <20070530143451.f4a844bc.randy.dunlap@oracle.com> <465DF135.80202@oracle.com> <465DF2A2.2070801@oracle.com> In-Reply-To: Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit X-Whitelist: TRUE X-Whitelist: TRUE X-Brightmail-Tracker: AAAAAQAAAAI= Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1632 Lines: 63 Christoph Lameter wrote: > I'd prefer something like this: > > Use hexdump in slub. Sure, that's fine. > Signed-off-by: Christoph Lameter > > Index: slub/mm/slub.c > =================================================================== > --- slub.orig/mm/slub.c 2007-05-30 14:56:14.000000000 -0700 > +++ slub/mm/slub.c 2007-05-30 15:01:33.000000000 -0700 > @@ -339,34 +339,10 @@ static char *slub_debug_slabs; > */ > 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 "%8s 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); > - } > + char buf[10]; > + > + sprintf(buf, "%8s:", text); > + print_hex_dump(KERN_ERR, buf, DUMP_PREFIX_ADDRESS, 16, 1, addr, length, 1); > } > > static struct track *get_track(struct kmem_cache *s, void *object, > -- ~Randy *** Remember to use Documentation/SubmitChecklist when testing your code *** - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/