Linux日志出现大量"kernel: NET: Registered protocol

一台Linux服务器的系统错误日志出现大量的“ kernel: NET: Registered protocol family 36”错误信息,如下所示:

  In short, for bare metal embedded development, we highly recommend solutions that can be used on all major platforms (Windows, macOS and GNU/Linux), with hardware probes that implement the SWD protocol and support tracing via the SWO pin. The preferred probes that match the above requirements are J-Link EDU/J-Link, from SEGGER.

 

Overview

 

  Although it varies a lot depending on personal skills and experience, debugging can be one of the most time consuming activities during software development, and any solutions intended to address it are welcome.

Jul  2 05:27:45 xxxxxx kernel: NET: Registered protocol family 36

 

Jul  2 05:27:45 xxxxxx kernel: NET: Unregistered protocol family 36

 

Jul  2 05:28:29 xxxxxx kernel: NET: Registered protocol family 36

 

Jul  2 05:28:29 xxxxxx kernel: NET: Unregistered protocol family 36

 

Jul  2 05:29:10 xxxxxx kernel: NET: Registered protocol family 36

 

Jul  2 05:29:10 xxxxxx kernel: NET: Unregistered protocol family 36

 

Jul  2 05:30:02 xxxxxx kernel: NET: Registered protocol family 36

 

Jul  2 05:30:02 xxxxxx kernel: NET: Unregistered protocol family 36

Generally there are two approaches:

 

  • manually stepping through the code to check the program flow and inspect various status variables
  • letting the program run and automatically collect various tracing messages (like the traditional printf() calls) and/or execution events (enter/exit interrupt handlers, memory location change, etc)

 

  To be noted that these approaches are not exclusive, but complement each other, since they better serve different purposes, and have specific advantages and disadvantages.

搜索了一下,Syslog being flooded with kernel "NET: Registered protocol family 38" messages. 与 Syslog being flooded with kernel "NET: Registered protocol family 38" messages. 这两篇文章都反馈,由于Linux运行在VMWare虚拟化环境下,安装了vmware-tools,将vmware-tools从10.0.5.-1 升级到10.1.0 就会解决这个问题。摘抄部分内容如下

Manual stepping

 

  Manually stepping through the code is great for debugging a standalone linear piece of code, to check if the implementation of an algorithm is correct, to detect off-by-one errors (accessing past the size of an array or collection). It is also useful to get an initial understanding of the functionality of a piece of code written by someone else. Its main drawback is severely distorting the time behaviour of the debugged code, which, if the debugged device is interacting with other external devices, will most likely trigger timeouts. For complex code, with multiple iterations and multiple processes, it is quite tedious, requiring a lot of manual interactions with the debugger to reach the desired point in time, especially when the sessions are expected to be restarted often.

Situation

  The manual stepping approach generally requires a generic debugger and a specific method to connect it to the application to be debugged. The GNU toolchains provide a standard gdb command line tool to interact with the debugged application, and Eclipse provides various plug-ins to integrate the command line tool into the IDE.

Following a round of patching, it was observed that syslog was flooded with the following messages :

  The recommended way to connect gdb, running on the development machine, to the application, running on an embedded device, is to use a gdb server.

 

  If the debugged application is a GNU/Linux ARM application, running on an embedded device like BeagleBone or Raspberry, the gdb server must be first installed and started on it, then the gdb client needs to be instructed to connect via tcp/ip to it and start the debug session.


  If the debugged application runs on a bare metal device, then it is necessary to use a physical probe, to load the device memory and to assist during the debugging session. The standard way is to use a JTAG or SWD probe, paired with a custom gdb server, able to talk to it on one side, and to accept the standard gdb commands on the other side.

cut here ---

Using trace messages

Nov 10 12:08:21 server kernel: [26068249.154815] NET: Unregistered protocol family 38

  Collecting tracing messages and events, when used wisely, can be a valuable source of information regarding the flow of a complex application, with multiple interacting threads, being especially useful when the debug sessions are restarted often. Once the trace messages are added, the dynamic life of various threads/handlers can be seen with a simple view of the trace log.

Nov 10 12:08:21 server kernel: [26068249.154832] NET: Registered protocol family 38

  In addition to classical printf() messages that need to be manually inserted in the code, for embedded applications, modern ARM cores, including those in the Cortex-M families, provide special support for collecting hardware events, like accurate timestamps when an interrupt handler was entered/exited, when a memory location was accessed, and more.

Nov 10 12:08:21 server kernel: [26068249.190805] NET: Unregistered protocol family 38

  Recognising the importance of these methods, the designers of the ARM families added special support, like the SWO (Serial Wire Output) pin in Cortex-M processors, or even more elaborate interfaces for larger ARM processors.

Nov 10 12:08:23 server kernel: [26068251.200546] NET: Registered protocol family 38

GDB

Nov 10 12:08:23 server kernel: [26068251.218140] NET: Unregistered protocol family 38

  The tool used by GNU ARM Eclipse plug-ins for debugging is the ARM version of GDB, the venerable GNU debugging tool.

Nov 10 12:08:23 server kernel: [26068251.218157] NET: Registered protocol family 38

This Article is From: GUN ARM Eclipse

Nov 10 12:08:23 server kernel: [26068251.238126] NET: Unregistered protocol family 38

Nov 10 12:08:23 server kernel: [26068251.238150] NET: Registered protocol family 38

Nov 10 12:08:23 server kernel: [26068251.266167] NET: Unregistered protocol family 38


cut here ---

Resolution

本文由金沙官网线上发布于操作系统,转载请注明出处:Linux日志出现大量"kernel: NET: Registered protocol

您可能还会对下面的文章感兴趣: