Re: [PATCH] printk: Make console tracepoint safe in NMI() context

From: Steven Rostedt
Date: Fri Jul 15 2022 - 11:03:00 EST


On Fri, 15 Jul 2022 14:01:52 +0200
Petr Mladek <pmladek@xxxxxxxx> wrote:

> + /*
> + * trace_console_rcuidle() is not working in NMI. printk()
> + * is used more often in NMI than in rcuidle context.
> + * Choose the less evil solution here.
> + *
> + * raw_smp_processor_id() is reliable in rcuidle context.
> + */
> + TP_CONDITION(!rcu_is_idle_cpu(raw_smp_processor_id())),
> +

As Marco mentioned in the other thread, would a check for
'rcu_is_watching()' be better?

-- Steve


> TP_STRUCT__entry(
> __dynamic_array(char, msg, len + 1)
> ),