RE: [PATCH] mm/slub.c: Use print_hex_dump and remove unnecessary cast

From: H Hartley Sweeten
Date: Wed May 20 2009 - 15:18:37 EST


On Wednesday, May 20, 2009 11:43 AM, Joe Perches wrote:
> On Wed, 2009-05-20 at 14:23 -0400, Christoph Lameter wrote:
>> This was discussed before.
>> http://lkml.indiana.edu/hypermail/linux/kernel/0705.3/2671.html
>
> You've got a good memory.
>
>> Was hexdump changed?
>
> It seems not.
>
>> How does the output look after this change?
>>
>> From reading the code, the last column is unaligned.
>
> I did submit a patch to fix hexdump once.
> http://lkml.org/lkml/2007/12/6/304

>From what I can tell the current code does properly align the
ascii output.

I just chopped the necessary functions out of the kernel and
created a test program. If I pass the string:

"This is a sample buffer"

I get the following output:

prefix_type = DUMP_PREFIX_NONE

<7>buffer: 54 68 69 73 20 69 73 20 61 20 73 61 6d 70 6c 65 This is a sample
<7>buffer: 20 62 75 66 66 65 72 buffer

prefix_type = DUMP_PREFIX_ADDRESS

<7>buffer: 0x804a008: 54 68 69 73 20 69 73 20 61 20 73 61 6d 70 6c 65 This is a sample
<7>buffer: 0x804a018: 20 62 75 66 66 65 72 buffer

prefix_type = DUMP_PREFIX_OFFSET

<7>buffer: 00000000: 54 68 69 73 20 69 73 20 61 20 73 61 6d 70 6c 65 This is a sample
<7>buffer: 00000010: 20 62 75 66 66 65 72 buffer

Regards,
Hartley
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/