提交 3b9c0410 编写于 作者: J Jan Engelhardt 提交者: Linus Torvalds

[PATCH] printk time parameter

Currently, enabling/disabling printk timestamps is only possible through
reboot (bootparam) or recompile.  I normally do not run with timestamps
(since syslog handles that in a good manner), but for measuring small
kernel delays (e.g.  irq probing - see parport thread) I needed subsecond
precision, but then again, just for some minutes rather than all kernel
messages to come.  The following patch adds a module_param() with which the
timestamps can be en-/disabled in a live system through
/sys/modules/printk/parameters/printk_time.
Signed-off-by: NJan Engelhardt <jengelh@gmx.de>
Signed-off-by: NAndrew Morton <akpm@osdl.org>
Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
上级 e5dcd90b
...@@ -24,6 +24,7 @@ ...@@ -24,6 +24,7 @@
#include <linux/console.h> #include <linux/console.h>
#include <linux/init.h> #include <linux/init.h>
#include <linux/module.h> #include <linux/module.h>
#include <linux/moduleparam.h>
#include <linux/interrupt.h> /* For in_interrupt() */ #include <linux/interrupt.h> /* For in_interrupt() */
#include <linux/config.h> #include <linux/config.h>
#include <linux/delay.h> #include <linux/delay.h>
...@@ -439,6 +440,7 @@ static int printk_time = 1; ...@@ -439,6 +440,7 @@ static int printk_time = 1;
#else #else
static int printk_time = 0; static int printk_time = 0;
#endif #endif
module_param(printk_time, int, S_IRUGO | S_IWUSR);
static int __init printk_time_setup(char *str) static int __init printk_time_setup(char *str)
{ {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册