Commit 119cdbdb authored by Andy Shevchenko's avatar Andy Shevchenko Committed by Steven Rostedt (VMware)

tracing: Be more clever when dumping hex in __print_hex()

Hex dump as many as 16 bytes at once in trace_print_hex_seq()
instead of byte-by-byte approach.

Link: http://lkml.kernel.org/r/20190806151543.86061-1-andriy.shevchenko@linux.intel.comSigned-off-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: default avatarSteven Rostedt (VMware) <rostedt@goodmis.org>
parent 08468754
...@@ -219,10 +219,10 @@ trace_print_hex_seq(struct trace_seq *p, const unsigned char *buf, int buf_len, ...@@ -219,10 +219,10 @@ trace_print_hex_seq(struct trace_seq *p, const unsigned char *buf, int buf_len,
{ {
int i; int i;
const char *ret = trace_seq_buffer_ptr(p); const char *ret = trace_seq_buffer_ptr(p);
const char *fmt = concatenate ? "%*phN" : "%*ph";
for (i = 0; i < buf_len; i++) for (i = 0; i < buf_len; i += 16)
trace_seq_printf(p, "%s%2.2x", concatenate || i == 0 ? "" : " ", trace_seq_printf(p, fmt, min(buf_len - i, 16), &buf[i]);
buf[i]);
trace_seq_putc(p, 0); trace_seq_putc(p, 0);
return ret; return ret;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment