From patchwork Thu Feb 17 18:51:35 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Travis X-Patchwork-Id: 571601 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p1HIqjpI004725 for ; Thu, 17 Feb 2011 18:52:46 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757691Ab1BQSwb (ORCPT ); Thu, 17 Feb 2011 13:52:31 -0500 Received: from relay1.sgi.com ([192.48.179.29]:39382 "EHLO relay.sgi.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757050Ab1BQSvh (ORCPT ); Thu, 17 Feb 2011 13:51:37 -0500 Received: from gulag1.americas.sgi.com (gulag1.americas.sgi.com [128.162.236.41]) by relay1.corp.sgi.com (Postfix) with ESMTP id D866A8F80BE; Thu, 17 Feb 2011 10:51:32 -0800 (PST) Received: by gulag1.americas.sgi.com (Postfix, from userid 5508) id B128D1037A4ED; Thu, 17 Feb 2011 12:51:32 -0600 (CST) Message-Id: <20110217185132.576051720@gulag1.americas.sgi.com> References: <20110217185131.960038922@gulag1.americas.sgi.com> User-Agent: quilt/0.46-1 Date: Thu, 17 Feb 2011 12:51:35 -0600 From: Mike Travis To: Ingo Molnar , Thomas Gleixner , "H. Peter Anvin" Cc: Andrew Morton , Len Brown , Yinghai Lu , linux-acpi@vger.kernel.org, x86@kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 4/5] printk: Minimize time zero output Content-Disposition: inline; filename=minimize-time-zero-msgs Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Thu, 17 Feb 2011 18:52:46 +0000 (UTC) --- 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); - + } else + tlen = sprintf(tbuf, "[0] "); for (tp = tbuf; tp < tbuf + tlen; tp++) emit_log_char(*tp); printed_len += tlen;