linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Christoph Lameter <cl@linux-foundation.org>
To: Joe Perches <joe@perches.com>
Cc: linux-kernel@vger.kernel.org,
	H Hartley Sweeten <hartleys@visionengravers.com>,
	linux-mm@kvack.org, Matt Mackall <mpm@selenic.com>,
	Pekka Enberg <penberg@cs.helsinki.fi>,
	Ingo Molnar <mingo@elte.hu>, David Rientjes <rientjes@google.com>,
	Eduard - Gabriel Munteanu <eduard.munteanu@linux360.ro>
Subject: Re: [PATCH] mm/slub.c: Use print_hex_dump and remove unnecessary cast
Date: Wed, 20 May 2009 14:23:00 -0400 (EDT)	[thread overview]
Message-ID: <alpine.DEB.1.10.0905201420050.17511@qirst.com> (raw)
In-Reply-To: <1242840314-25635-1-git-send-email-joe@perches.com>

This was discussed before.

http://lkml.indiana.edu/hypermail/linux/kernel/0705.3/2671.html

Was hexdump changed? How does the output look after this change?

On Wed, 20 May 2009, Joe Perches wrote:

> Signed-off-by: Joe Perches <joe@perches.com>
> ---
>  mm/slub.c |   34 ++++------------------------------
>  1 files changed, 4 insertions(+), 30 deletions(-)
>
> diff --git a/mm/slub.c b/mm/slub.c
> index 65ffda5..5b616d6 100644
> --- a/mm/slub.c
> +++ b/mm/slub.c
> @@ -328,36 +328,10 @@ static char *slub_debug_slabs;
>  /*
>   * Object debugging
>   */
> -static void print_section(char *text, u8 *addr, unsigned int length)
> +static void print_section(const 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(KERN_CONT " %02x", addr[i]);
> -		offset = i % 16;
> -		ascii[offset] = isgraph(addr[i]) ? addr[i] : '.';
> -		if (offset == 15) {
> -			printk(KERN_CONT " %s\n", ascii);
> -			newline = 1;
> -		}
> -	}
> -	if (!newline) {
> -		i %= 16;
> -		while (i < 16) {
> -			printk(KERN_CONT "   ");
> -			ascii[i] = ' ';
> -			i++;
> -		}
> -		printk(KERN_CONT " %s\n", ascii);
> -	}
> +	print_hex_dump(KERN_ERR, text, DUMP_PREFIX_ADDRESS, 16, 1,
> +		       addr, length, true);
>  }
>
>  static struct track *get_track(struct kmem_cache *s, void *object,
> @@ -794,7 +768,7 @@ static void trace(struct kmem_cache *s, struct page *page, void *object,
>  			page->freelist);
>
>  		if (!alloc)
> -			print_section("Object", (void *)object, s->objsize);
> +			print_section("Object", object, s->objsize);
>
>  		dump_stack();
>  	}
>

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

  reply	other threads:[~2009-05-20 18:22 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-05-20 17:25 Joe Perches
2009-05-20 18:23 ` Christoph Lameter [this message]
2009-05-20 18:42   ` Joe Perches
2009-05-20 19:18     ` H Hartley Sweeten
2009-05-22  8:04 ` Pekka Enberg

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=alpine.DEB.1.10.0905201420050.17511@qirst.com \
    --to=cl@linux-foundation.org \
    --cc=eduard.munteanu@linux360.ro \
    --cc=hartleys@visionengravers.com \
    --cc=joe@perches.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mingo@elte.hu \
    --cc=mpm@selenic.com \
    --cc=penberg@cs.helsinki.fi \
    --cc=rientjes@google.com \
    /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