[patch] netconsole - log kernel messages over the network. 2.4.10.

Ingo Molnar (mingo@elte.hu)
Wed, 26 Sep 2001 22:04:33 +0200 (CEST)

this is the first public release of the 'netconsole patch', a debugging
patch that implements kernel-level network logging via UDP packets.

the special thing about this approach is the ability to send 'emergency'
network packets even from IRQ handlers. This enables the netconsole to
send enough info even if we crash in init or in an interrupt handler.

another property of netconsole is that it's able to share the networking
device with other kernel subsystems, like the TCP/IP stack. So the
networking device is not dedicated for netconsole use, it's transparently

netconsole is also designed to be robust, it goes straight to the network
driver, so it does not depend on the networking stack to log messages.

kernel-level netlogging is useful in a number of scenarios:

- if remotely managed systems with no serial cable logging keep crashing
without any trace of an oops message in the userspace log. (the patch
was written to debug such a crash. Original idea of sending an
emergency packet from IRQ handlers comes from Daniel Veillard who's
system produced the crash - thanks Daniel!)

- if for whatever reason the amount of logging is so high that a serial
console cannot hold it and disks can not keep up - or in cases where
logged messages disturb the debugged subsystem. I'm sure fellow VM
hackers will find this useful :-)

- the netconsole can be used to emit crashdumps over the network, without
any delay between the point of crash and start of netlogging.

the kernel patch (against 2.4.10 or 2.4.9-ac), and a simple user-space
tool to display netconsole messages can be found at:


sample startup of the netconsole on the server:

insmod netconsole dev=eth1 target_ip=0x0a000701 \
source_port=6666 \
target_port=6666 \
target_eth_byte0=0x00 \
target_eth_byte2=0x27 \
target_eth_byte3=0x8C \
target_eth_byte4=0xA0 \

and on the client:

# ./netconsole-client -server -client -port 6666
[...network console startup...]
netconsole: network logging started up successfully!
SysRq : Loglevel set to 9

more about features and limitations can be found under:


reports, comments, suggestions welcome.


To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/