Running io-sock with diagnostic features

Updated: April 19, 2023

The io-sock network stack and networking drivers are also provided in diagnostic versions. They have the same name as the standard version with a “-diag” suffix: io-sock-diag, devs-em-diag.so, and so on.

The diagnostic versions add extra checks that are useful when you are developing networking drivers. Because they use significantly more system resources that the standard versions, you shouldn't use them in production systems.

Specifying the diagnostic stack and drivers

When you use the diagnostic versions of io-sock or networking drivers, you also must use diagnostic versions of the stack or driver because the added checks require extra information that is passed between stack and driver.

When you specify a driver with the io-sock-diag command, the appropriate diagnostic driver is loaded automatically. For example, the following command loads devs-em-diag.so:

io-sock-diag -d em

The diagnostic driver is also automatically loaded when you load a driver using mount and specify the driver using its short name. For example, if io-sock-diag is running, the following command loads devs-em-diag.so:

mount -T io-sock em

But if you run io-sock-diag and specify the full name of the driver, make sure you specify the diagnostic driver. For example:

mount -T io-sock /lib/dll/devs-em-diag.so

Writing diagnostic network drivers

For diagnostic versions of io-sock network drivers, the following defines are set automatically by the devs.mk file (which is included by the network driver recursive makefile):

CCFLAGS+= -DINVARIANTS -DINVARIANT_SUPPORT -DKTR

Running io-sock-diag in the background

Specify -o foreground with io-sock-diag to stop io-sock from becoming a daemon. This option is valid only with io-sock-diag. As with standard io-sock, all logs are sent to slogger2.