sodebug Command

Purpose

Sets or unsets the socket debug flag (SO_DEBUG socket option) and trace level on sockets.

Syntax

sodebug [ -h ] [ -l [ level ] ] [ -p pid | -s sockaddr [ -t type ] ]

Description

The sodebug command sets, unsets, or lists the socket debug flag and trace level on active sockets

If the socket debug flag (also known as the SO_DEBUG socket option) is set for a socket, the events on this socket can be traced using the trace command.

You can use the -l option to set the socket debug flag on sockets that already exist on a system. The -l option also sets the trace level for a given socket.

If the sodebug command is run without any options, the socket debug flag status and trace level for each active socket displays.

The trace and trpt commands collect information based on the trace level.

The following table describes the information collected based on the trace level for trace hook ID 25A (TCPDBG):
  min normal detail
tcp_debug data (td_time, td_act, td_ostate, td_tcb, family and td_req)   X X
tcpip header   X X
Address of tcpcb   X X
All tcpcb fields     X
Address of socket   X X
All socket fields     X
You can also set or unset the socket debug flag and the trace level as described below:
  1. The following command enables the socket debug flag for all sockets that are subsequently created on the system:
    no -o sodebug=1
  2. You can specify |DEBUG[=level] in the wait/nowait field of a service in inetd.conf to turn on socket debugging for a specific service. You can set the trace level to min, normal, or detail. If no level is specified, the default level is normal.
  3. You can set socket debugging on or off for all subsequent sockets created by a process using the sodebug_env parameter of the no command and specifying export SODEBUG=level in a process environment. You can set the trace level to min, normal, or detail.

Flags

Item Description
-h Displays help for the sodebug command.
-l [level] Specifies the trace level. Valid values for level are none, min, normal, and detail. If no level is specified, the default trace level is normal.
-p pid Specifies the process ID of a process.
-s sockaddr Specifies a socket by the socket address, the address of the socket's inpcb, or the address of the socket's tcpcb.
-t type Specifies the type of address that is specified by the -s sockaddr option. Valid values are socket, inpcb, and tcpcb. The default value is socket.

Security

You must have root authority to run the sodebug command.

Examples

  1. To list the debug flag and socket trace level for socket f100090002d0a800, type:
    sodebug -s f100090002d0a800
    The output is similar to the following example:
    socket address : f100090002d0a800 , sodebug flag : 0 , trace level : none(0)
  2. To set the trace level to normal and set the debug flag to 1, type:
    sodebug -s f100090002d0a800 -l normal
    The output is similar to the following example:
    Setting new values for trace level and debug flag
    socket address : f100090002d0a800 , sodebug flag : 1 , trace level : normal(3)