All of lore.kernel.org
 help / color / mirror / Atom feed
From: Petr Mladek <pmladek@suse.com>
To: Nam Cao <namcao@linutronix.de>
Cc: Steven Rostedt <rostedt@goodmis.org>,
	Gabriele Monaco <gmonaco@redhat.com>,
	linux-trace-kernel@vger.kernel.org, linux-kernel@vger.kernel.org,
	john.ogness@linutronix.de,
	Sergey Senozhatsky <senozhatsky@chromium.org>
Subject: Re: [PATCH v6 03/22] panic: Add vpanic()
Date: Mon, 5 May 2025 14:24:50 +0200	[thread overview]
Message-ID: <aBiuEnSg7ijbBtwB@localhost.localdomain> (raw)
In-Reply-To: <390d7357d9b24362fde68d7c9f0fbd5ba740398c.1745999587.git.namcao@linutronix.de>

On Wed 2025-04-30 13:02:18, Nam Cao wrote:
> vpanic() is useful for implementing runtime verification reactors. Add it.
> 
> Signed-off-by: Nam Cao <namcao@linutronix.de>
> Reviewed-by: Petr Mladek <pmladek@suse.com>
> ---
> Cc: John Ogness <john.ogness@linutronix.de>
> Cc: Sergey Senozhatsky <senozhatsky@chromium.org>
> ---
>  include/linux/panic.h |  3 +++
>  kernel/panic.c        | 17 ++++++++++++-----
>  2 files changed, 15 insertions(+), 5 deletions(-)
> 
> diff --git a/include/linux/panic.h b/include/linux/panic.h
> index 54d90b6c5f47..3522f8c441f4 100644
> --- a/include/linux/panic.h
> +++ b/include/linux/panic.h
> @@ -3,6 +3,7 @@
>  #define _LINUX_PANIC_H
>  
>  #include <linux/compiler_attributes.h>
> +#include <linux/stdarg.h>
>  #include <linux/types.h>
>  
>  struct pt_regs;
> @@ -10,6 +11,8 @@ struct pt_regs;
>  extern long (*panic_blink)(int state);
>  __printf(1, 2)
>  void panic(const char *fmt, ...) __noreturn __cold;
> +__printf(1, 0)
> +void vpanic(const char *fmt, va_list args) __noreturn __cold;
>  void nmi_panic(struct pt_regs *regs, const char *msg);
>  void check_panic_on_warn(const char *origin);
>  extern void oops_enter(void);
> diff --git a/kernel/panic.c b/kernel/panic.c
> index d8635d5cecb2..df799d784b61 100644
> --- a/kernel/panic.c
> +++ b/kernel/panic.c
> @@ -277,17 +277,16 @@ static void panic_other_cpus_shutdown(bool crash_kexec)
>  }
>  
>  /**
> - *	panic - halt the system
> + *	vpanic - halt the system
>   *	@fmt: The text string to print
>   *
I wanted to double check the __printf attributtes and compiled this
file with W=1:

$> make W=1 kernel/panic.o
  CC      kernel/panic.o
kernel/panic.c:288: warning: Function parameter or struct member 'args' not described in 'vpanic'

So, we should add description of the new @args parameter...


>   *	Display a message, then perform cleanups.
>   *
>   *	This function never returns.
>   */
> -void panic(const char *fmt, ...)
> +void vpanic(const char *fmt, va_list args)
>  {
>  	static char buf[1024];
> -	va_list args;
>  	long i, i_next = 0, len;
>  	int state = 0;
>  	int old_cpu, this_cpu;

Otherwise, it looks good.

Best Regards,
Petr

  reply	other threads:[~2025-05-05 12:24 UTC|newest]

Thread overview: 44+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-30 11:02 [PATCH v6 00/22] RV: Linear temporal logic monitors for RT application Nam Cao
2025-04-30 11:02 ` Nam Cao
2025-04-30 11:02 ` [PATCH v6 01/22] rv: Add #undef TRACE_INCLUDE_FILE Nam Cao
2025-04-30 11:02 ` [PATCH v6 02/22] printk: Make vprintk_deferred() public Nam Cao
2025-04-30 11:02 ` [PATCH v6 03/22] panic: Add vpanic() Nam Cao
2025-05-05 12:24   ` Petr Mladek [this message]
2025-04-30 11:02 ` [PATCH v6 04/22] rv: Let the reactors take care of buffers Nam Cao
2025-05-05 12:25   ` Petr Mladek
2025-04-30 11:02 ` [PATCH v6 05/22] verification/dot2k: Make a separate dot2k_templates/Kconfig_container Nam Cao
2025-04-30 11:02 ` [PATCH v6 06/22] verification/dot2k: Remove __buff_to_string() Nam Cao
2025-04-30 11:02 ` [PATCH v6 07/22] verification/dot2k: Replace is_container() hack with subparsers Nam Cao
2025-04-30 11:02 ` [PATCH v6 08/22] rv: rename CONFIG_DA_MON_EVENTS to CONFIG_RV_MON_EVENTS Nam Cao
2025-04-30 11:02 ` [PATCH v6 09/22] verification/dot2k: Prepare the frontend for LTL inclusion Nam Cao
2025-04-30 11:02 ` [PATCH v6 10/22] Documentation/rv: Prepare monitor synthesis document " Nam Cao
2025-04-30 11:02 ` [PATCH v6 11/22] verification/rvgen: Restructure the templates files Nam Cao
2025-04-30 11:02 ` [PATCH v6 12/22] verification/rvgen: Restructure the classes to prepare for LTL inclusion Nam Cao
2025-04-30 11:02 ` [PATCH v6 13/22] rv: Add support for LTL monitors Nam Cao
2025-05-07 21:00   ` Steven Rostedt
2025-04-30 11:02 ` [PATCH v6 14/22] rv: Add rtapp container monitor Nam Cao
2025-04-30 11:02 ` [PATCH v6 15/22] x86/tracing: Remove redundant trace_pagefault_key Nam Cao
2025-04-30 11:02 ` [PATCH v6 16/22] x86/tracing: Move page fault trace points to generic Nam Cao
2025-05-07 21:03   ` Steven Rostedt
2025-04-30 11:02 ` [PATCH v6 17/22] arm64: mm: Add page fault trace points Nam Cao
2025-05-07 21:23   ` Steven Rostedt
2025-05-16 14:04   ` Will Deacon
2025-05-16 14:42     ` Steven Rostedt
2025-05-19 15:12       ` Will Deacon
2025-05-19 16:08         ` Steven Rostedt
2025-05-20 14:04           ` Will Deacon
2025-05-16 15:09     ` Nam Cao
2025-05-19 16:17     ` Mark Rutland
2025-05-20 12:32       ` Will Deacon
2025-04-30 11:02 ` [PATCH v6 18/22] riscv: " Nam Cao
2025-04-30 11:02   ` Nam Cao
2025-04-30 11:02 ` [PATCH v6 19/22] rv: Add rtapp_pagefault monitor Nam Cao
2025-04-30 11:02 ` [PATCH v6 20/22] rv: Add rtapp_sleep monitor Nam Cao
2025-04-30 11:02 ` [PATCH v6 21/22] rv: Add documentation for rtapp monitor Nam Cao
2025-04-30 11:02 ` [PATCH v6 22/22] rv: Allow to configure the number of per-task monitor Nam Cao
2025-04-30 12:17 ` [PATCH v6 00/22] RV: Linear temporal logic monitors for RT application Gabriele Monaco
2025-04-30 12:17   ` Gabriele Monaco
2025-04-30 19:18   ` Steven Rostedt
2025-04-30 19:18     ` Steven Rostedt
2025-08-10 21:12 ` patchwork-bot+linux-riscv
2025-08-10 21:12   ` patchwork-bot+linux-riscv

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=aBiuEnSg7ijbBtwB@localhost.localdomain \
    --to=pmladek@suse.com \
    --cc=gmonaco@redhat.com \
    --cc=john.ogness@linutronix.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-trace-kernel@vger.kernel.org \
    --cc=namcao@linutronix.de \
    --cc=rostedt@goodmis.org \
    --cc=senozhatsky@chromium.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.