Linux client logging and tracing

This topic describes the logging and tracing capabilities available on SAN File System Linux clients.

Configure the syslog facility and select one or more SAN File System classes to enable tracing and logging on the SAN File System Linux client.

Syslog facility

The SAN File System client generates both log and trace messages, which are routed through the syslog facility on the Linux operating system. The syslog facility captures log and trace output from the kernel as well as other operating system services.

By default, the syslog facility discards all kernel output. However, you can configure the syslog facility to specify a destination for the messages by modifying /etc/syslog.conf.
  • Specifying a file as the destination.
    You can specify a file to receive kernel messages, such as /var/log/messages. To specify that file, perform the following steps:
    1. Create /var/log/messages if it does not already exist. You can use the Linux touch command to create an empty file.
    2. Edit /etc/syslog.conf.
    3. Make sure that this line exists and is not commented out:

      kern.debug /var/log/messages

    4. If you modified the file in step 3, then restart the syslogd daemon:
      /sbin/service syslog restart
      Refer to the Linux Commands Reference for more information about the syslogd daemon.
  • Specifying the console as the destination.
    To specify the console as the destination for kernel messages, perform the following steps:
    1. Edit /etc/syslog.conf.
    2. Make sure that this line exists and is not commented out:

      kern.debug /dev/console

    3. Restart the syslogd daemon:
      /sbin/service syslog restart
      Refer to the Linux Commands Reference for more information about the syslogd daemon.

When you specify kern.debug as shown in the previous examples, all levels of kernel output are routed because debug is the lowest priority level of kernel output. You could specify a different level of output, such as kern.info to show just informational messages.

Selecting SAN File System classes

Tracing in the SAN File System is controlled according to components called classes. A class loosely corresponds to a file system operation such as mounting or reading.

The classes are grouped into two groups:
  • Upper-driver classes
  • CSM classes
Upper-driver classes are controlled by /proc/fs/stfs/debug. Here is an example of the initial contents of the /proc/fs/stfs/debug file:
$ cat /proc/fs/stfs/debug
INIT 			  OFF
MOUNT 			 OFF
DISK 			  OFF
PAGER 			 OFF
IO 					  OFF
INODE 			 OFF
FILEHAND 	OFF
RNGLOCK 		OFF
RDWR 			  OFF
CLEANER 		OFF
PROC 			  OFF
FILEOP 		 OFF
INODEOP 		OFF
SUPEROP 		OFF
CSM 				  OFF
CSM classes are controlled by /proc/fs/stfs/csmdebug. Here is an example of the initial contents of the /proc/fs/stfs/csmdebug file:
$ cat /proc/fs/stfs/csmdebug
TM_LEASE							  OFF
TM_XMIT_RECV				 OFF
MC_OBJECT						  OFF
CACHE_MANAGER				OFF
MC_SESSIONLOCK			OFF
CSM_SESSIONLOCK		OFF
MC_DATALOCK					 OFF
CSM_DATALOCK				 OFF
MC_RANGELOCK				 OFF
CSM_RANGELOCK				OFF
BLKDISK							   OFF
OBJATTR							   OFF
NET_SOCKET					  OFF
MISC									    OFF
To enable debug messages for a particular class in either group:
  1. Open the file that corresponds to the type of class that you are trying to change.
  2. Change "OFF" to "ON" to enable any appropriate classes.
  3. Change "ON" to "OFF" to disable any appropriate classes.
  4. Save and exit the file.
The CSM debug classes also have different verbosity levels of messages. You can control the verbosity level of all messages in the class using /proc/fs/stfs/csmdebuglevel. Here is an example of the initial contents of the //proc/fs/stfs/csmdebuglevel file:
$ cat /proc/fs/stfs/csmdebuglevel
5
To change the verbosity level:
  1. Open the /proc/fs/stfs/csmdebuglevel file.
  2. Edit the file by changing the number to any number between 0 (least verbose) and 5 (most verbose).
  3. Save and exit the file.

The following example messages show the format of log messages:

Apr 21 07:43:50 linuxclient1 unix: STFS: disk configuration process created
   with PID = 13348
Apr 21 07:43:50 linuxclient1 unix: STFS: cleaner process created with PID 12028
Apr 21 07:43:50 linuxclient1 unix: STFS: CSM process created with PID 10860

The following example messages show the format of trace messages:

Apr 28 13:17:09 linuxclient1 unix: STFS: 1051550182.439290  50337 STFS 
   traceBuf_daemonize: going to sleep till shutdown
Apr 28 13:17:09 linuxclient1 unix: STFS: 1051550182.448769 196267 STFS CSM 
   OS-dependent services initialized.
Apr 28 13:17:09 linuxclient1 unix: STFS: 1051550182.448827 196267 STFS Pager 
   Strategy initialized.
Apr 28 13:17:09 linuxclient1 unix: STFS: 1051550182.448875 196267 STFS GFS 
   hooks initialized.
Apr 28 13:17:09 linuxclient1 unix: STFS: 1051550182.448969 196267 STFS 
   doInit(): system Initialized

Parent topic: Client diagnostic tools

Terms of use | Feedback
(C) Copyright IBM Corporation 2003, 2004. All Rights Reserved.