Skip to contentSkip to conversation

SCSI logging sucks

DISCUSSION Chuck Ebbert 4 participants 5 messages Feb 7, 2007 – Feb 9, 2007

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

SCSI logging isn't documented very well, and what little there is has a problem:

In Documentation/kernel-parameters.txt we have:

scsi_logging= [SCSI]

but it's really "scsi_logging_level", as seen here in drivers/scsi/scsi.c:

module_param(scsi_logging_level, int, S_IRUGO|S_IWUSR); MODULE_PARM_DESC(scsi_logging_level, "a bit mask of logging levels");

Not exactly helpful. And the sysctl is called:

/proc/sys/dev/scsi/logging_level

Using scsi_logging.h, I came up with this:

                0000 0000 0000 0000 0000 0000 0000 0000
       0x7                                          111  Error
      0x38                                      11 1     Timeout
     0x1c0                                  1 11         Scan
     0xe00                               111             Midlevel queue
    0x7000                           111                 Midlevel

completions
0x38000 11 1 Lowlevel queue
0x1c0000 1 11 Lowlevel
completions
0xe00000 111 Highlevel queue
0x7000000 111 Highlevel
completions
0x38000000 11 1 IOCTL

but I'm not sure if it's right.

And the actual implementation looks backwards, at least for highlevel events. You need to set the level to 800000 to see driver loads and that means wading through tons of extraneous crap. The logging should show more verbosity at the higher numbers, not start out with the most verbose output at the low numbers.

#1 lore raw
Quoted 11 lines · On Wed, 07 Feb 2007 12:06:30 -0500 Chuck Ebbert wrote:

SCSI logging isn't documented very well, and what little there is has a problem:

In Documentation/kernel-parameters.txt we have:

scsi_logging= [SCSI]

but it's really "scsi_logging_level", as seen here in drivers/scsi/scsi.c:

module_param(scsi_logging_level, int, S_IRUGO|S_IWUSR); MODULE_PARM_DESC(scsi_logging_level, "a bit mask of logging levels");

Patch for Documentation/kernel-parameters.txt is below. Want more/different?

Is this part of drivers/scsi/Kconfig correct??

"""
config SCSI_LOGGING
bool "SCSI logging facility"
depends on SCSI
---help---
This turns on a logging facility that can be used to debug a number of SCSI related problems.

If you say Y here, no logging output will appear by default, but you can enable logging by saying Y to "/proc file system support" and "Sysctl support" below and executing the command

echo "scsi log token [level]" > /proc/scsi/scsi

at boot time after the /proc file system has been mounted.

There are a number of things that can be used for 'token' (you can find them in the source: <file:drivers/scsi/scsi.c>), and this allows you to select the types of information you want, and the level allows you to select the level of verbosity.
"""

Quoted 21 lines

Not exactly helpful. And the sysctl is called:

/proc/sys/dev/scsi/logging_level

Using scsi_logging.h, I came up with this:

                0000 0000 0000 0000 0000 0000 0000 0000
       0x7                                          111  Error
      0x38                                      11 1     Timeout
     0x1c0                                  1 11         Scan
     0xe00                               111             Midlevel queue
    0x7000                           111                 Midlevel

completions
0x38000 11 1 Lowlevel queue
0x1c0000 1 11 Lowlevel
completions
0xe00000 111 Highlevel queue
0x7000000 111 Highlevel
completions
0x38000000 11 1 IOCTL

Quoted 7 lines

but I'm not sure if it's right.

And the actual implementation looks backwards, at least for highlevel events. You need to set the level to 800000 to see driver loads and that means wading through tons of extraneous crap. The logging should show more verbosity at the higher numbers, not start out with the most verbose output at the low numbers.

From: Randy Dunlap <[email protected]>

Minor corrections and additions to 'scsi_logging_level', as pointed out by Chuck Ebbert.

---
 Documentation/kernel-parameters.txt |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
Documentation/kernel-parameters.txt +4 -1
@@ -1444,7 +1444,10 @@ and is between 256 and 4096 characters. 
 			Format: <vendor>:<model>:<flags>
 			(flags are integer value)
 
-	scsi_logging=	[SCSI]
+	scsi_logging_level=	[SCSI] a bit mask of logging levels
+			See drivers/scsi/scsi_logging.h for bits.  Also
+			settable via sysctl at dev.scsi.logging_level
+			(/proc/sys/dev/scsi/logging_level).
 
 	scsi_mod.scan=	[SCSI] sync (default) scans SCSI busses as they are
 			discovered.  async scans them in kernel threads,
#2 lore raw
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Randy" == Randy Dunlap <[email protected]> writes:

Randy> There are a number of things that can be used for 'token' (you Randy> can find them in the source: <file:drivers/scsi/scsi.c>), and Randy> this allows you to select the types of information you want, Randy> and the level allows you to select the level of verbosity. """

There's a very convenient script called scsi_logging_level included in (of all things) the s390-tools package.

Maybe provide a pointer to it -- or even just include it. It's not very big...

http://www-128.ibm.com/developerworks/linux/linux390/s390-tools-1.5.4.html

Signature · 1 line
Martin K. Petersen	Oracle Linux Engineering
#3 lore raw
Quoted 7 lines

There's a very convenient script called scsi_logging_level included in (of all things) the s390-tools package.

Maybe provide a pointer to it -- or even just include it. It's not very big...

http://www-128.ibm.com/developerworks/linux/linux390/s390-tools-1.5.4.html

The scsi_logging_level script is described here in chapter 8:
http://download.boulder.ibm.com/ibmdl/pub/software/dw/linux390/docu/l26cts01.pdf

and here on page 312:
http://download.boulder.ibm.com/ibmdl/pub/software/dw/linux390/docu/l26cdd02.pdf

regards,
Volker

#4 lore raw
In reply to Randy Dunlap
Quoted 20 lines · Randy Dunlap

Patch for Documentation/kernel-parameters.txt is below. Want more/different?

Is this part of drivers/scsi/Kconfig correct??

"""
config SCSI_LOGGING
bool "SCSI logging facility"
depends on SCSI
---help---
This turns on a logging facility that can be used to debug a number of SCSI related problems.

If you say Y here, no logging output will appear by default, but you can enable logging by saying Y to "/proc file system support" and "Sysctl support" below and executing the command

echo "scsi log token [level]" > /proc/scsi/scsi

Quoted 9 lines

at boot time after the /proc file system has been mounted.

There are a number of things that can be used for 'token' (you can find them in the source: <file:drivers/scsi/scsi.c>), and this allows you to select the types of information you want, and the level allows you to select the level of verbosity.
"""

I have no clue whether that works, but looking at scsi.c it would seem it doesn't. I only see add-single-device and remove-single-device in there.

Quoted 15 lines

From: Randy Dunlap <[email protected]>

Minor corrections and additions to 'scsi_logging_level', as pointed out by Chuck Ebbert.

---
 Documentation/kernel-parameters.txt |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
Documentation/kernel-parameters.txt +0 -0
@@ -1444,7 +1444,10 @@ and is between 256 and 4096 characters. 
 			Format: <vendor>:<model>:<flags>

Documentation/kernel-parameters.txt and is between 256 and 4096 characters. · line 1453

Quoted 10 lines
Documentation/kernel-parameters.txt +4 -1
 			(flags are integer value)
 
-	scsi_logging=	[SCSI]
+	scsi_logging_level=	[SCSI] a bit mask of logging levels
+			See drivers/scsi/scsi_logging.h for bits.  Also
+			settable via sysctl at dev.scsi.logging_level
+			(/proc/sys/dev/scsi/logging_level).
 
 	scsi_mod.scan=	[SCSI] sync (default) scans SCSI busses as they are
 			discovered.  async scans them in kernel threads,

Patch looks good. The script from IBM looks even better.