From: Ingo Molnar <mingo@elte.hu>
To: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Steven Rostedt <rostedt@goodmis.org>,
Linux Kernel <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] tracing/function-graph-tracer: strip ending newlines on comments
Date: Tue, 23 Dec 2008 07:48:04 +0100 [thread overview]
Message-ID: <20081223064804.GA24956@elte.hu> (raw)
In-Reply-To: <494FD967.2000002@gmail.com>
* Frederic Weisbecker <fweisbec@gmail.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@gmail.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
next prev parent reply other threads:[~2008-12-23 6:48 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-12-22 18:16 [PATCH] tracing/function-graph-tracer: strip ending newlines on comments Frederic Weisbecker
2008-12-23 6:48 ` Ingo Molnar [this message]
2008-12-23 8:18 ` Ingo Molnar
2008-12-23 12:31 ` Frédéric Weisbecker
2008-12-23 12:14 ` Frédéric Weisbecker
2008-12-23 12:18 ` Ingo Molnar
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20081223064804.GA24956@elte.hu \
--to=mingo@elte.hu \
--cc=fweisbec@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=rostedt@goodmis.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox