Skip to content

Commit 119cdbd

Browse files
andy-shevrostedt
authored andcommitted
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/[email protected] Signed-off-by: Andy Shevchenko <[email protected]> Signed-off-by: Steven Rostedt (VMware) <[email protected]>
1 parent 0846875 commit 119cdbd

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

kernel/trace/trace_output.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -219,10 +219,10 @@ trace_print_hex_seq(struct trace_seq *p, const unsigned char *buf, int buf_len,
219219
{
220220
int i;
221221
const char *ret = trace_seq_buffer_ptr(p);
222+
const char *fmt = concatenate ? "%*phN" : "%*ph";
222223

223-
for (i = 0; i < buf_len; i++)
224-
trace_seq_printf(p, "%s%2.2x", concatenate || i == 0 ? "" : " ",
225-
buf[i]);
224+
for (i = 0; i < buf_len; i += 16)
225+
trace_seq_printf(p, fmt, min(buf_len - i, 16), &buf[i]);
226226
trace_seq_putc(p, 0);
227227

228228
return ret;

0 commit comments

Comments
 (0)