Skip to content

Commit 9743d12

Browse files
Feng Tangakpm00
authored andcommitted
panic: add 'panic_sys_info=' setup option for kernel cmdline
'panic_sys_info=' sysctl interface is already added for runtime setting. Add counterpart kernel cmdline option for boottime setting. Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: Feng Tang <[email protected]> Suggested-by: Petr Mladek <[email protected]> Cc: John Ogness <[email protected]> Cc: Jonathan Corbet <[email protected]> Cc: Lance Yang <[email protected]> Cc: "Paul E . McKenney" <[email protected]> Cc: Steven Rostedt <[email protected]> Cc: Nathan Chancellor <[email protected]> Signed-off-by: Andrew Morton <[email protected]>
1 parent d747755 commit 9743d12

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed

Documentation/admin-guide/kernel-parameters.txt

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4563,6 +4563,21 @@
45634563
Use this option carefully, maybe worth to setup a
45644564
bigger log buffer with "log_buf_len" along with this.
45654565

4566+
panic_sys_info= A comma separated list of extra information to be dumped
4567+
on panic.
4568+
Format: val[,val...]
4569+
Where @val can be any of the following:
4570+
4571+
tasks: print all tasks info
4572+
mem: print system memory info
4573+
timers: print timers info
4574+
locks: print locks info if CONFIG_LOCKDEP is on
4575+
ftrace: print ftrace buffer
4576+
all_bt: print all CPUs backtrace (if available in the arch)
4577+
blocked_tasks: print only tasks in uninterruptible (blocked) state
4578+
4579+
This is a human readable alternative to the 'panic_print' option.
4580+
45664581
parkbd.port= [HW] Parallel port number the keyboard adapter is
45674582
connected to, default is 0.
45684583
Format: <parport#>

kernel/panic.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,15 @@ static __init int kernel_panic_sysctls_init(void)
143143
late_initcall(kernel_panic_sysctls_init);
144144
#endif
145145

146+
/* The format is "panic_sys_info=tasks,mem,locks,ftrace,..." */
147+
static int __init setup_panic_sys_info(char *buf)
148+
{
149+
/* There is no risk of race in kernel boot phase */
150+
panic_print = sys_info_parse_param(buf);
151+
return 1;
152+
}
153+
__setup("panic_sys_info=", setup_panic_sys_info);
154+
146155
static atomic_t warn_count = ATOMIC_INIT(0);
147156

148157
#ifdef CONFIG_SYSFS

0 commit comments

Comments
 (0)