Re: [PATCH V2 5/5] panic: add note that panic_print interface is deprecated

From: Feng Tang
Date: Sun Jun 15 2025 - 22:39:55 EST


On Mon, Jun 16, 2025 at 09:45:16AM +0800, Lance Yang wrote:
>
>
> On 2025/6/16 09:08, Feng Tang wrote:
> > Long term wise, the 'panic_sys_info' should be the only controlling
> > interface, which can be referred by other modules.
> >
> > Suggested-by: Petr Mladek <pmladek@xxxxxxxx>
> > Signed-off-by: Feng Tang <feng.tang@xxxxxxxxxxxxxxxxx>
> > ---
> > kernel/panic.c | 9 ++++++++-
> > 1 file changed, 8 insertions(+), 1 deletion(-)
> >
> > diff --git a/kernel/panic.c b/kernel/panic.c
> > index ea238f7d4b54..e8a05fc6b733 100644
> > --- a/kernel/panic.c
> > +++ b/kernel/panic.c
> > @@ -76,6 +76,13 @@ ATOMIC_NOTIFIER_HEAD(panic_notifier_list);
> > EXPORT_SYMBOL(panic_notifier_list);
> > #ifdef CONFIG_SYSCTL
> > +static int sysctl_panic_print_handler(const struct ctl_table *table, int write,
> > + void *buffer, size_t *lenp, loff_t *ppos)
> > +{
> > + printk_once("panic: 'panic_print' sysctl interface will be obsoleted by 'panic_sys_info' interface.\n");
>
> Hmm... I would get scared for a second when I read messages prefixed with
> "panic:"
> from dmesg. That prefix should have a very specific meaning ;)
>
> Well, we can just change the prefix to something more neutral:
>
> printk_once("Kernel: 'panic_print' sysctl interface will be obsoleted by
> 'panic_sys_info' interface.\n");

Yes. I tried to give the module name, but forgot the name is too scary
for normal users :)

Thanks,
Feng

> Thanks,
> Lance