mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Randy Dunlap <randy.dunlap@oracle.com>
To: Hugh Dickins <hugh@veritas.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	Jayson Santos <jaysonsantos2003@yahoo.com.br>,
	linux-kernel@vger.kernel.org
Subject: [PATCH 3/3 -mm] prio_tree: use lib/hexdump
Date: Wed, 30 May 2007 14:35:15 -0700	[thread overview]
Message-ID: <20070530143515.9642b45c.randy.dunlap@oracle.com> (raw)
In-Reply-To: <Pine.LNX.4.64.0705151953050.30826@blonde.wat.veritas.com>

On Tue, 15 May 2007 19:56:31 +0100 (BST) Hugh Dickins wrote:

> So dump vma and the one it's supposed to resemble: I had expected to use
> print_hex_dump(), but that's designed for u8 dumps, whereas almost every
> field of vm_area_struct is either a pointer or an unsigned long - which
> look nonsense dumped as u8s.

From: Randy Dunlap <randy.dunlap@oracle.com>

Use modified lib/hexdump in mm/prio_tree dump_vma().

Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
---
 mm/prio_tree.c |   13 +++----------
 1 file changed, 3 insertions(+), 10 deletions(-)

--- linux-2622-rc2mm1-slub.orig/mm/prio_tree.c
+++ linux-2622-rc2mm1-slub/mm/prio_tree.c
@@ -69,16 +69,9 @@
 
 static void dump_vma(struct vm_area_struct *vma)
 {
-	void **ptr = (void **) vma;
-	int i;
-
-	printk("vm_area_struct at %p:", ptr);
-	for (i = 0; i < sizeof(*vma)/sizeof(*ptr); i++, ptr++) {
-		if (!(i & 3))
-			printk("\n");
-		printk(" %p", *ptr);
-	}
-	printk("\n");
+	printk("vm_area_struct at %p:\n", vma);
+	print_hex_dump("", " ", DUMP_PREFIX_NONE, 32, sizeof(void *),
+		vma, sizeof(*vma), 0);
 }
 
 /*

      reply	other threads:[~2007-05-30 21:36 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-05-15 18:56 [PATCH] prio_tree: debugging patch Hugh Dickins
2007-05-30 21:35 ` Randy Dunlap [this message]

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=20070530143515.9642b45c.randy.dunlap@oracle.com \
    --to=randy.dunlap@oracle.com \
    --cc=akpm@linux-foundation.org \
    --cc=hugh@veritas.com \
    --cc=jaysonsantos2003@yahoo.com.br \
    --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

all inboxes | Powered by JetHome®