scsi_logging_level - Set and get the SCSI logging level

Red Hat Enterprise Linux 9.2 LPAR mode z/VM guest KVM guest

Use the scsi_logging_level command to create, set, or get the SCSI logging level.

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 scsi_logging_level script helps with both tasks.

scsi_logging_level syntax

Read syntax diagramSkip visual syntax diagramscsi_logging_level -a<level>-E<level>-T<level>-S<level>-M<level>--mlqueue<level>--mlcomplete<level>-L<level>--llqueue<level>--llcomplete<level>-H<level>--hlqueue<level>--hlcomplete<level>-I<level> -s -g -c 
Where:
-a <level> or --all <level>
specifies value for all SCSI_LOG fields.
-E <level> or --error <level>
specifies SCSI_LOG_ERROR.
-T <level> or --timeout <level>
specifies SCSI_LOG_TIMEOUT.
-S <level> or --scan <level>
specifies SCSI_LOG_SCAN.
-M <level> or --midlevel <level>
specifies SCSI_LOG_MLQUEUE and SCSI_LOG_MLCOMPLETE.
--mlqueue  <level>
specifies SCSI_LOG_MLQUEUE.
--mlcomplete  <level>
specifies SCSI_LOG_MLCOMPLETE.
-L <level> or --lowlevel <level>
specifies SCSI_LOG_LLQUEUE and SCSI_LOG_LLCOMPLETE.
--llqueue <level>
specifies SCSI_LOG_LLQUEUE.
--llcomplete <level>
specifies SCSI_LOG_LLCOMPLETE.
-H or --highlevel <level>
specifies SCSI_LOG_HLQUEUE and SCSI_LOG_HLCOMPLETE.
--hlqueue <level>
specifies SCSI_LOG_HLQUEUE.
--hlcomplete <level>
specifies SCSI_LOG_HLCOMPLETE.
-I <level> or --ioctl <level>
specifies SCSI_LOG_IOCTL.
-v or --version
displays version information.
-h or --help
displays help text.
-s or --set
creates and sets the logging level as specified on the command line.
-g or --get
gets the current logging level.
-c or --create
creates the logging level as specified on the command line.

You can specify several SCSI_LOG fields by using several options. When multiple options specify the same SCSI_LOG field, the most specific option has precedence.

Examples

  • This command prints the logging word of the SCSI logging feature and each logging level.
    #> scsi_logging_level -g
    Current 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
  • This command is useful to find issues with LUN discovery and SCSI error handling (recovery), such caused by dirty fibre optics, and has only negligible impact on regular I/O:
    #> scsi_logging_level -s --mlcomplete 1 -T 7 -E 5 -S 7 -I 0 -a 0
    New scsi logging level:
    dev.scsi.logging_level = 4605
    SCSI_LOG_ERROR=5
    SCSI_LOG_TIMEOUT=7
    SCSI_LOG_SCAN=7
    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
  • This command sets all logging levels to 3:
    #> scsi_logging_level -s -a 3
    New scsi logging level:
    dev.scsi.logging_level = 460175067
    SCSI_LOG_ERROR=3
    SCSI_LOG_TIMEOUT=3
    SCSI_LOG_SCAN=3
    SCSI_LOG_MLQUEUE=3
    SCSI_LOG_MLCOMPLETE=3
    SCSI_LOG_LLQUEUE=3
    SCSI_LOG_LLCOMPLETE=3
    SCSI_LOG_HLQUEUE=3
    SCSI_LOG_HLCOMPLETE=3
    SCSI_LOG_IOCTL=3
  • This command sets SCSI_LOG_HLQUEUE=3, SCSI_LOG_HLCOMPLETE=2 and assigns all other SCSI_LOG fields the value 1.
    # scsi_logging_level --hlqueue 3 --highlevel 2 --all 1 -s
    New scsi logging level:
    dev.scsi.logging_level = 174363209
    SCSI_LOG_ERROR=1
    SCSI_LOG_TIMEOUT=1
    SCSI_LOG_SCAN=1
    SCSI_LOG_MLQUEUE=1
    SCSI_LOG_MLCOMPLETE=1
    SCSI_LOG_LLQUEUE=1
    SCSI_LOG_LLCOMPLETE=1
    SCSI_LOG_HLQUEUE=3
    SCSI_LOG_HLCOMPLETE=2
    SCSI_LOG_IOCTL=1