The SCSI logging feature is of interest primarily for software developers who are debugging software problems. It can also be useful for administrators who track down hardware or configuration problems.
The SCSI logging feature is controlled by a 32-bit value - the SCSI logging level. This value is divided into 3-bit fields that describe the log level of a specific log area. Due to the 3-bit subdivision, setting levels or interpreting the meaning of current levels of the SCSI logging feature is not trivial.
The following logging areas are provided with the SCSI logging feature:
www.ibm.com/developerworks/linux/linux390/documentation_dev.html
These examples show how to set the logging level for various problems.
#>scsi_logging_level -s --mlcomplete 1
New scsi logging level:
dev.scsi.logging_level = 4096
SCSI_LOG_ERROR=0
SCSI_LOG_TIMEOUT=0
SCSI_LOG_SCAN=0
SCSI_LOG_MLQUEUE=0
SCSI_LOG_MLCOMPLETE=1
SCSI_LOG_LLQUEUE=0
SCSI_LOG_LLCOMPLETE=0
SCSI_LOG_HLQUEUE=0
SCSI_LOG_HLCOMPLETE=0
SCSI_LOG_IOCTL=0
When you configure a new LUN for zfcp, additional
messages appear (in bold): May 17 12:03:58 t2945012 kernel: Vendor: IBM Model: 2107900 Rev: .203
May 17 12:03:58 t2945012 kernel: Type: Direct-Access ANSI SCSI revision: 05
May 17 12:03:58 t2945012 kernel: sd 0:0:0:0: done SUCCESS 2 sd 0:0:0:0:
May 17 12:03:58 t2945012 kernel: command: Test Unit Ready: 00 00 00 00 00 00
May 17 12:03:58 t2945012 kernel: : Current: sense key: Unit Attention
May 17 12:03:58 t2945012 kernel: Additional sense: Power on, reset, or bus device reset occurred
May 17 12:03:58 t2945012 kernel: SCSI device sda: 10485760 512-byte hdwr sectors (5369 MB)
May 17 12:03:58 t2945012 kernel: sda: Write Protect is off
May 17 12:03:58 t2945012 kernel: SCSI device sda: drive cache: write back
May 17 12:03:58 t2945012 kernel: SCSI device sda: 10485760 512-byte hdwr sectors (5369 MB)
May 17 12:03:58 t2945012 kernel: sda: Write Protect is off
May 17 12:03:58 t2945012 kernel: SCSI device sda: drive cache: write back
May 17 12:03:58 t2945012 kernel: sda: sda1 sda2
May 17 12:03:58 t2945012 kernel: sd 0:0:0:0: Attached scsi disk sda
#>scsi_logging_level -s --mlcomplete 2
New scsi logging level:
dev.scsi.logging_level = 8192
SCSI_LOG_ERROR=0
SCSI_LOG_TIMEOUT=0
SCSI_LOG_SCAN=0
SCSI_LOG_MLQUEUE=0
SCSI_LOG_MLCOMPLETE=2
SCSI_LOG_LLQUEUE=0
SCSI_LOG_LLCOMPLETE=0
SCSI_LOG_HLQUEUE=0
SCSI_LOG_HLCOMPLETE=0
SCSI_LOG_IOCTL=0
When you configure a new LUN for zfcp, additional log messages appear (in bold):
May 17 12:06:01 t2945012 kernel: 1:0:0:0: done SUCCESS 0 1:0:0:0:
May 17 12:06:01 t2945012 kernel: command: Inquiry: 12 00 00 00 24 00
May 17 12:06:01 t2945012 kernel: 1:0:0:0: done SUCCESS 0 1:0:0:0:
May 17 12:06:01 t2945012 kernel: command: Inquiry: 12 00 00 00 a4 00
May 17 12:06:01 t2945012 kernel: Vendor: IBM Model: 2107900 Rev: .203
May 17 12:06:01 t2945012 kernel: Type: Direct-Access ANSI SCSI revision: 05
May 17 12:06:01 t2945012 kernel: sd 1:0:0:0: done SUCCESS 2 sd 1:0:0:0:
May 17 12:06:01 t2945012 kernel: command: Test Unit Ready: 00 00 00 00 00 00
May 17 12:06:01 t2945012 kernel: : Current: sense key: Unit Attention
May 17 12:06:01 t2945012 kernel: Additional sense: Power on, reset, or bus device reset occurred
May 17 12:06:01 t2945012 kernel: sd 1:0:0:0: done SUCCESS 0 sd 1:0:0:0:
May 17 12:06:01 t2945012 kernel: command: Test Unit Ready: 00 00 00 00 00 00
May 17 12:06:01 t2945012 kernel: sd 1:0:0:0: done SUCCESS 0 sd 1:0:0:0:
May 17 12:06:01 t2945012 kernel: command: Read Capacity (10): 25 00 00 00 00 00 00 00 00 00
May 17 12:06:01 t2945012 kernel: SCSI device sdb: 10485760 512-byte hdwr sectors (5369 MB)
May 17 12:06:01 t2945012 kernel: sd 1:0:0:0: done SUCCESS 0 sd 1:0:0:0:
May 17 12:06:01 t2945012 kernel: command: Mode Sense (6): 1a 00 3f 00 04 00
May 17 12:06:01 t2945012 kernel: sdb: Write Protect is off
May 17 12:06:01 t2945012 kernel: sd 1:0:0:0: done SUCCESS 0 sd 1:0:0:0:
May 17 12:06:01 t2945012 kernel: command: Mode Sense (6): 1a 00 08 00 04 00
May 17 12:06:01 t2945012 kernel: sd 1:0:0:0: done SUCCESS 0 sd 1:0:0:0:
May 17 12:06:01 t2945012 kernel: command: Mode Sense (6): 1a 00 08 00 20 00
May 17 12:06:01 t2945012 kernel: SCSI device sdb: drive cache: write back
May 17 12:06:01 t2945012 kernel: sd 1:0:0:0: done SUCCESS 0 sd 1:0:0:0:
May 17 12:06:01 t2945012 kernel: command: Test Unit Ready: 00 00 00 00 00 00
May 17 12:06:01 t2945012 kernel: sd 1:0:0:0: done SUCCESS 0 sd 1:0:0:0:
May 17 12:06:01 t2945012 kernel: command: Read Capacity (10): 25 00 00 00 00 00 00 00 00 00
May 17 12:06:01 t2945012 kernel: SCSI device sdb: 10485760 512-byte hdwr sectors (5369 MB)
May 17 12:06:01 t2945012 kernel: sd 1:0:0:0: done SUCCESS 0 sd 1:0:0:0:
May 17 12:06:01 t2945012 kernel: command: Mode Sense (6): 1a 00 3f 00 04 00
May 17 12:06:01 t2945012 kernel: sdb: Write Protect is off
May 17 12:06:01 t2945012 kernel: sd 1:0:0:0: done SUCCESS 0 sd 1:0:0:0:
May 17 12:06:01 t2945012 kernel: command: Mode Sense (6): 1a 00 08 00 04 00
May 17 12:06:01 t2945012 kernel: sd 1:0:0:0: done SUCCESS 0 sd 1:0:0:0:
May 17 12:06:01 t2945012 kernel: command: Mode Sense (6): 1a 00 08 00 20 00
May 17 12:06:01 t2945012 kernel: SCSI device sdb: drive cache: write back
May 17 12:06:01 t2945012 kernel: sd 1:0:0:0: done SUCCESS 0 sd 1:0:0:0:
May 17 12:06:01 t2945012 kernel: command: Read (10): 28 00 00 00 00 00 00 00 08 00
May 17 12:06:01 t2945012 kernel: sdb:sdb1 sdb2
May 17 12:06:01 t2945012 kernel: sd 1:0:0:0: Attached scsi disk sdb
...
#>scsi_logging_level -s --mlqueue 2
New scsi logging level:
dev.scsi.logging_level = 1024
SCSI_LOG_ERROR=0
SCSI_LOG_TIMEOUT=0
SCSI_LOG_SCAN=0
SCSI_LOG_MLQUEUE=2
SCSI_LOG_MLCOMPLETE=0
SCSI_LOG_LLQUEUE=0
SCSI_LOG_LLCOMPLETE=0
SCSI_LOG_HLQUEUE=0
SCSI_LOG_HLCOMPLETE=0
SCSI_LOG_IOCTL=0
The output shows Test Unit Ready commands
that are issued by the path checker of multipathd (from
multipath-tools): May 17 12:07:36 t2945012 kernel: sd 0:0:0:0: send sd 0:0:0:0:
May 17 12:07:36 t2945012 kernel: command: Test Unit Ready: 00 00 00 00 00 00
May 17 12:07:37 t2945012 kernel: sd 1:0:0:0: send sd 1:0:0:0:
May 17 12:07:37 t2945012 kernel: command: Test Unit Ready: 00 00 00 00 00 00
#>scsi_logging_level -s --mlqueue 2 --mlcomplete 2
New scsi logging level:
dev.scsi.logging_level = 9216
SCSI_LOG_ERROR=0
SCSI_LOG_TIMEOUT=0
SCSI_LOG_SCAN=0
SCSI_LOG_MLQUEUE=2
SCSI_LOG_MLCOMPLETE=2
SCSI_LOG_LLQUEUE=0
SCSI_LOG_LLCOMPLETE=0
SCSI_LOG_HLQUEUE=0
SCSI_LOG_HLCOMPLETE=0
SCSI_LOG_IOCTL=0
The output shows Test Unit Ready commands
that are issued by the path checker of multipathd (from
multipath-tools). In contrast to the previous example with additional
messages (in bold): May 17 12:07:56 t2945012 kernel: sd 0:0:0:0: send sd 0:0:0:0:
May 17 12:07:56 t2945012 kernel: command: Test Unit Ready: 00 00 00 00 00 00
May 17 12:07:56 t2945012 kernel: sd 0:0:0:0: done SUCCESS 0 sd 0:0:0:0:
May 17 12:07:56 t2945012 kernel: command: Test Unit Ready: 00 00 00 00 00 00
May 17 12:07:57 t2945012 kernel: sd 1:0:0:0: send sd 1:0:0:0:
May 17 12:07:57 t2945012 kernel: command: Test Unit Ready: 00 00 00 00 00 00
May 17 12:07:57 t2945012 kernel: sd 1:0:0:0: done SUCCESS 0 sd 1:0:0:0:
May 17 12:07:57 t2945012 kernel: command: Test Unit Ready: 00 00 00 00 00 00
#>scsi_logging_level -s --mlqueue 2 --mlcomplete 2 --ioctl 2
New scsi logging level:
dev.scsi.logging_level = 268444672
SCSI_LOG_ERROR=0
SCSI_LOG_TIMEOUT=0
SCSI_LOG_SCAN=0
SCSI_LOG_MLQUEUE=2
SCSI_LOG_MLCOMPLETE=2
SCSI_LOG_LLQUEUE=0
SCSI_LOG_LLCOMPLETE=0
SCSI_LOG_HLQUEUE=0
SCSI_LOG_HLCOMPLETE=0
SCSI_LOG_IOCTL=2
The output shows Test Unit Ready commands
that are issued by the path checker of multipathd (from
multipath-tools). In contrast to the previous example, this one has additional
messages (in bold): May 17 12:08:17 t2945012 kernel: sd_ioctl: disk=sda, cmd=0x2285
May 17 12:08:17 t2945012 kernel: sd 0:0:0:0: send sd 0:0:0:0:
May 17 12:08:17 t2945012 kernel: command: Test Unit Ready: 00 00 00 00 00 00
May 17 12:08:17 t2945012 kernel: sd 0:0:0:0: done SUCCESS 0 sd 0:0:0:0:
May 17 12:08:17 t2945012 kernel: command: Test Unit Ready: 00 00 00 00 00 00
May 17 12:08:18 t2945012 kernel: sd_ioctl: disk=sdb, cmd=0x2285
May 17 12:08:18 t2945012 kernel: sd 1:0:0:0: send sd 1:0:0:0:
May 17 12:08:18 t2945012 kernel: command: Test Unit Ready: 00 00 00 00 00 00
May 17 12:08:18 t2945012 kernel: sd 1:0:0:0: done SUCCESS 0 sd 1:0:0:0:
May 17 12:08:18 t2945012 kernel: command: Test Unit Ready: 00 00 00 00 00 00
#>scsi_logging_level -s -a 0
New scsi logging level:
dev.scsi.logging_level = 0
SCSI_LOG_ERROR=0
SCSI_LOG_TIMEOUT=0
SCSI_LOG_SCAN=0
SCSI_LOG_MLQUEUE=0
SCSI_LOG_MLCOMPLETE=0
SCSI_LOG_LLQUEUE=0
SCSI_LOG_LLCOMPLETE=0
SCSI_LOG_HLQUEUE=0
SCSI_LOG_HLCOMPLETE=0
SCSI_LOG_IOCTL=0