Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

seq_buf: Make trace_seq_putmem_hex() support data longer than 8

Since the raw memory 'data' does not go forward, it will dump repeated
data if the data length is more than 8. If we want to dump longer data
blocks, we need to repeatedly call macro SEQ_PUT_HEX_FIELD. I think it
is a bit redundant, and multiple function calls also affect the performance.

Link: https://lore.kernel.org/lkml/20210625122453.5e2fe304@oasis.local.home/
Link: https://lkml.kernel.org/r/20210626032156.47889-2-yun.zhou@windriver.com

Cc: stable@vger.kernel.org
Fixes: 6d2289f3faa7 ("tracing: Make trace_seq_putmem_hex() more robust")
Signed-off-by: Yun Zhou <yun.zhou@windriver.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>

authored by

Yun Zhou and committed by
Steven Rostedt (VMware)
6a2cbc58 d3b16034

+3 -1
+3 -1
lib/seq_buf.c
··· 245 245 break; 246 246 247 247 /* j increments twice per loop */ 248 - len -= j / 2; 249 248 hex[j++] = ' '; 250 249 251 250 seq_buf_putmem(s, hex, j); 252 251 if (seq_buf_has_overflowed(s)) 253 252 return -1; 253 + 254 + len -= start_len; 255 + data += start_len; 254 256 } 255 257 return 0; 256 258 }