Microsoft KB Archive/296225

= How to Enable SCSIPORT Debug Logging =

Article ID: 296225

Article Last Modified on 9/7/2004

-

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

-



This article was previously published under Q296225



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:  Set the debugger to debug the target computer. Break into the target computer through the debugger connected to the host computer.  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:  Set the debugger to debug the target computer. Break into the target computer through the debugger connected to the host computer.</li>  Edit the Kd_ScsiPort_Mask and Kd_ScsiMiniport_Mask flags so that they look like: <pre class="fixed_text">   kd >ed NT!Kd_ScsiPort_Mask 3 kd >ed NT!Kd_ScsiMiniport_Mask 3 kd >g </li></ol>

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: <pre class="fixed_text">   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.

<div class="references_section">