printk_delay for multi lines
Subsystems (4)
PATCH 6/6 printk_delay for multi lines
printk delay help us to capture printk messages on some unconvenient senarios, ie. on halt phase. But the messages is still not easy to read.
So this patch add another sysctl variable printk_delay_lines to make the messages can be delayed after multi printks. Thus we can take pictures by camera easily and the messages will be more readable.
kmesg will delay printk_delay_msecs milliseconds after every printk_delay_lines printks when printk_delay > 0.
Additional, merge boot_delay into printk_delay function. remove boot_delay boot param, add printk_delay and printk_delay_lines instead.
Now, we can set the value by:
1. sysctl interface:/proc/sys/kernel/printk_delay/proc/sys/kernel/printk_delay_lines
2. boot params:printk_delayprintk_delay_lines
printk_delay_lines range from 1 - 10000, default value is 1
--- Documentation/kernel-parameters.txt | 11 ++++- Documentation/sysctl/kernel.txt | 9 ++++ include/linux/printk.h | 1 kernel/printk.c | 67 ++++++++++++++++++++---------------- kernel/sysctl.c | 9 ++++ lib/Kconfig.debug | 18 --------- 6 files changed, 66 insertions(+), 49 deletions(-)
Documentation/sysctl/kernel.txt +9 -0
@@ -374,6 +374,15 @@ Value from 0 - 10000 is allowed. ============================================================== +printk_delay_lines: + +Delay printk message every printk_delay_lines printks +in printk_delay milliseconds + +Value from 1 - 10000 is allowed. + +============================================================== + randomize-va-space: This option can be used to select the type of process address
kernel/printk.c +38 -29
120 lines not on this page · raw message
kernel/sysctl.c +9 -0
@@ -684,6 +684,15 @@ static struct ctl_table kern_table[] = { .extra1 = &zero, .extra2 = &ten_thousand, }, + { + .procname = "printk_delay_lines", + .data = &printk_delay_lines, + .maxlen = sizeof(int), + .mode = 0644, + .proc_handler = proc_dointvec_minmax, + .extra1 = &one, + .extra2 = &ten_thousand, + }, #endif { .procname = "ngroups_max",
lib/Kconfig.debug +0 -18
@@ -707,24 +707,6 @@ config FRAME_POINTER larger and slower, but it gives very useful debugging information in case of kernel bugs. (precise oopses/stacktraces/warnings) -config BOOT_PRINTK_DELAY - bool "Delay each boot printk message by N milliseconds" - depends on DEBUG_KERNEL && PRINTK && GENERIC_CALIBRATE_DELAY - help - This build option allows you to read kernel boot messages - by inserting a short delay after each one. The delay is - specified in milliseconds on the kernel command line, - using "boot_delay=N". - - It is likely that you would also need to use "lpj=M" to preset - the "loops per jiffie" value. - See a previous boot log for the "lpj" value to use for your - system, and then set "lpj=M" before setting "boot_delay=N". - NOTE: Using this option may adversely affect SMP systems. - I.e., processors other than the first one may not boot up. - BOOT_PRINTK_DELAY also may cause DETECT_SOFTLOCKUP to detect - what it believes to be lockup conditions. - config RCU_TORTURE_TEST tristate "torture tests for RCU" depends on DEBUG_KERNEL
Documentation/kernel-parameters.txt +9 -2
@@ -408,9 +408,16 @@ and is between 256 and 4096 characters. Format: <io>,<irq>,<mode> See header of drivers/net/hamradio/baycom_ser_hdx.c. - boot_delay= Milliseconds to delay each printk during boot. + printk_delay= Milliseconds to delay each printk. Values larger than 10 seconds (10000) are changed to - no delay (0). + no delay (0). It can be set via sysctl after boot, + the proc file is: /proc/sys/kernel/printk_delay + Format: integer + + printk_delay_lines= Delay after every printk_delay_lines printk. + Values larger than 10 seconds (10000) are changed to 1. + It can be set via sysctl after boot, + the proc file is: /proc/sys/kernel/printk_delay_lines Format: integer bootmem_debug [KNL] Enable bootmem allocator debug messages.
include/linux/printk.h +1 -0
@@ -66,6 +66,7 @@ extern bool printk_timed_ratelimit(unsig unsigned int interval_msec);extern int printk_delay_msec; +extern int printk_delay_lines;/* * Print a one-time message (analogous to WARN_ONCE() et al):