Skip to content

Commit

Permalink
tracing/function-graph-tracer: strip ending newlines on comments
Browse files Browse the repository at this point in the history
Impact: tracer output improvement

Ending newlines are appended automatically on comments by the function
graph tracer because the newline needs to be placed after the "*/"
comment characters.

So if the user puts an ending newline, we want to strip it.

Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
  • Loading branch information
Frederic Weisbecker authored and Ingo Molnar committed Dec 26, 2008
1 parent 5250d32 commit 412d0bb
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions kernel/trace/trace_functions_graph.c
Original file line number Diff line number Diff line change
Expand Up @@ -592,6 +592,12 @@ print_graph_comment(struct print_entry *trace, struct trace_seq *s,
if (ent->flags & TRACE_FLAG_CONT)
trace_seq_print_cont(s, iter);

/* Strip ending newline */
if (s->buffer[s->len - 1] == '\n') {
s->buffer[s->len - 1] = '\0';
s->len--;
}

ret = trace_seq_printf(s, " */\n");
if (!ret)
return TRACE_TYPE_PARTIAL_LINE;
Expand Down

0 comments on commit 412d0bb

Please sign in to comment.