lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20081223121844.GA3611@elte.hu>
Date:	Tue, 23 Dec 2008 13:18:44 +0100
From:	Ingo Molnar <mingo@...e.hu>
To:	Frédéric 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


* Frédéric Weisbecker <fweisbec@...il.com> wrote:

> 2008/12/23 Ingo Molnar <mingo@...e.hu>:
> >
> > * 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
> >
> 
> 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
--
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

Powered by Openwall GNU/*/Linux Powered by OpenVZ