How to Enable SCSIPORT Debug Logging

Article translations Article translations
Article ID: 296225 - View products that this article applies to.
This article was previously published under Q296225
Expand all | Collapse all

SUMMARY

This article describes how you can enable debug logging for the SCSIPORT and SCSI miniport driver on Microsoft Windows XP, Microsoft Windows 2000 and Microsoft Windows NT.

MORE INFORMATION

To enable debug logs you must have a kernel debugger connected to the target computer and the appropriate symbol files. Also, debug logging only works in a checked or debug build of the operating system. This method will not work on free or retail builds of the operating system.

Windows NT and Windows 2000

On Windows 2000 and Windows NT, you can obtain verbose debug tracing from the SCSIPORT driver by setting the ScsiDebug global variable to 3 with a kernel debugger. For example:
  1. Set the debugger to debug the target computer.
  2. Break into the target computer through the debugger connected to the host computer.
  3. Edit the ScsiDebug flag so that it looks like:
    kd >ed Scsiport!ScsiDebug 3
    kd >g
    					

Windows XP

Debug printing on Windows XP has changed from previous versions. Drivers now use a new function named DbgPrintEx to print debug messages. The DbgPrintEx function either passes the specified string to the kernel debugger or does nothing at all, depending on the values of ComponentID, Level, and the corresponding component filter masks.

The mask for the SCSIPORT driver is Kd_ScsiPort_Mask, and the mask for the SCSI miniport driver is Kd_ScsiMiniport_Mask. To get the logs from SCSIPORT and SCSI miniport, follow these steps:
  1. Set the debugger to debug the target computer.
  2. Break into the target computer through the debugger connected to the host computer.
  3. Edit the Kd_ScsiPort_Mask and Kd_ScsiMiniport_Mask flags so that they look like:
        kd >ed NT!Kd_ScsiPort_Mask 3
        kd >ed NT!Kd_ScsiMiniport_Mask 3
        kd >g
    					
Both the Kd_ScsiPort_Mask and Kd_ScsiMiniPort_Mask are 32-bit Mask variables. The lower 4 bits control the level of debug logging. Setting the appropriate bit enables the required level of debugging.

This table shows the bit, value and description of the four bits:
    Bit    Value  Description
    ------------------------------------------

     0       1    Error Level (Always printed)
     1       2    Warning Level
     2       4    Trace Level
     3       8    Info Level
				
To obtain debug logs from multiple levels, set bit values for all the required levels. For example, to get logs for both the Error and Warning level, set bits 0 & 1 to 1. This results in setting the debug flag to 3.

REFERENCES

For more information about the DbgPrintEx API, refer to the Microsoft Windows XP Device Driver Kit (DDK) documentation.

Properties

Article ID: 296225 - Last Review: September 7, 2004 - Revision: 2.1
APPLIES TO
  • Microsoft Windows 2000 Server
  • Microsoft Windows NT Server 4.0 Standard Edition
  • Microsoft Windows NT Workstation 4.0 Developer Edition
  • Microsoft Windows NT Server 4.0 Enterprise Edition
  • Microsoft Visio 2000 Enterprise Edition
  • Microsoft Windows XP Professional
Keywords: 
kbhowto kbbug kbstoragedev kbdebug KB296225

Give Feedback

 

Contact us for more help

Contact us for more help
Connect with Answer Desk for expert help.
Get more support from smallbusiness.support.microsoft.com