summaryrefslogtreecommitdiffstats
path: root/kernel/trace/trace_functions_graph.c
diff options
context:
space:
mode:
authorFrederic Weisbecker <fweisbec@gmail.com>2008-12-24 01:43:25 +0100
committerIngo Molnar <mingo@elte.hu>2008-12-26 10:42:14 +0100
commit412d0bb553c0227191f1bfd06100f561600bff22 (patch)
treefc6d2d1d430eed5ea1e4125d2962a6ff32e6265b /kernel/trace/trace_functions_graph.c
parent5250d329e38cdf7580faeb9c53c17d3588d7d19c (diff)
downloadlinux-412d0bb553c0227191f1bfd06100f561600bff22.tar.bz2
tracing/function-graph-tracer: strip ending newlines on comments
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>
Diffstat (limited to 'kernel/trace/trace_functions_graph.c')
-rw-r--r--kernel/trace/trace_functions_graph.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/kernel/trace/trace_functions_graph.c b/kernel/trace/trace_functions_graph.c
index 4bf39fcae97a..bc7d90850be5 100644
--- a/kernel/trace/trace_functions_graph.c
+++ b/kernel/trace/trace_functions_graph.c
@@ -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;