public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 2/2 v2] tracing/function-graph-tracer: strip ending newlines on comments
@ 2008-12-24  0:43 Frederic Weisbecker
  2008-12-26  9:42 ` Ingo Molnar
  0 siblings, 1 reply; 2+ messages in thread
From: Frederic Weisbecker @ 2008-12-24  0:43 UTC (permalink / raw)
  To: Ingo Molnar; +Cc: Linux Kernel

Impact: trivial output improvement

Ending newlines are appended automatically on comments by the function graph tracer
because the newline needs to be placed after the "*/" characters.
So if the user puts an ending whitespace, we want to strip it.

Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
---
 kernel/trace/trace_functions_graph.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/kernel/trace/trace_functions_graph.c b/kernel/trace/trace_functions_graph.c
index 4bf39fc..bc7d908 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;
-- 
1.6.0.4


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH 2/2 v2] tracing/function-graph-tracer: strip ending newlines on comments
  2008-12-24  0:43 [PATCH 2/2 v2] tracing/function-graph-tracer: strip ending newlines on comments Frederic Weisbecker
@ 2008-12-26  9:42 ` Ingo Molnar
  0 siblings, 0 replies; 2+ messages in thread
From: Ingo Molnar @ 2008-12-26  9:42 UTC (permalink / raw)
  To: Frederic Weisbecker; +Cc: Linux Kernel, Steven Rostedt


* Frederic Weisbecker <fweisbec@gmail.com> wrote:

> Impact: trivial output improvement
> 
> Ending newlines are appended automatically on comments by the function graph tracer
> because the newline needs to be placed after the "*/" characters.
> So if the user puts an ending whitespace, we want to strip it.
> 
> Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
> ---
>  kernel/trace/trace_functions_graph.c |    6 ++++++
>  1 files changed, 6 insertions(+), 0 deletions(-)

applied to tip/tracing/function-graph-tracer, thanks Frederic!

	Ingo

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2008-12-26  9:43 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-12-24  0:43 [PATCH 2/2 v2] tracing/function-graph-tracer: strip ending newlines on comments Frederic Weisbecker
2008-12-26  9:42 ` Ingo Molnar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox