net: netconsole: convert to NBCON console infrastructure
Subsystems (6)
Breno Leitao
maintainerv7 cover net: netconsole: convert to NBCON console infrastructure
This series adds support for the nbcon (new buffer console) infrastructure to netconsole, enabling lock-free, priority-based console operations that are safer in crash scenarios.
The implementation is introduced in three steps:
0) Extend printk to expose CPU and taskname (task->comm) where the printk originated from. (Thanks John and Petr for the support in getting this done)
1) Refactor the message fragmentation logic into a reusable helper function
2) Extend nbcon support to non-extended (basic) consoles using the same infrastructure.
The initial discussion about it appeared a while ago in [1], in order to solve Mike's HARDIRQ-safe -> HARDIRQ-unsafe lock order warning, and the root cause is that some hosts were calling IRQ unsafe locks from inside console lock.
At that time, we didn't have the CON_NBCON_ATOMIC_UNSAFE yet. John kindly implemented CON_NBCON_ATOMIC_UNSAFE in 187de7c212e5 ("printk:
nbcon: Allow unsafe write_atomic() for panic"), and now we can implement netconsole on top of nbcon.
Important to note that netconsole continues to call netpoll and the network TX helpers with interrupt disable, given the TX are called with target_list_lock.
Netdev maintainers, Petr suggested that this patchset goes through netdev[2]
---
Changes in v7:
- Remove the intermediate CONSOLE_HAS_EXECUTION_CTX config option
- Link to v6: https://patch.msgid.link/[email protected]
Changes in v6:
- Do not select PRINTK_EXECUTION_CTX in NETCONSOLE_DYNAMIC (Jakub)
- Do not make PRINTK_EXECUTION_CTX user visible (Jakub)
- Link to v5: https://patch.msgid.link/[email protected]
Changes in v5:
- Replace the memcpy size from TASK_COMM_LEN to sizeof(wctxt->comm) (John)
- Add some compilation time asserts (John)
- Change the implementation of printk_info_get_cpu()
- Link to v4: https://patch.msgid.link/[email protected]
Changes in v4:
- Added __acquires/__releases compiler annotations (Simon)
- Rebased on top of net-next, which included changes from Andre
- Netconsole Dynamic now selects PRINTK_EXECUTION_CTX and CONSOLE_HAS_EXECUTION_CTX
- Link to v3: https://patch.msgid.link/[email protected]
Changes in v3:
- Fixed netconsole selection (s/CONSOLE_HAS_EXECUTION_CTX/PRINTK_EXECUTION_CTX)
- Removed unnecessary "inline" in C file.
- Tried to shrink the get the lines to fit 80-columns
- Link to v2: https://patch.msgid.link/[email protected]
Changes in v2:
- Return if not able to nbcon_enter_unsafe() instead of retrying on
a different target (Marcos)
- Add printk that supports context information, which will be used later by netconsole sysdata. (John, Petr)
- An extra patch to bring symmetry to send_msg_udp()
- Link to v1: https://patch.msgid.link/[email protected]
Changes in V1 from RFC:
* Removed the extra CONFIG for NBCON, given we don't want to support both console. Move to nbcon as the only console framework supported
* Incorporated the changes from Petr.
* Some renames to make the code more consistent.
* RFC Link: https://lore.kernel.org/all/[email protected]/
---
Breno Leitao (4):
printk: Add execution context (task name/CPU) to printk_info
netconsole: extract message fragmentation into send_msg_udp()
netconsole: convert to NBCON console infrastructure
netconsole: Use printk context for CPU and task information
drivers/net/Kconfig | 1 + drivers/net/netconsole.c | 153 +++++++++++++++++++++++--------------- include/linux/console.h | 8 ++ kernel/printk/internal.h | 8 ++ kernel/printk/nbcon.c | 16 ++++ kernel/printk/printk.c | 54 +++++++++++++- kernel/printk/printk_ringbuffer.h | 5 ++ lib/Kconfig.debug | 12 +++ 8 files changed, 197 insertions(+), 60 deletions(-)
---
base-commit: bf2e36c9dab95e41516fbcf7b1cc804539b2d021
change-id: 20251117-nbcon-f24477ca9f3e
Best regards,
Signature · 1 line
Breno Leitao <[email protected]>
Breno Leitao
maintainerPATCH v7 1/4 printk: Add execution context (task name/CPU) to printk_info
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.
--- drivers/net/Kconfig | 1 + include/linux/console.h | 8 ++++++ kernel/printk/internal.h | 8 ++++++ kernel/printk/nbcon.c | 16 ++++++++++++ kernel/printk/printk.c | 54 ++++++++++++++++++++++++++++++++++++++- kernel/printk/printk_ringbuffer.h | 5 ++++ lib/Kconfig.debug | 12 +++++++++ 7 files changed, 103 insertions(+), 1 deletion(-)
drivers/net/Kconfig +1 -0
@@ -341,6 +341,7 @@ config NETCONSOLE_DYNAMIC bool "Dynamic reconfiguration of logging targets" depends on NETCONSOLE && SYSFS && CONFIGFS_FS && \ !(NETCONSOLE=y && CONFIGFS_FS=m) + select PRINTK_EXECUTION_CTX help This option enables the ability to dynamically reconfigure target parameters (interface, IP addresses, port numbers, MAC addresses)
include/linux/console.h +8 -0
@@ -298,12 +298,20 @@ struct nbcon_context {* @outbuf: Pointer to the text buffer for output * @len: Length to write * @unsafe_takeover: If a hostile takeover in an unsafe state has occurred +* @cpu: CPU on which the message was generated +* @pid: PID of the task that generated the message +* @comm: Name of the task that generated the message */ struct nbcon_write_context {struct nbcon_context __private ctxt;char *outbuf;unsigned int len;bool unsafe_takeover; +#ifdef CONFIG_PRINTK_EXECUTION_CTX +int cpu; +pid_t pid; +char comm[TASK_COMM_LEN ]; +#endif };/**
kernel/printk/internal.h +8 -0
@@ -281,12 +281,20 @@ struct printk_buffers {* nothing to output and this record should be skipped. * @seq: The sequence number of the record used for @pbufs->outbuf. * @dropped: The number of dropped records from reading @seq. +* @cpu: CPU on which the message was generated. +* @pid: PID of the task that generated the message +* @comm: Name of the task that generated the message. */ struct printk_message {struct printk_buffers *pbufs;unsigned int outbuf_len;u64 seq;unsigned long dropped; +#ifdef CONFIG_PRINTK_EXECUTION_CTX +int cpu; +pid_t pid; +char comm[TASK_COMM_LEN ]; +#endif }; bool printk_get_next_message(struct printk_message *pmsg, u64 seq,
kernel/printk/nbcon.c +16 -0
@@ -946,6 +946,20 @@ void nbcon_reacquire_nobuf(struct nbcon_write_context *wctxt) }EXPORT_SYMBOL_GPL (nbcon_reacquire_nobuf); +#ifdef CONFIG_PRINTK_EXECUTION_CTX +static void wctxt_load_execution_ctx (struct nbcon_write_context *wctxt, +struct printk_message *pmsg) +{ + wctxt->cpu = pmsg->cpu; + wctxt->pid = pmsg->pid; +memcpy (wctxt->comm, pmsg->comm,sizeof (wctxt->comm)); +static_assert (sizeof (wctxt->comm) ==sizeof (pmsg->comm)); +} +#else +static void wctxt_load_execution_ctx (struct nbcon_write_context *wctxt, +struct printk_message *pmsg) {} +#endif +/** * nbcon_emit_next_record - Emit a record in the acquired context * @wctxt: The write context that will be handed to the write function
@@ -1048,6 +1062,8 @@ static bool nbcon_emit_next_record(struct nbcon_write_context *wctxt, bool use_a/* Initialize the write context for driver callbacks. */ nbcon_write_context_set_buf (wctxt, &pmsg.pbufs->outbuf[0 ], pmsg.outbuf_len); +wctxt_load_execution_ctx (wctxt, &pmsg); +if (use_atomic) con->write_atomic (con, wctxt);else
kernel/printk/printk.c +53 -1
82 lines not on this page · raw message
kernel/printk/printk_ringbuffer.h +5 -0
@@ -23,6 +23,11 @@ struct printk_info { u8 flags:5; /* internal record flags */ u8 level:3; /* syslog level */u32 caller_id;/* thread id or processor id */ +#ifdef CONFIG_PRINTK_EXECUTION_CTX +u32 caller_id2;/* caller_id complement */ +/* name of the task that generated the message */ +char comm[TASK_COMM_LEN ]; +#endif struct dev_printk_info dev_info; };
lib/Kconfig.debug +12 -0
@@ -35,6 +35,18 @@ config PRINTK_CALLER no option to enable/disable at the kernel command line parameter or sysfs interface. +config PRINTK_EXECUTION_CTX + bool + depends on PRINTK + help + This option extends struct printk_info to include extra execution + context in printk, such as task name and CPU number from where the + message originated. This is useful for correlating printk messages + with specific execution contexts. + + This is automatically enabled when a console driver that supports + execution context is selected. + config STACKTRACE_BUILD_ID bool "Show build ID information in stacktraces" depends on PRINTK
Signature · 1 line
2.47.3
Breno Leitao
maintainerPATCH v7 2/4 netconsole: extract message fragmentation into send_msg_udp()
In reply to Breno LeitaoExtract the message fragmentation logic from write_msg() into a dedicated send_msg_udp() function. This improves code readability and prepares for future enhancements.
The new send_msg_udp() function handles splitting messages that exceed MAX_PRINT_CHUNK into smaller fragments and sending them sequentially. This function is placed before send_ext_msg_udp() to maintain a logical ordering of related functions.
No functional changes - this is purely a refactoring commit.
--- drivers/net/netconsole.c | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-)
drivers/net/netconsole.c +15 -9
@@ -1876,12 +1876,24 @@ static void write_ext_msg(struct console *con, const char *msg,spin_unlock_irqrestore (&target_list_lock, flags); } +static void send_msg_udp (struct netconsole_target *nt,const char *msg, +unsigned int len) +{ +const char *tmp = msg; +int frag, left = len; + +while (left >0 ) { + frag =min (left,MAX_PRINT_CHUNK ); +send_udp (nt, tmp, frag); + tmp += frag; + left -= frag; + } +} +static void write_msg (struct console *con,const char *msg,unsigned int len) { -int frag, left;unsigned long flags;struct netconsole_target *nt; -const char *tmp;if (oops_only && !oops_in_progress)return ;
@@ -1899,13 +1911,7 @@ static void write_msg(struct console *con, const char *msg, unsigned int len)* at least one target if we die inside here, instead * of unnecessarily keeping all targets in lock-step. */ - tmp = msg; -for (left = len; left;) { - frag =min (left,MAX_PRINT_CHUNK ); -send_udp (nt, tmp, frag); - tmp += frag; - left -= frag; - } +send_msg_udp (nt, msg, len); } }spin_unlock_irqrestore (&target_list_lock, flags);
Signature · 1 line
2.47.3
Breno Leitao
maintainerPATCH v7 3/4 netconsole: convert to NBCON console infrastructure
In reply to Breno LeitaoConvert netconsole from the legacy console API to the NBCON framework. NBCON provides threaded printing which unblocks printk()s and flushes in a thread, decoupling network TX from printk() when netconsole is in use.
Since netconsole relies on the network stack which cannot safely operate from all atomic contexts, mark both consoles with CON_NBCON_ATOMIC_UNSAFE. (See discussion in [1])
CON_NBCON_ATOMIC_UNSAFE restricts write_atomic() usage to emergency scenarios (panic) where regular messages are sent in threaded mode.
Implementation changes:
- Unify write_ext_msg() and write_msg() into netconsole_write()
- Add device_lock/device_unlock callbacks to manage target_list_lock
- Use nbcon_enter_unsafe()/nbcon_exit_unsafe() around network operations.
- If nbcon_enter_unsafe() fails, just return given netconsole lost the ownership of the console.
- Set write_thread and write_atomic callbacks (both use same function)
--- drivers/net/netconsole.c | 101 +++++++++++++++++++++++++++++------------------ 1 file changed, 62 insertions(+), 39 deletions(-)
drivers/net/netconsole.c +62 -39
@@ -1859,23 +1859,6 @@ static void send_ext_msg_udp(struct netconsole_target *nt, const char *msg, sysdata_len); } -static void write_ext_msg (struct console *con,const char *msg, -unsigned int len) -{ -struct netconsole_target *nt; -unsigned long flags; - -if ((oops_only && !oops_in_progress) ||list_empty (&target_list)) -return ; - -spin_lock_irqsave (&target_list_lock, flags); -list_for_each_entry (nt, &target_list, list) -if (nt->extended && nt->state ==STATE_ENABLED && -netif_running (nt->np.dev)) -send_ext_msg_udp (nt, msg, len); -spin_unlock_irqrestore (&target_list_lock, flags); -} -static void send_msg_udp (struct netconsole_target *nt,const char *msg,unsigned int len) {
@@ -1890,30 +1873,64 @@ static void send_msg_udp(struct netconsole_target *nt, const char *msg, } } -static void write_msg (struct console *con,const char *msg,unsigned int len) +/** +* netconsole_write - Generic function to send a msg to all targets +* @wctxt: nbcon write context +* @extended: "true" for extended console mode +* +* Given an nbcon write context, send the message to the netconsole targets +*/ +static void netconsole_write (struct nbcon_write_context *wctxt,bool extended) { -unsigned long flags;struct netconsole_target *nt;if (oops_only && !oops_in_progress)return ; -/* Avoid taking lock and disabling interrupts unnecessarily */ -if (list_empty (&target_list)) -return ; -spin_lock_irqsave (&target_list_lock, flags);list_for_each_entry (nt, &target_list, list) { -if (!nt->extended && nt->state ==STATE_ENABLED && -netif_running (nt->np.dev)) { -/* -* We nest this inside the for-each-target loop above -* so that we're able to get as much logging out to -* at least one target if we die inside here, instead -* of unnecessarily keeping all targets in lock-step. -*/ -send_msg_udp (nt, msg, len); - } +if (nt->extended != extended || nt->state !=STATE_ENABLED || + !netif_running (nt->np.dev)) +continue ; + +/* If nbcon_enter_unsafe() fails, just return given netconsole +* lost the ownership, and iterating over the targets will not +* be able to re-acquire. +*/ +if (!nbcon_enter_unsafe (wctxt)) +return ; + +if (extended) +send_ext_msg_udp (nt, wctxt->outbuf, wctxt->len); +else +send_msg_udp (nt, wctxt->outbuf, wctxt->len); + +nbcon_exit_unsafe (wctxt); } +} + +static void netconsole_write_ext (struct console *con__always_unused , +struct nbcon_write_context *wctxt) +{ +netconsole_write (wctxt, true); +} + +static void netconsole_write_basic (struct console *con__always_unused , +struct nbcon_write_context *wctxt) +{ +netconsole_write (wctxt, false); +} + +static void netconsole_device_lock (struct console *con__always_unused , +unsigned long *flags) +__acquires(&target_list_lock) +{ +spin_lock_irqsave (&target_list_lock, *flags); +} + +static void netconsole_device_unlock (struct console *con__always_unused , +unsigned long flags) +__releases(&target_list_lock) +{spin_unlock_irqrestore (&target_list_lock, flags); }
@@ -2077,15 +2094,21 @@ static void free_param_target(struct netconsole_target *nt) }static struct console netconsole_ext = { - .name ="netcon_ext" , - .flags =CON_ENABLED |CON_EXTENDED , - .write = write_ext_msg, + .name ="netcon_ext" , + .flags =CON_ENABLED |CON_EXTENDED |CON_NBCON |CON_NBCON_ATOMIC_UNSAFE , + .write_thread = netconsole_write_ext, + .write_atomic = netconsole_write_ext, + .device_lock = netconsole_device_lock, + .device_unlock = netconsole_device_unlock, };static struct console netconsole = { - .name ="netcon" , - .flags =CON_ENABLED , - .write = write_msg, + .name ="netcon" , + .flags =CON_ENABLED |CON_NBCON |CON_NBCON_ATOMIC_UNSAFE , + .write_thread = netconsole_write_basic, + .write_atomic = netconsole_write_basic, + .device_lock = netconsole_device_lock, + .device_unlock = netconsole_device_unlock, };static int __init init_netconsole (void )
Signature · 1 line
2.47.3
Breno Leitao
maintainerPATCH v7 4/4 netconsole: Use printk context for CPU and task information
In reply to Breno LeitaoUse the CPU and task name captured at printk() time from nbcon_write_context instead of querying the current execution context. This provides accurate information about where the message originated, rather than where netconsole happens to be running.
For CPU, use wctxt->cpu instead of raw_smp_processor_id().
For taskname, use wctxt->comm directly which contains the task name captured at printk time.
This change ensures netconsole outputs reflect the actual context that generated the log message, which is especially important when the console driver runs asynchronously in a dedicated thread.
--- drivers/net/netconsole.c | 40 +++++++++++++++++++++++----------------- 1 file changed, 23 insertions(+), 17 deletions(-)
drivers/net/netconsole.c +23 -17
@@ -1490,18 +1490,20 @@ static void populate_configfs_item(struct netconsole_target *nt,init_target_config_group (nt, target_name); } -static int sysdata_append_cpu_nr (struct netconsole_target *nt,int offset) +static int sysdata_append_cpu_nr (struct netconsole_target *nt,int offset, +struct nbcon_write_context *wctxt) {return scnprintf (&nt->sysdata[offset],MAX_EXTRADATA_ENTRY_LEN ," cpu=%u\n" , -raw_smp_processor_id ()); + wctxt->cpu); } -static int sysdata_append_taskname (struct netconsole_target *nt,int offset) +static int sysdata_append_taskname (struct netconsole_target *nt,int offset, +struct nbcon_write_context *wctxt) {return scnprintf (&nt->sysdata[offset],MAX_EXTRADATA_ENTRY_LEN ," taskname=%s\n" , - current->comm); + wctxt->comm); }static int sysdata_append_release (struct netconsole_target *nt,int offset)
@@ -1522,8 +1524,10 @@ static int sysdata_append_msgid(struct netconsole_target *nt, int offset)/* * prepare_sysdata - append sysdata in runtime * @nt: target to send message to +* @wctxt: nbcon write context containing message metadata */ -static int prepare_sysdata (struct netconsole_target *nt) +static int prepare_sysdata (struct netconsole_target *nt, +struct nbcon_write_context *wctxt) {int sysdata_len =0 ;
@@ -1531,9 +1535,9 @@ static int prepare_sysdata(struct netconsole_target *nt) goto out;if (nt->sysdata_fields &SYSDATA_CPU_NR ) - sysdata_len +=sysdata_append_cpu_nr (nt, sysdata_len); + sysdata_len +=sysdata_append_cpu_nr (nt, sysdata_len, wctxt);if (nt->sysdata_fields &SYSDATA_TASKNAME ) - sysdata_len +=sysdata_append_taskname (nt, sysdata_len); + sysdata_len +=sysdata_append_taskname (nt, sysdata_len, wctxt);if (nt->sysdata_fields &SYSDATA_RELEASE ) sysdata_len +=sysdata_append_release (nt, sysdata_len);if (nt->sysdata_fields &SYSDATA_MSGID )
@@ -1831,31 +1835,33 @@ static void send_msg_fragmented(struct netconsole_target *nt,/** * send_ext_msg_udp - send extended log message to target * @nt: target to send message to -* @msg: extended log message to send -* @msg_len: length of message +* @wctxt: nbcon write context containing message and metadata * -* Transfer extended log @msg to @nt. If @msg is longer than +* Transfer extended log message to @nt. If message is longer than * MAX_PRINT_CHUNK, it'll be split and transmitted in multiple chunks with * ncfrag header field added to identify them. */ -static void send_ext_msg_udp (struct netconsole_target *nt,const char *msg, -int msg_len) +static void send_ext_msg_udp (struct netconsole_target *nt, +struct nbcon_write_context *wctxt) {int userdata_len =0 ;int release_len =0 ;int sysdata_len =0 ; +int len;#ifdef CONFIG_NETCONSOLE_DYNAMIC - sysdata_len =prepare_sysdata (nt); + sysdata_len =prepare_sysdata (nt, wctxt); userdata_len = nt->userdata_length;#endif if (nt->release) release_len =strlen (init_utsname ()->release) +1 ; -if (msg_len + release_len + sysdata_len + userdata_len <=MAX_PRINT_CHUNK ) -return send_msg_no_fragmentation (nt, msg, msg_len, release_len); + len = wctxt->len + release_len + sysdata_len + userdata_len; +if (len <=MAX_PRINT_CHUNK ) +return send_msg_no_fragmentation (nt, wctxt->outbuf, + wctxt->len, release_len); -return send_msg_fragmented (nt, msg, msg_len, release_len, +return send_msg_fragmented (nt, wctxt->outbuf, wctxt->len, release_len, sysdata_len); }
@@ -1900,7 +1906,7 @@ static void netconsole_write(struct nbcon_write_context *wctxt, bool extended)return ;if (extended) -send_ext_msg_udp (nt, wctxt->outbuf, wctxt->len); +send_ext_msg_udp (nt, wctxt);else send_msg_udp (nt, wctxt->outbuf, wctxt->len);
Signature · 1 line
2.47.3
Re: [PATCH net-next v7 1/4] printk: Add execution context (task name/CPU) to printk_info
In reply to Breno LeitaoQuoted 10 lines · Breno Leitao
Extend struct
printk_infoto include the task name, pid, and CPU number where printk messages originate. This information is captured atvprintk_store()time and propagated throughprintk_messagetonbcon_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.
Quoted 8 lines
The feature is controlled by
CONFIG_PRINTK_EXECUTION_CTX, which is automatically selected byCONFIG_NETCONSOLE_DYNAMIC. When disabled, the helper functions compile to no-ops with no overhead.Suggested-by John Ogness <[email protected]>Signed-off-by Petr Mladek <[email protected]>Reviewed-by Petr Mladek <[email protected]>Signed-off-by Breno Leitao <[email protected]>
Thanks!
This series was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:
Hello:
This series was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:
Quoted 6 lines · On Fri, 06 Feb 2026 04:45:28 -0800 you wrote:
This series adds support for the nbcon (new buffer console) infrastructure to netconsole, enabling lock-free, priority-based console operations that are safer in crash scenarios.
The implementation is introduced in three steps:
Quoted 8 lines
0) Extend printk to expose CPU and taskname (
task->comm) where the printk originated from. (Thanks John and Petr for the support in getting this done)
1) Refactor the message fragmentation logic into a reusable helper function
2) Extend nbcon support to non-extended (basic) consoles using the same infrastructure.[...]
Here is the summary with links:
- [net-next,v7,1/4] printk: Add execution context (task name/CPU) to printk_info
https://git.kernel.org/netdev/net-next/c/60325c27d3cf - [net-next,v7,2/4] netconsole: extract message fragmentation into send_msg_udp() https://git.kernel.org/netdev/net-next/c/eaf35bc63be7 - [net-next,v7,3/4] netconsole: convert to NBCON console infrastructure https://git.kernel.org/netdev/net-next/c/7eab73b18630 - [net-next,v7,4/4] netconsole: Use printk context for CPU and task information https://git.kernel.org/netdev/net-next/c/79ba362b4337
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html
Re: [PATCH net-next v7 1/4] printk: Add execution context (task name/CPU) to printk_info
In reply to Breno LeitaoHi Breno,
Quoted 10 lines · Breno Leitao
Extend struct
printk_infoto include the task name, pid, and CPU number where printk messages originate. This information is captured atvprintk_store()time and propagated throughprintk_messagetonbcon_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.
Quoted 8 lines
The feature is controlled by
CONFIG_PRINTK_EXECUTION_CTX, which is automatically selected byCONFIG_NETCONSOLE_DYNAMIC. When disabled, the helper functions compile to no-ops with no overhead.Suggested-by John Ogness <[email protected]>Signed-off-by Petr Mladek <[email protected]>Reviewed-by Petr Mladek <[email protected]>Signed-off-by Breno Leitao <[email protected]>
Thanks for your patch, which is now commit 60325c27d3cfe134 ("printk:
Add execution context (task name/CPU) to printk_info").
This increases (the IMHO already large) _printk_rb_static_infos array by another 40 KiB, according to bloat-o-meter:
_printk_rb_static_infos 180224 221184 +40960
drivers/net/Kconfig config NETCONSOLE_DYNAMIC · line 347
Quoted 10 lines
drivers/net/Kconfig +1
-0@@ -341,6 +341,7 @@ config NETCONSOLE_DYNAMIC bool "Dynamic reconfiguration of logging targets" depends on NETCONSOLE && SYSFS && CONFIGFS_FS && \ !(NETCONSOLE=y && CONFIGFS_FS=m) + select PRINTK_EXECUTION_CTX help This option enables the ability to dynamically reconfigure target parameters (interface, IP addresses, port numbers, MAC addresses)
I guess we should start disabling NETCONSOLE_DYNAMIC in the m68k defconfigs...
Gr{oetje,eeting}s,
Geert
Signature · 5 lines
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected] In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds