From: Feng Tang <feng.tang@linux.alibaba.com>
To: Andrew Morton <akpm@linux-foundation.org>,
Petr Mladek <pmladek@suse.com>,
Steven Rostedt <rostedt@goodmis.org>,
Lance Yang <lance.yang@linux.dev>,
Jonathan Corbet <corbet@lwn.net>,
linux-kernel@vger.kernel.org
Cc: paulmck@kernel.org, john.ogness@linutronix.de,
Feng Tang <feng.tang@linux.alibaba.com>
Subject: [PATCH v3 4/5] panic: add 'panic_sys_info=' setup option for kernel cmdline
Date: Thu, 3 Jul 2025 10:10:03 +0800 [thread overview]
Message-ID: <20250703021004.42328-5-feng.tang@linux.alibaba.com> (raw)
In-Reply-To: <20250703021004.42328-1-feng.tang@linux.alibaba.com>
'panic_sys_info=' sysctl interface is already added for runtime setting.
Add counterpart kernel cmdline option for boottime setting.
Suggested-by: Petr Mladek <pmladek@suse.com>
Signed-off-by: Feng Tang <feng.tang@linux.alibaba.com>
---
Documentation/admin-guide/kernel-parameters.txt | 15 +++++++++++++++
kernel/panic.c | 9 +++++++++
2 files changed, 24 insertions(+)
diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt
index abb2ade021ee..39ddef7c5857 100644
--- a/Documentation/admin-guide/kernel-parameters.txt
+++ b/Documentation/admin-guide/kernel-parameters.txt
@@ -4541,6 +4541,21 @@
Use this option carefully, maybe worth to setup a
bigger log buffer with "log_buf_len" along with this.
+ panic_sys_info= A comma separated list of extra information to be dumped
+ on panic.
+ Format: val[,val...]
+ Where @val can be any of the following:
+
+ tasks: print all tasks info
+ mem: print system memory info
+ timers: print timers info
+ locks: print locks info if CONFIG_LOCKDEP is on
+ ftrace: print ftrace buffer
+ all_bt: print all CPUs backtrace (if available in the arch)
+ blocked_tasks: print only tasks in uninterruptible (blocked) state
+
+ This is a human readable alternative to the 'panic_print' option.
+
parkbd.port= [HW] Parallel port number the keyboard adapter is
connected to, default is 0.
Format: <parport#>
diff --git a/kernel/panic.c b/kernel/panic.c
index d7aa427dc23c..d9d4fcd5e318 100644
--- a/kernel/panic.c
+++ b/kernel/panic.c
@@ -143,6 +143,15 @@ static __init int kernel_panic_sysctls_init(void)
late_initcall(kernel_panic_sysctls_init);
#endif
+/* The format is "panic_sys_info=tasks,mem,locks,ftrace,..." */
+static int __init setup_panic_sys_info(char *buf)
+{
+ /* There is no risk of race in kernel boot phase */
+ panic_print = sys_info_parse_param(buf);
+ return 1;
+}
+__setup("panic_sys_info=", setup_panic_sys_info);
+
static atomic_t warn_count = ATOMIC_INIT(0);
#ifdef CONFIG_SYSFS
--
2.43.5
next prev parent reply other threads:[~2025-07-03 2:10 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-03 2:09 [PATCH v3 0/5] generalize panic_print's dump function to be used by other kernel parts Feng Tang
2025-07-03 2:10 ` [PATCH v3 1/5] panic: clean up code for console replay Feng Tang
2025-07-14 21:09 ` Askar Safin
2025-07-15 0:49 ` Feng Tang
2025-07-15 1:18 ` Askar Safin
2025-07-15 1:34 ` Feng Tang
2025-07-15 2:48 ` Askar Safin
2025-07-15 3:27 ` Feng Tang
2025-08-12 11:59 ` Petr Mladek
2025-08-13 0:43 ` Feng Tang
2025-07-03 2:10 ` [PATCH v3 2/5] panic: generalize panic_print's function to show sys info Feng Tang
2025-08-12 10:12 ` Petr Mladek
2025-07-03 2:10 ` [PATCH 3/5] panic: add 'panic_sys_info' sysctl to take human readable string parameter Feng Tang
2025-07-03 2:56 ` Lance Yang
2025-07-03 3:18 ` Feng Tang
2025-08-12 10:23 ` Petr Mladek
2025-08-13 0:39 ` Feng Tang
2025-07-03 2:10 ` Feng Tang [this message]
2025-08-12 10:31 ` [PATCH v3 4/5] panic: add 'panic_sys_info=' setup option for kernel cmdline Petr Mladek
2025-07-03 2:10 ` [PATCH v3 5/5] panic: add note that panic_print sysctl interface is deprecated Feng Tang
2025-08-12 11:52 ` Petr Mladek
2025-08-13 1:05 ` Feng Tang
2025-08-14 15:21 ` Petr Mladek
2025-07-03 3:23 ` [PATCH v3 0/5] generalize panic_print's dump function to be used by other kernel parts Lance Yang
2025-07-03 4:56 ` Lance Yang
2025-07-03 5:54 ` Feng Tang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250703021004.42328-5-feng.tang@linux.alibaba.com \
--to=feng.tang@linux.alibaba.com \
--cc=akpm@linux-foundation.org \
--cc=corbet@lwn.net \
--cc=john.ogness@linutronix.de \
--cc=lance.yang@linux.dev \
--cc=linux-kernel@vger.kernel.org \
--cc=paulmck@kernel.org \
--cc=pmladek@suse.com \
--cc=rostedt@goodmis.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®