You can pass arguments to the driver to control debug behavior.

Two arguments can be passed to the driver to control the debug behavior:

  • g_traceLevel – Controls debug trace output flags (6.1. only).
  • g_eventFilter – Controls which event types are generated.

These arguments can be passed in the /etc/sysconfig/modules/cbsensor.modules file or as described in the following version-specific sections.

Sensor Version 6.1.x Driver Debug Parameters

For version 6.1.x sensors, use one of the following commands:

sudo insmod cbsensor.ko g_traceLevel=<value> g_eventFilter=<value>:
insmod cbsensor.ko g_traceLevel=0x00200000

OR

modprobe cbsensor g_traceLevel=0x00200000

where 0x00200000 is hook tracing.

The full list of levels is:

#define DL_INIT 0x00000001
#define DL_SHUTDOWN 0x00000002
#define DL_WARNING 0x00000004
#define DL_ERROR 0x00000008
#define DL_INFO 0x00000010
#define DL_REQUEST 0x00000100
#define DL_HOOK 0x00200000
#define DL_VERBOSE 0x08000000
#define DL_ENTRY 0x10000000
#define DL_EXIT 0x20000000

Create the log level mask you want, OR the individual levels.

Sensor Version 6.2.x Driver Debug Parameters

For version 6.2.2 sensors and later, the preferred method for setting the debug logging subsystem level is by editing /proc/debug-subsystems. In this file, the debug subsystem value is reported in hexadecimal as an 'or' of the following values.

An alternative to editing debug-subsystems is to use the following command:

sudo insmod cbsensor.ko g_debug_subsystem=<value> g_eventFilter=<value>

The subsystems are defined as:

#define DS_COMMS 0x0002
#define DS_FILE 0x0004
#define DS_HASH 0x0008
#define DS_BAN 0x0010
#define DS_HOOK 0x0020
#define DS_ISOLATE 0x0040
#define DS_LOG 0x0080
#define DS_LSM 0x0100
#define DS_MOD 0x0200
#define DS_NET 0x0400
#define DS_PROC 0x0800
#define DS_PROCFS 0x1000
#define DS_TEST 0x8000

If DS_TEST is specified, the enabled log levels and subsystems are logged to the system log (use dmesg to view). This is done at module load time when specified as a parameter.

Subsystem debug messages are reported at KERN_INFO level. The minimum kernel logging level must be at least KERN_INFO for these messages to be reported. It can be set at runtime via /proc/sys/kernel/printk or at boot time by setting the loglevel kernel command line parameter.