[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20081223064804.GA24956@elte.hu>
Date: Tue, 23 Dec 2008 07:48:04 +0100
From: Ingo Molnar <mingo@...e.hu>
To: Frederic Weisbecker <fweisbec@...il.com>
Cc: Steven Rostedt <rostedt@...dmis.org>,
Linux Kernel <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] tracing/function-graph-tracer: strip ending newlines
on comments
* Frederic Weisbecker <fweisbec@...il.com> wrote:
> Impact: trivial output improvement
>
> Ending newlines are appended automatically on comments by the function graph tracer
> because the newlines 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@...il.com>
applied to tip/tracing/function-graph-tracer, thanks Frederic!
> @@ -584,6 +585,11 @@ print_graph_comment(struct print_entry *trace, struct trace_seq *s,
> return TRACE_TYPE_PARTIAL_LINE;
> }
>
> + /* Strip ending newline on the comment */
> + len = strlen(trace->buf);
> + if (trace->buf[len - 1] == '\n')
> + trace->buf[len - 1] = '\0';
> +
Hm, dont we know the length of the buffer already, so that we could avoid
the strlen() overhead?
Ingo
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists