printk: add features when CONFIG_PRINTK_TIME=y
PATCH 1/1 printk: add features when CONFIG_PRINTK_TIME=y
Add 2 values which control time printing when CONFIG_PRINTK_TIME=y. Values can
be changed on boot option printk_time=n,m or by /proc/sys/kernel/printk_time.
First one tell about what is printing: 0 - no additional time info, 1 - current time, 2 - difference between to consecutive printk calls. Second tell about resolution of printing time.
Signed-off-by Stanislaw W. Gruszka <[email protected]>
include/linux/sysctl.h | 1 kernel/printk.c | 119 ++++++++++++++++++++++++++++++++++++++----------- kernel/sysctl.c | 14 +++++ 3 files changed, 109 insertions(+), 25 deletions(-)
include/linux/sysctl.h +1 -0
@@ -137,6 +137,7 @@ enumKERN_BOOTLOADER_TYPE =67 ,/* int: boot loader type */ KERN_RANDOMIZE =68 ,/* int: randomize virtual address space */ KERN_SETUID_DUMPABLE =69 ,/* int: behaviour of dumps for setuid core */ + KERN_PRINTK_TIME=70, /* int: behaviour of printk time */ };
kernel/printk.c +94 -25
152 lines not on this page · raw message
kernel/sysctl.c +14 -0
@@ -122,6 +122,10 @@ extern int sysctl_hz_timer;extern int acct_parm[];#endif +#ifdef CONFIG_PRINTK_TIME +extern int printk_time_parm[]; +#endif +int randomize_va_space =1 ; static int parse_table(int __user *, int, void __user *, size_t __user *, void __user *, size_t,
@@ -379,6 +383,16 @@ static ctl_table kern_table[] = { .mode = 0644, .proc_handler = &proc_dointvec, }, +#ifdef CONFIG_PRINTK_TIME + { + .ctl_name = KERN_PRINTK_TIME, + .procname = "printk_time", + .data = printk_time_parm, + .maxlen = 2*sizeof(int), + .mode = 0644, + .proc_handler = &proc_dointvec, + }, +#endif #ifdef CONFIG_KMOD { .ctl_name = KERN_MODPROBE,