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 V2 0/5] generalize panic_print's dump function to be used by other kernel parts
Date: Mon, 16 Jun 2025 09:08:35 +0800 [thread overview]
Message-ID: <20250616010840.38258-1-feng.tang@linux.alibaba.com> (raw)
When working on kernel stability issues, panic, task-hung and
software/hardware lockup are frequently met. And to debug them, user
may need lots of system information at that time, like task call stacks,
lock info, memory info etc.
panic case already has panic_print_sys_info() for this purpose, and has
a 'panic_print' bitmask to control what kinds of information is needed,
which is also helpful to debug other task-hung and lockup cases.
So this patchset extract the function out to a new file 'lib/sys_info.c',
and make it usable for other cases which also need system info for
debugging.
Also as suggested by Petr Mladek, add 'panic_sys_info=' interface to
take human readable string like "tasks,mem,lock,timer,ftrace,....",
and eventually obsolete the current 'panic_print' bitmap interface.
In RFC and V1 version, hung_task and SW/HW watchdog modules are enabled
with the new sys_info dump interface. In v2, they are kept out for
better review of current change, and will be posted later.
Locally these have been used in our bug chasing for stabilility issues
and was helpful.
Please help to review, thanks!
- Feng
Changelog:
Sinc V1:
* Separate the 'sys_show_info' related code to new file sys_info.[ch]
(Petr Mladek)
* Clean up the code for panic console replay (Petr Mladek)
* Add 'panic_sys_info=' cmdline and sysctl interface for taking
human readable parameters (Petr Mladek)
* Add note about the obsoleting of 'panic_print' (Petr Mladek)
* Hold the changes to hungtask/watchdog
Since RFC:
* Don't print all cpu backtrace if 'sysctl_hung_task_all_cpu_backtracemay'
is 'false' (Lance Yang)
* Change the name of 2 new kernel control knob to have 'mask' inside, and
add kernel document and code comments for them (Lance Yang)
* Make the sys_show_info() support printk msg replay and all CPU backtrace.
Feng Tang (5):
panic: clean up code for console replay
panic: generalize panic_print's function to show sys info
sys_info: add help to translate sys_info string to bitmap
panic: add 'panic_sys_info=' setup option for sysctl and kernel
cmdline
panic: add note that panic_print interface is deprecated
.../admin-guide/kernel-parameters.txt | 13 ++
Documentation/admin-guide/sysctl/kernel.rst | 18 +++
include/linux/kernel.h | 1 +
include/linux/sys_info.h | 27 ++++
kernel/panic.c | 66 +++++----
lib/Makefile | 2 +-
lib/sys_info.c | 127 ++++++++++++++++++
7 files changed, 217 insertions(+), 37 deletions(-)
create mode 100644 include/linux/sys_info.h
create mode 100644 lib/sys_info.c
--
2.39.5 (Apple Git-154)
next reply other threads:[~2025-06-16 1:08 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-06-16 1:08 Feng Tang [this message]
2025-06-16 1:08 ` [PATCH V2 1/5] panic: clean up code for console replay Feng Tang
2025-06-20 14:19 ` Petr Mladek
2025-06-16 1:08 ` [PATCH V2 2/5] panic: generalize panic_print's function to show sys info Feng Tang
2025-06-20 15:21 ` Petr Mladek
2025-06-23 3:07 ` Feng Tang
2025-06-16 1:08 ` [PATCH V2 3/5] sys_info: add help to translate sys_info string to bitmap Feng Tang
2025-06-16 4:25 ` kernel test robot
2025-06-16 15:08 ` Feng Tang
2025-06-23 14:04 ` Petr Mladek
2025-06-24 1:48 ` Feng Tang
2025-06-16 1:08 ` [PATCH V2 4/5] panic: add 'panic_sys_info=' setup option for sysctl and kernel cmdline Feng Tang
2025-06-23 15:04 ` Petr Mladek
2025-06-24 1:55 ` Feng Tang
2025-06-16 1:08 ` [PATCH V2 5/5] panic: add note that panic_print interface is deprecated Feng Tang
2025-06-16 1:45 ` Lance Yang
2025-06-16 2:39 ` Feng Tang
2025-06-23 15:13 ` Petr Mladek
2025-06-23 15:22 ` Petr Mladek
2025-06-24 1:58 ` Feng Tang
2025-06-25 9:30 ` 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=20250616010840.38258-1-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®