Tux
Communication
Mailing lists
Documentation
User Manual
Target board info.
Target chip info.
Support
Linux support
Bugzilla
Downloads
STLinux
Updates
Search
Google


The web
stlinux.com
Network console logging support
ST Logo

This support implements the kernel level network logging via UDP.

The 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
  • if the amount of logging is so high that a serial console cannot hold it
  • in cases where logged messages disturb the debugged subsystem

The netconsole module can be used either built-in or as a module.

To use it add the following kernel parameter in commnd line:

    netconsole=[src-port]@[src-ip]/[dev],[dest-port]@dest-ip/[dest-macaddr]
where:
  • src-port: source for UDP packets (defaults to 6665)
  • src-ip: source IP to use (interface address)
  • dev: network interface (eth0)
  • dest-port: port for logging agent (6666)
  • dest-ip: IP address for logging agent
  • dest-macaddr: ethernet MAC address for logging agent (broadcast)

Using netconsole as built-in

  • when building the kernel enable "Network console logging support (EXPERIMENTAL)" in the "Device Drivers"->"Networking support" menu
  • make ARCH=sh CROSS_COMPILE=sh4-linux- vmlinux
  • Note: built-in netconsole starts immediately after the TCP stack is initialized and attempts to bring up the supplied dev at the supplied address.

Using netconsole as dynamic module

  • on the host
    • when building the kernel set the "Network console logging support (EXPERIMENTAL)" with M value
    • make ARCH=sh CROSS_COMPILE=sh4-linux- vmlinux
    • make ARCH=sh CROSS_COMPILE=sh4-linux- modules
    • copy the drivers/net/netconsole.ko file object in your rootFS
    • boot your target
  • on the target
      insmod netconsole.ko netconsole=[src-port]@[src-ip]/[dev],[dest-port]@dest-ip/[dest-macaddr]
  • On the remote host you could execute:
      netcat -u -l -p dest-port -v

For more datails see the kernel documentation (Documentation/networking/netconsole.txt)


Example

This example shows a Linux Kernel boot using netconsole support.

Platforms connection
     _____________            _______________
    |             |          |               |
    | ST Platform |          |   LINUX HOST  |
    |_____________|          |_______________|
          |                           |
          |          UDP/IP  	      |
          |___________________________|

   local IP = 192.168.1.108	remote IP = 192.168.1.110
   local port = 6665		remote eth addr = 6666
sample startup of the netconsole on the server 
[root@linuxHOST root]# netcat -u -l -p 6666 -v
Received packet from 192.168.1.108:6665 -> 192.168.1.110:6666 (local)
Linux version 2.6.10-rc1-sim (cavagiu@lxmcdt7) 
(gcc version 3.4.3) #32 Mon Feb 21 16:26:27 CET 2005
STMicroelectronics ST220 Eval initialisation
EPLD version: 2.0 PCB revision: B
Built 1 zonelists
Kernel command line: console=ttyAS0,115200 
root=/dev/nfs 
nfsroot=164.130.129.16:/opt/STM/STLinux-2.0/devkit/sh4/target/ 
timeo=4,rsize=1024 
ip=192.168.1.108:164.130.129.16:192.168.1.254:255.255.255.0:cavagiu::off 
mtdparts=Onboard_Flash:256k,2048k,- 
netconsole=@192.168.1.108/eth0,@192.168.1.110/
netconsole: local port 6665
netconsole: local IP 192.168.1.108
netconsole: interface eth0
netconsole: remote port 6666
netconsole: remote IP 192.168.1.110
netconsole: remote ethernet address ff:ff:ff:ff:ff:ff
PID hash table entries: 512 (order: 9, 8192 bytes)
Calculated peripheral clock value 69065976 differs from sh_pclk 
value 66000000, fixing..
Calculated peripheral clock value 66600000 differs from probed 
or set value 69065976, fixing..
CPU clock: 199.80MHz
Bus clock: 133.20MHz
Module clock: 66.60MHz
Bus clock: 133.20MHz
Interval = 166500
Dentry cache hash table entries: 16384 (order: 4, 65536 bytes)
Inode-cache hash table entries: 8192 (order: 3, 32768 bytes)
Memory: 62592k/65536k available (1806k kernel code, 2852k 
reserved, 217k data, 68k init)
Mount-cache hash table entries: 512 (order: 0, 4096 bytes)
CPU: 
NET: Registered protocol family 16
SH Virtual Bus initialized
lirc_dev: IR Remote Control driver registered, at major 61
STM Lirc plugin init
lirc_dev: lirc_register_plugin:sample_rate: 0
STPIO layer initialised
STMicroelectronics ASC driver initialized
asc_init: check the clock
ttyAS0 at MMIO 0xb8330000 (irq = 185) is a asc
asc_init: check the clock
ttyAS1 at MMIO 0xb8331000 (irq = 186) is a asc
io scheduler noop registered
io scheduler anticipatory registered
io scheduler deadline registered
io scheduler cfq registered
RAMDISK driver initialized: 16 RAM disks of 4096K size 1024 blocksize
smc91x.c: v1.1, sep 22 2004 by Nicolas Pitre 
eth0: SMC91C11xFD (rev 1) at 0xa1800300 IRQ 11
eth0: Ethernet addr: 00:80:e1:12:02:30
netconsole: device eth0 not up yet, forcing it
eth0: link down
eth0: link up, 100Mbps, full-duplex, lpa 0x45E1
netconsole: network logging started
Uniform Multi-Platform E-IDE driver Revision: 7.00alpha2
ide: Assuming 50MHz system bus speed for PIO modes; override with idebus=xx
ide setup: hwif 0x88224f3c, dma_base 0xb4500000, ports 0x400
    ide0: MMIO-DMA
elevator: using anticipatory as default io scheduler
NET: Registered protocol family 2
IP: routing cache hash table of 512 buckets, 4Kbytes
TCP: Hash tables configured (established 4096 bind 8192)
NET: Registered protocol family 1
IP-Config: Complete:
      device=eth0, addr=192.168.1.108, mask=255.255.255.0, gw=192.168.1.254,
     host=cavagiu, domain=, nis-domain=(none),
     bootserver=164.130.129.16, rootserver=164.130.129.16, rootpath=
Looking up port of RPC 100003/2 on 164.130.129.16
Looking up port of RPC 100005/1 on 164.130.129.16
VFS: Mounted root (nfs filesystem) readonly.
Freeing unused kernel memory: 68k freed

Known limits

  1. The netconsole support has been tested connecting the Linux PC host and the ST40 target at the same subnet.
Valid HTML 4.01! Last updated: 2007/08/22 10:30:38
© Copyright STMicroelectronics Limited, 2005
Printer