From: Joe Korty <joe.korty@ccur.com>
To: Mark Brown <broonie@sirena.org.uk>
Cc: Ingo Molnar <mingo@elte.hu>,
Linux Kernel <linux-kernel@vger.kernel.org>,
Simon Farnsworth <simon.farnsworth@onelan.com>
Subject: [PATCH] printk timestamp post-boot suppression, v2
Date: Wed, 27 Aug 2008 13:04:25 -0400 [thread overview]
Message-ID: <20080827170424.GA17217@tsunami.ccur.com> (raw)
In-Reply-To: <20080827161621.GF10834@sirena.org.uk>
On Wed, Aug 27, 2008 at 12:16:30PM -0400, Mark Brown wrote:
> It'd be nicer if this were optional - syslog typically only logs at
> second resolution and not all systems are going to have logfiles.
Optionally suppress printk timestamping after system boot.
A new config option is introduced, which if selected
suppresses printk timestamping after the boot sequence
is completed.
Signed-off-by: Joe Korty <joe.korty@ccur.com>
Index: 2.6.27-rc4-git4/kernel/printk.c
===================================================================
--- 2.6.27-rc4-git4.orig/kernel/printk.c 2008-08-27 09:37:52.000000000 -0400
+++ 2.6.27-rc4-git4/kernel/printk.c 2008-08-27 12:35:14.000000000 -0400
@@ -560,6 +560,12 @@
#endif
module_param_named(time, printk_time, bool, S_IRUGO | S_IWUSR);
+#if defined(CONFIG_PRINTK_TIME_BOOTONLY)
+#define printk_time_bootonly (system_state == SYSTEM_BOOTING)
+#else
+#define printk_time_bootonly (1)
+#endif
+
/* Check if we have any console registered that can be called early in boot. */
static int have_callable_console(void)
{
@@ -730,7 +736,7 @@
printed_len += 3;
new_text_line = 0;
- if (printk_time) {
+ if (printk_time && printk_time_bootonly) {
/* Follow the token with the time */
char tbuf[50], *tp;
unsigned tlen;
Index: 2.6.27-rc4-git4/lib/Kconfig.debug
===================================================================
--- 2.6.27-rc4-git4.orig/lib/Kconfig.debug 2008-08-26 16:28:41.000000000 -0400
+++ 2.6.27-rc4-git4/lib/Kconfig.debug 2008-08-27 12:29:34.000000000 -0400
@@ -9,6 +9,17 @@
operations. This is useful for identifying long delays
in kernel startup.
+config PRINTK_TIME_BOOTONLY
+ bool "Only show printk timing during kernel startup"
+ depends on PRINTK_TIME
+ help
+ If Y is selected, then timing information will
+ be prefixed to printk output lines only as long
+ as the kernel startup phase is in operation.
+
+ If N is selected, then every printk line will
+ be prefixed with timing information.
+
config ENABLE_WARN_DEPRECATED
bool "Enable __deprecated logic"
default y
next prev parent reply other threads:[~2008-08-27 17:05 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-08-27 15:16 [PATCH] printk timestamp post-boot suppression Joe Korty
2008-08-27 15:26 ` Simon Farnsworth
2008-08-27 16:16 ` Mark Brown
2008-08-27 17:04 ` Joe Korty [this message]
2008-08-27 17:13 ` [PATCH] printk timestamp post-boot suppression, v2 Simon Farnsworth
2008-08-27 17:22 ` Joe Korty
2008-08-27 17:27 ` Joe Korty
2008-08-27 17:22 ` Andi Kleen
2008-08-28 9:40 ` Ingo Molnar
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20080827170424.GA17217@tsunami.ccur.com \
--to=joe.korty@ccur.com \
--cc=broonie@sirena.org.uk \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=simon.farnsworth@onelan.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox