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 17:34 -0500, Steven Rostedt wrote:
> On Fri, 12 Sep 2014 11:25:52 +0200 Rasmus Villemoes <linux@rasmusvillemoes.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");




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