From: Ingo Molnar <mingo@elte.hu>
To: "Frédéric 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 13:18:44 +0100 [thread overview]
Message-ID: <20081223121844.GA3611@elte.hu> (raw)
In-Reply-To: <c62985530812230414y695e36b3oa03b6679a20fb14f@mail.gmail.com>
* Frédéric Weisbecker <fweisbec@gmail.com> wrote:
> 2008/12/23 Ingo Molnar <mingo@elte.hu>:
> >
> > * 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
> >
>
> We know it during the insertion. But we need a new field struct
> print_entry. That makes me remind that I didn't considered the
> TRACE_CONT rest of the buffer in this patch. Actually, the most easy
> solution would be to print entirely the buffer to the seq, and then
> delete the newline directly to the seq. That would be a bit crappy but
> actually the only solution.
>
> So my patch is wrong in cases of long messages.
ok, i zapped it for now and will wait for v2.
Ingo
prev parent reply other threads:[~2008-12-23 12:19 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
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 [this message]
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=20081223121844.GA3611@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