Re: [PATCH RFC net-next v3 6/8] netconsole: add support for sysdata and CPU population
From: Simon Horman
Date: Thu Jan 30 2025 - 05:38:52 EST
On Fri, Jan 24, 2025 at 07:16:45AM -0800, Breno Leitao wrote:
> Add infrastructure to automatically append kernel-generated data (sysdata)
> to netconsole messages. As the first use case, implement CPU number
> population, which adds the CPU that sent the message.
>
> This change introduces three distinct data types:
> - extradata: The complete set of appended data (sysdata + userdata)
> - userdata: User-provided key-value pairs from userspace
> - sysdata: Kernel-populated data (e.g. cpu=XX)
>
> The implementation adds a new configfs attribute 'cpu_nr' to control CPU
> number population per target. When enabled, each message is tagged with
> its originating CPU. The sysdata is dynamically updated at message time
> and appended after any existing userdata.
>
> The CPU number is formatted as "cpu=XX" and is added to the extradata
> buffer, respecting the existing size limits.
>
> Signed-off-by: Breno Leitao <leitao@xxxxxxxxxx>
Reviewed-by: Simon Horman <horms@xxxxxxxxxx>