Chinaunix首页 | 论坛 | 博客
  • 博客访问: 186232
  • 博文数量: 51
  • 博客积分: 689
  • 博客等级: 上士
  • 技术积分: 525
  • 用 户 组: 普通用户
  • 注册时间: 2010-03-03 13:05
文章分类

全部博文(51)

文章存档

2014年(1)

2013年(2)

2012年(7)

2011年(11)

2010年(30)

分类: LINUX

2013-08-29 17:50:48

Scsi Debug Logging level:


 


Many levels exist, a good starting point:


To enable:


Syntax


#> echo 0x9411 > /proc/sys/dev/scsi/logging_level


 


Depending on kernel version, may be at: (Note the word parameters)


Syntax


#> echo 0x9411 > /sys/module/scsi_mod/parameters/scsi_logging_level


 


To disable:


echo 0 > /sys/module/scsi_mod/parameters/scsi_logging_level


or


echo 0 > /proc/sys/dev/scsi/logging_level


 


The above Logging level will fill up /var/log/messages at a rapid pace.  Make sure you know what you are looking for and try to keep the debug level down to 4 – 6 hours.  If you need longer, you may wish to modify the logging level or purchase more storage J


 


Details on logging levels:


See the scsi_logging.h header file  NOTE SHIFT and BITS


#define SCSI_LOG_ERROR_SHIFT              0


#define SCSI_LOG_TIMEOUT_SHIFT            3


#define SCSI_LOG_SCAN_SHIFT               6


#define SCSI_LOG_MLQUEUE_SHIFT            9


#define SCSI_LOG_MLCOMPLETE_SHIFT         12


#define SCSI_LOG_LLQUEUE_SHIFT            15


#define SCSI_LOG_LLCOMPLETE_SHIFT         18


#define SCSI_LOG_HLQUEUE_SHIFT            21


#define SCSI_LOG_HLCOMPLETE_SHIFT         24


#define SCSI_LOG_IOCTL_SHIFT              27


 


#define SCSI_LOG_ERROR_BITS               3


#define SCSI_LOG_TIMEOUT_BITS             3


#define SCSI_LOG_SCAN_BITS                3


#define SCSI_LOG_MLQUEUE_BITS             3


#define SCSI_LOG_MLCOMPLETE_BITS          3


#define SCSI_LOG_LLQUEUE_BITS             3


#define SCSI_LOG_LLCOMPLETE_BITS          3


#define SCSI_LOG_HLQUEUE_BITS             3


#define SCSI_LOG_HLCOMPLETE_BITS          3


#define SCSI_LOG_IOCTL_BITS               3


 


Think of the above “Shifts” as categories, and the “BITS” as value for those categories. 

In the example below, the order is always MSB --> LSB

 

 

MSB

 

 

 

 

 

 

 

LSB

Example level for each category

4

0  

0  

0  

0  

0  

0  

0

5

7

category

Ict

HLC

HLQ

LLC

LLQ

MLC

MLQ

SCN

TME

ERR

Bit Mask

100

000

000

000

000

000

000

000

101

111

                     

Hex bit map

 

 

10

0000

0000

0000

0000

0000

0010

1111

Hex conversion

 

 

2

0

0

0

0

0

2

F

 

 

The above table shows you how to use Excel (bin2hex) to quickly find the HEX conversion value to use in order to enable the logging level you desire.

 

As demonstrated in the above table:

 

ERROR = 7

Timeout = 5

IOCTL = 4

 

The hex value would be

Answer: 0x2000002f


There is a useful tool / scripts
 scsi_logging_level inlcuded in sg3_utils, which makes the change much easier.

eg:

scsi_logging_level -g
Current scsi logging level:
/proc/sys/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

scsi_logging_level -E 3 -s
New scsi logging level:
/proc/sys/dev/scsi/logging_level = 3
SCSI_LOG_ERROR=3
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

Biger value give you more verbose



阅读(2208) | 评论(0) | 转发(0) |
0

上一篇:qemu ftrace howto

下一篇:md bitmap 代码分析

给主人留下些什么吧!~~