lkml.org 
[lkml]   [2014]   [Nov]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH 4/6] trace: Replace seq_printf by simpler equivalents
From
Date
On Wed, 2014-11-05 at 19:38 -0500, Steven Rostedt wrote:
> On Wed, 05 Nov 2014 14:51:48 -0800 Joe Perches <joe@perches.com> wrote:

[]
> > > 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.

My eyes generally skip over the embedded whitespace.

It's also generally less code space to use a single format string
instead of something like:

printf(" %-39s%-7s%-16s%-16s%s\n", "Function", "Hit", "Time", "Avg", "s^2");




\
 
 \ /
  Last update: 2014-11-06 02:01    [W:0.051 / U:0.612 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site