]> git.ipfire.org Git - thirdparty/linux.git/commit
panic: generalize panic_print's function to show sys info
authorFeng Tang <feng.tang@linux.alibaba.com>
Thu, 3 Jul 2025 02:10:01 +0000 (10:10 +0800)
committerAndrew Morton <akpm@linux-foundation.org>
Sun, 20 Jul 2025 02:08:24 +0000 (19:08 -0700)
commitb76e89e50fc3693b7b8a443ed906320d8ccb93fd
treed43d537583cad2a5e31e3cdaf7fb3964ac609eaa
parent261743b0135d1d578cab407ba0cf226df30b43d8
panic: generalize panic_print's function to show sys info

'panic_print' was introduced to help debugging kernel panic by dumping
different kinds of system information like tasks' call stack, memory,
ftrace buffer, etc.  Actually this function could also be used to help
debugging other cases like task-hung, soft/hard lockup, etc.  where user
may need the snapshot of system info at that time.

Extract system info dump function related code from panic.c to separate
file sys_info.[ch], for wider usage by other kernel parts for debugging.

Also modify the macro names about singulars/plurals.

Link: https://lkml.kernel.org/r/20250703021004.42328-3-feng.tang@linux.alibaba.com
Signed-off-by: Feng Tang <feng.tang@linux.alibaba.com>
Suggested-by: Petr Mladek <pmladek@suse.com>
Cc: John Ogness <john.ogness@linutronix.de>
Cc: Jonathan Corbet <corbet@lwn.net>
Cc: Lance Yang <lance.yang@linux.dev>
Cc: "Paul E . McKenney" <paulmck@kernel.org>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Nathan Chancellor <nathan@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
include/linux/sys_info.h [new file with mode: 0644]
kernel/panic.c
lib/Makefile
lib/sys_info.c [new file with mode: 0644]