ReactOS 0.4.16-dev-112-g52265ae
debug.h
Go to the documentation of this file.
1/*++
2
3Copyright (C) Microsoft Corporation, 1991 - 1999
4
5Module Name:
6
7 debug.h
8
9Abstract:
10
11
12Author:
13
14Environment:
15
16 kernel mode only
17
18Notes:
19
20
21Revision History:
22
23--*/
24
25#define DBGGETIOCTLSTR(_ioctl) DbgGetIoctlStr(_ioctl)
26#define DBGGETSCSIOPSTR(_pSrb) DbgGetScsiOpStr(_pSrb)
27#define DBGGETSRBSTATUSSTR(_pSrb) DbgGetSrbStatusStr(_pSrb)
28#define DBGGETSENSECODESTR(_pSrb) DbgGetSenseCodeStr(_pSrb)
29#define DBGGETADSENSECODESTR(_pSrb) DbgGetAdditionalSenseCodeStr(_pSrb)
30#define DBGGETADSENSEQUALIFIERSTR(_pSrb) DbgGetAdditionalSenseCodeQualifierStr(_pSrb)
31
38
39#if DBG
40
41 typedef struct _CLASSPNP_GLOBALS {
42
43 //
44 // whether or not to NT_ASSERT for lost irps
45 //
46
47 ULONG BreakOnLostIrps;
48 ULONG SecondsToWaitForIrps;
49
50 //
51 // use a buffered debug print to help
52 // catch timing issues that do not
53 // reproduce with std debugprints enabled
54 //
55
56 ULONG UseBufferedDebugPrint;
57 ULONG UseDelayedRetry;
58
59 //
60 // the next four are the buffered printing support
61 // (currently unimplemented) and require the spinlock
62 // to use
63 //
64
65 ULONG Index; // index into buffer
67 PUCHAR Buffer; // requires spinlock to access
68 ULONG NumberOfBuffers; // number of buffers available
69 SIZE_T EachBufferSize; // size of each buffer
70
71 //
72 // interlocked variables to initialize
73 // this data only once
74 //
75
76 LONG Initializing;
78
79 } CLASSPNP_GLOBALS, *PCLASSPNP_GLOBALS;
80
81
82 //
83 // Define a structure used to capture stack traces when we
84 // get an access request and the disks are powered off. This
85 // will help us determine who's causing disk respins.
86 //
87
88 //
89 // How many stack frames to capture each time?
90 //
91 #define DISK_SPINUP_BACKTRACE_LENGTH (0x18)
92
93 //
94 // How many stack traces can we capture before
95 // out buffer wraps? (needs to be power of 2)
96 //
97 #define NUMBER_OF_DISK_SPINUP_TRACES (0x10)
98
99 typedef struct _DISK_SPINUP_TRACES {
100
101 LARGE_INTEGER TimeStamp; // timestamp of the spinup event.
102 PVOID StackTrace[DISK_SPINUP_BACKTRACE_LENGTH]; // Holds stack trace
103 } DISK_SPINUP_TRACES, *PDISK_SPINUP_TRACES;
104
105
106 #define DBGCHECKRETURNEDPKT(_pkt) DbgCheckReturnedPkt(_pkt)
107 #define DBGLOGSENDPACKET(_pkt) DbgLogSendPacket(_pkt)
108 #define DBGLOGRETURNPACKET(_pkt) DbgLogReturnPacket(_pkt)
109 #define DBGLOGFLUSHINFO(_fdoData, _isIO, _isFUA, _isFlush) DbgLogFlushInfo(_fdoData, _isIO, _isFUA, _isFlush)
110
112 VOID DbgCheckReturnedPkt(TRANSFER_PACKET *Pkt);
113 VOID DbgLogSendPacket(TRANSFER_PACKET *Pkt);
114 VOID DbgLogReturnPacket(TRANSFER_PACKET *Pkt);
115 VOID DbgLogFlushInfo(PCLASS_PRIVATE_FDO_DATA FdoData, BOOLEAN IsIO, BOOLEAN IsFUA, BOOLEAN IsFlush);
117 extern CLASSPNP_GLOBALS ClasspnpGlobals;
118 extern LONG ClassDebug;
119 extern BOOLEAN DebugTrapOnWarn;
120
121#else
122
123 #define ClasspInitializeDebugGlobals()
124 #define SnapDiskStartup()
125
126 #define DBGCHECKRETURNEDPKT(_pkt)
127 #define DBGLOGSENDPACKET(_pkt)
128 #define DBGLOGRETURNPACKET(_pkt)
129 #define DBGLOGFLUSHINFO(_fdoData, _isIO, _isFUA, _isFlush)
130
131#endif
132
unsigned char BOOLEAN
_In_ PSCSI_REQUEST_BLOCK Srb
Definition: cdrom.h:989
Definition: bufpool.h:45
_In_ PTRANSFER_PACKET Pkt
Definition: classp.h:1754
char * DbgGetScsiOpStr(PSTORAGE_REQUEST_BLOCK_HEADER Srb)
Definition: debug.c:609
char * DbgGetAdditionalSenseCodeStr(PSTORAGE_REQUEST_BLOCK_HEADER Srb)
Definition: debug.c:826
char * DbgGetSenseCodeStr(PSTORAGE_REQUEST_BLOCK_HEADER Srb)
Definition: debug.c:777
#define ClasspInitializeDebugGlobals()
Definition: debug.h:123
char * DbgGetAdditionalSenseCodeQualifierStr(PSTORAGE_REQUEST_BLOCK_HEADER Srb)
Definition: debug.c:882
char * DbgGetIoctlStr(ULONG ioctl)
Definition: debug.c:571
#define SnapDiskStartup()
Definition: debug.h:124
char * DbgGetSrbStatusStr(PSTORAGE_REQUEST_BLOCK_HEADER Srb)
Definition: debug.c:722
ULONG KSPIN_LOCK
Definition: env_spec_w32.h:72
@ Initialized
Definition: ketypes.h:388
long LONG
Definition: pedump.c:60
SECURITY_INTEGER TimeStamp
Definition: sspi.h:78
struct SRB_ALIGN _STORAGE_REQUEST_BLOCK_HEADER * PSTORAGE_REQUEST_BLOCK_HEADER
ULONG_PTR SIZE_T
Definition: typedefs.h:80
unsigned char * PUCHAR
Definition: typedefs.h:53
uint32_t ULONG
Definition: typedefs.h:59
_In_ WDFCOLLECTION _In_ ULONG Index
_Must_inspect_result_ _In_opt_ PWDF_OBJECT_ATTRIBUTES _Out_ WDFSPINLOCK * SpinLock
Definition: wdfsync.h:228
#define ioctl
Definition: wintirpc.h:60