lkml.org 
[lkml]   [2019]   [Nov]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2 1/2] seq_buf: Add printing formatted hex dumps
On Thu,  7 Nov 2019 13:45:37 +0100
Piotr Maziarz <piotrx.maziarz@linux.intel.com> wrote:

> Provided function is an analogue of print_hex_dump().
>
> Implementing this function in seq_buf allows using for multiple
> purposes (e.g. for tracing) and therefore prevents from code duplication
> in every layer that uses seq_buf.
>
> print_hex_dump() is an essential part of logging data to dmesg. Adding
> similar capability for other purposes is beneficial to all users.
>
> Example usage:
> seq_buf_hex_dump(seq, "", DUMP_PREFIX_OFFSET, 16, 4, buf,
> ARRAY_SIZE(buf), true);
> Example output:
> 00000000: 00000000 ffffff10 ffffff32 ffff3210 ........2....2..
> 00000010: ffff3210 83d00437 c0700000 00000000 .2..7.....p.....
> 00000020: 02010004 0000000f 0000000f 00004002 .............@..
> 00000030: 00000fff 00000000 ........
>
> Signed-off-by: Piotr Maziarz <piotrx.maziarz@linux.intel.com>
> Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>

I'm curious about the two signed off bys? Was Cezary a co-author?


> ---
> v2
> Add kernel doc header
> Explain linebuf magic number size
>
> Decided not to change declaration order or remaining -= rowsize to
> remaining -= linelen in order to stay aligned with base print_hex_dump
> function. However I can change it if requested.

I don't care as much to make the change. Perhaps we can clean that up
in the future.

-- Steve

>
> include/linux/seq_buf.h | 3 +++
> lib/seq_buf.c | 62 +++++++++++++++++++++++++++++++++++++++++++++++++
> 2 files changed, 65 insertions(+)
>
>

\
 
 \ /
  Last update: 2019-11-13 22:03    [W:5.360 / U:0.008 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site