Re: [PATCH net-next v6 1/4] printk: Add execution context (task name/CPU) to printk_info

From: Petr Mladek

Date: Thu Feb 05 2026 - 03:10:12 EST


On Tue 2026-02-03 09:23:52, Breno Leitao wrote:
> Extend struct printk_info to include the task name, pid, and CPU
> number where printk messages originate. This information is captured
> at vprintk_store() time and propagated through printk_message to
> nbcon_write_context, making it available to nbcon console drivers.
>
> This is useful for consoles like netconsole that want to include
> execution context in their output, allowing correlation of messages
> with specific tasks and CPUs regardless of where the console driver
> actually runs.
>
> The feature is controlled by CONFIG_PRINTK_EXECUTION_CTX, which is
> automatically selected by CONFIG_NETCONSOLE_DYNAMIC. When disabled,
> the helper functions compile to no-ops with no overhead.
>
> Suggested-by: John Ogness <john.ogness@xxxxxxxxxxxxx>
> Signed-off-by: Breno Leitao <leitao@xxxxxxxxxx>
> Signed-off-by: Petr Mladek <pmladek@xxxxxxxx>

This version version works as advertized. Feel free to use:

Reviewed-by: Petr Mladek <pmladek@xxxxxxxx>

But feel free to remove CONSOLE_HAS_EXECUTION_CTX completely
as suggested by John. It is true that it is not that useful
at the moment. And I am not sure if it would ever have any
good use.

Best Regards,
Petr