From 39a0d5c32b0ee85af1ecefedaec659e6184ea56a Mon Sep 17 00:00:00 2001 From: Kent Overstreet Date: Fri, 20 May 2022 14:26:53 -0400 Subject: tracing: Convert to printbuf This converts the seq_bufs in dynevent_cmd and trace_seq to printbufs. - read_pos in seq_buf doesn't exist in printbuf, so is added to trace_seq - seq_buf_to_user doesn't have a printbuf equivalent, so is inlined into trace_seq_to_user - seq_buf_putmem_hex currently swabs bytes on little endian, hardcoded to 8 byte units. This patch switches it to prt_hex_bytes(), which does _not_ swab. Otherwise this is largely a direct conversion, with a few slight refactorings and cleanups. Signed-off-by: Kent Overstreet Cc: Steven Rostedt Cc: Ingo Molnar --- kernel/trace/trace_functions_graph.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'kernel/trace/trace_functions_graph.c') diff --git a/kernel/trace/trace_functions_graph.c b/kernel/trace/trace_functions_graph.c index 203204cadf92..9f270fdde99b 100644 --- a/kernel/trace/trace_functions_graph.c +++ b/kernel/trace/trace_functions_graph.c @@ -1022,9 +1022,9 @@ print_graph_comment(struct trace_seq *s, struct trace_entry *ent, goto out; /* Strip ending newline */ - if (s->buffer[s->seq.len - 1] == '\n') { - s->buffer[s->seq.len - 1] = '\0'; - s->seq.len--; + if (s->buffer[s->seq.pos - 1] == '\n') { + s->buffer[s->seq.pos - 1] = '\0'; + s->seq.pos--; } trace_seq_puts(s, " */\n"); -- cgit v1.2.3