[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20110218073402.GF11404@elte.hu>
Date: Fri, 18 Feb 2011 08:34:02 +0100
From: Ingo Molnar <mingo@...e.hu>
To: Mike Travis <travis@....com>
Cc: Thomas Gleixner <tglx@...utronix.de>,
"H. Peter Anvin" <hpa@...or.com>,
Andrew Morton <akpm@...ux-foundation.org>,
Len Brown <len.brown@...el.com>,
Yinghai Lu <yhlu.kernel@...il.com>, linux-acpi@...r.kernel.org,
x86@...nel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 4/5] printk: Minimize time zero output
* Mike Travis <travis@....com> wrote:
> Reduce the length for time zero messages by only printing "[0] ".
>
> v2: updated to apply to x86-tip
>
> Signed-off-by: Mike Travis <travis@....com>
> Reviewed-by: Jack Steiner <steiner@....com>
> Reviewed-by: Robin Holt <holt@....com>
> ---
> kernel/printk.c | 8 +++++---
> 1 file changed, 5 insertions(+), 3 deletions(-)
>
> --- linux.orig/kernel/printk.c
> +++ linux/kernel/printk.c
> @@ -818,11 +818,13 @@ asmlinkage int vprintk(const char *fmt,
> unsigned long nanosec_rem;
>
> t = cpu_clock(printk_cpu);
> - nanosec_rem = do_div(t, 1000000000);
> - tlen = sprintf(tbuf, "[%5lu.%06lu] ",
> + if (likely(t)) {
> + nanosec_rem = do_div(t, 1000000000);
> + tlen = sprintf(tbuf, "[%5lu.%06lu] ",
> (unsigned long) t,
> nanosec_rem / 1000);
The excessive number of very ugly linebreaks in this statement should have told you
that the whole printk_time function wants to be broken out of vsprintk(), into a
helper function.
Please make it two patches: one cleanup-only patch that factors out the code, the
second one that modifies it materially.
Thanks,
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