lkml.org 
[lkml]   [2019]   [Sep]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2] tracing: Be more clever when dumping hex in __print_hex()
On Tue, Aug 06, 2019 at 11:33:52AM -0400, Steven Rostedt wrote:
> On Tue, 6 Aug 2019 18:15:43 +0300
> Andy Shevchenko <andriy.shevchenko@linux.intel.com> wrote:
>
> > Hex dump as many as 16 bytes at once in trace_print_hex_seq()
> > instead of byte-by-byte approach.

> > + const char *fmt = concatenate ? "%*phN" : "%*ph";
> >
> > + for (i = 0; i < buf_len; i += 16)
> > + trace_seq_printf(p, fmt, min(buf_len - i, 16), &buf[i]);
>
> Cute.
>
> I'll have to wrap my head around it a bit to make sure it's correct.

Anything I need to update here?

--
With Best Regards,
Andy Shevchenko


\
 
 \ /
  Last update: 2019-09-13 14:28    [W:0.075 / U:3.172 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site