Kernel Logging

Kernel log can be obtained from two sources - either from serial console (directly or via Conserver) or from netconsole kernel module sending kernel logs via UDP to the specified address.

TE can process kernel log either in Test Agent or in Logger.

Using serial console directly

Serial console can be logged directly only in Test Agent residing on the same host as this serial console.

To configure direct serial console logging, in RCF Configuration File add a child thread tag to the ta tag corresponding to related Test Agent:

<thread name="log_serial" when="<!--if not void, thread will be created-->">
    <arg value="elrond"/><!-- Host name to be displayed in log -->
    <arg value="WARN"/> <!-- Log messages level -->
    <arg value="10"/> <!-- Timeout, in milliseconds; when elapsed, what
                           gathered will be printed -->
    <arg value="/dev/ttyS0"/> <!-- Path to serial console -->
    <arg value="exclusive"/> <!-- What to do if other process has already
                                  opened this device file: if argument is
                                  omitted or value is 'exclusive', exit
                                  with error;
                                  if value is 'force', kill other
                                  process(es) using the serial console
                                  before opening it;
                                  if value is 'shared', just open it. -->
</thread>

Using Conserver

If you have configured Conserver, you can tell Test Agent to use it adding the following thread child in its tag in RCF Configuration File :

<thread name="log_serial" when="<!-- not used but should not be void-->">
    <arg value="elrond"/><!-- Host name to be displayed in log -->
    <arg value="WARN"/> <!-- Log messages level -->
    <arg value="10"/> <!-- Timeout, in milliseconds; when elapsed, what
                           gathered will be printed -->
    <!-- Conserver configuration string; the first parameter can be
         omitted if conserver resides on the same host; IPv6 address
         should be specified in parenthesis -->
    <arg value="address or hostname:port:user:console"/>
</thread>

If you want to use Logger directly, the above tag should be specified in Logger Configuration File instead.

Using Netconsole

If kernel netconsole module is configured already then all you should do is to add in tag corresponding to Test Agent residing on the host to which netconsole sends logs in RCF Configuration File the following:

<thread name="log_serial" when="<!--not used but should not be void-->">
    <arg value="elrond"/><!-- Host name to be displayed in log -->
    <arg value="WARN"/> <!-- Log messages level -->
    <arg value="10"/> <!-- Timeout, in milliseconds; when elapsed, what
                           gathered will be printed -->
    <!-- Supposing that netconsole sends logs to UDP port 1234 -->
    <arg value="netconsole:1234"/>
</thread>

If Logger resides on the host to which logs are sent, you can specify this tag in Logger Configuration File instead to use Logger directly.

If netconsole kernel module is not configured and you wish to configure it from Test Agent automatically, in Configurator Configuration File add the following (replacing Agt_A with whatever you need):

<register>
    <object oid="/agent/netconsole" access="read_create" type="string"/>
</register>
<add>
    <instance oid="/agent:Agt_A/netconsole:netconsole_name"
              <!-- local_port:remote_host:remote_port -->
              value="6666:kili:6666"/>
</add>

You can add more than one netconsole node. Note: if the default configfs directory (/sys/kernel/config) is not available, the netconsole dynamic reconfiguration will not be used, but kernel module will be reloaded with new parameters.