]> git.karo-electronics.de Git - mv-sheeva.git/commitdiff
tracing/function-graph-tracer: strip ending newlines on comments
authorFrederic Weisbecker <fweisbec@gmail.com>
Wed, 24 Dec 2008 00:43:25 +0000 (01:43 +0100)
committerIngo Molnar <mingo@elte.hu>
Fri, 26 Dec 2008 09:42:14 +0000 (10:42 +0100)
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>
kernel/trace/trace_functions_graph.c

index 4bf39fcae97afadc384b104e5d77be0120e375e3..bc7d90850be5c2977bfe4f81803d5d3f7c7bedec 100644 (file)
@@ -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;