Skip to content

Commit

Permalink
[PATCH] printk time parameter
Browse files Browse the repository at this point in the history
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: Jan Engelhardt <jengelh@gmx.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
  • Loading branch information
Jan Engelhardt authored and Linus Torvalds committed Jun 25, 2006
1 parent e5dcd90 commit 3b9c041
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions kernel/printk.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
#include <linux/console.h>
#include <linux/init.h>
#include <linux/module.h>
#include <linux/moduleparam.h>
#include <linux/interrupt.h> /* For in_interrupt() */
#include <linux/config.h>
#include <linux/delay.h>
Expand Down Expand Up @@ -439,6 +440,7 @@ static int printk_time = 1;
#else
static int printk_time = 0;
#endif
module_param(printk_time, int, S_IRUGO | S_IWUSR);

static int __init printk_time_setup(char *str)
{
Expand Down

0 comments on commit 3b9c041

Please sign in to comment.