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: <20141105193817.0d2cfaf3@gandalf.local.home>
Date:	Wed, 5 Nov 2014 19:38:17 -0500
From:	Steven Rostedt <rostedt@...dmis.org>
To:	Joe Perches <joe@...ches.com>
Cc:	Rasmus Villemoes <linux@...musvillemoes.dk>,
	Julia Lawall <Julia.Lawall@...6.fr>,
	Ingo Molnar <mingo@...hat.com>, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 4/6] trace: Replace seq_printf by simpler equivalents

On Wed, 05 Nov 2014 14:51:48 -0800
Joe Perches <joe@...ches.com> wrote:

> On Wed, 2014-11-05 at 17:34 -0500, Steven Rostedt wrote:
> > On Fri, 12 Sep 2014 11:25:52 +0200 Rasmus Villemoes <linux@...musvillemoes.dk> wrote:
> > > Using seq_printf to print a simple string or a single character is a
> > > lot more expensive than it needs to be, since seq_puts and seq_putc
> > > exist.
> []
> > > diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c
> []
> > @@ -556,13 +556,13 @@ static int function_stat_cmp(void *p1, void *p2)
> > >  static int function_stat_headers(struct seq_file *m)
> > >  {
> > >  #ifdef CONFIG_FUNCTION_GRAPH_TRACER
> > > -	seq_printf(m, "  Function                               "
> > > -		   "Hit    Time            Avg             s^2\n"
> > > -		      "  --------                               "
> > > -		   "---    ----            ---             ---\n");
> > > +	seq_puts(m,
> > > +		 "  Function                               " "Hit    Time            Avg             s^2\n"
> > > +		 "  --------                               " "---    ----            ---             ---\n");
> > 
> > Please keep the original format. I know that it's considered bad form
> > to split strings like this, but I consider this one of the exceptions
> > to the rule.
> 
> Why is that?
> 
> btw: when the strings fragments are put on the same line,
> it's nicer to take out the intermediate joining " " bits too.
> 
> I'd've probably used 2 seq_puts calls like:
> 
> 	seq_puts(m, "  Function                               Hit    Time            Avg             s^2\n");
> 	seq_puts(m, "  --------                               ---    ----            ---             ---\n");
> 

In this case it's just that I hate that big white space followed by
content.

Maybe I'll change my mind in the future, but for now, I'd rather just
leave it as is.

-- Steve


--
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