[PATCH 3/3 -mm] prio_tree: use lib/hexdump

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 <[email protected]>

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

Signed-off-by: Randy Dunlap <[email protected]>
---
 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);
 }
 
 /*
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux