Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

271 lines
13 KiB

  1. /****************************************************************************/
  2. // nprcount.h
  3. //
  4. // Constants/defines for profiling counters used by Terminal Server code.
  5. //
  6. // Copyright (C) 1998-2000 Microsoft Corporation
  7. /****************************************************************************/
  8. #ifndef _H_NPRCOUNT
  9. #define _H_NPRCOUNT
  10. /****************************************************************************/
  11. /* The Terminal Server TermDD stack maintains a WINSTATIONINFORMATION */
  12. /* record per Winstation. One of the fields in this record is a pointer to */
  13. /* a PROTOCOLSTATUS record. Contained within the protocolstatus record are */
  14. /* statistics fields that the stack can fill in to hold "interesting" */
  15. /* numbers (e.g. the number of LineTo orders sent in total). Some of the */
  16. /* numbers are maintained by the ICADD common code, but some are protocol */
  17. /* specific and hence up for grabs by the TShare stack. */
  18. /* */
  19. /* The available counters are split up as follows */
  20. /* - 10 cache statistics (each contains two numbers: #of reads, #of hits) */
  21. /* - 100 output counters */
  22. /* - 100 input counters */
  23. /****************************************************************************/
  24. // We don't need to be doing the work of incrementing counters when
  25. // we are not actively looking at the data. Define DC_COUNTERS to enable
  26. // the counters for analysis.
  27. #ifdef DC_COUNTERS
  28. #ifdef DLL_DISP
  29. #define INC_INCOUNTER(x) pddProtStats->Input.Specific.Reserved[x]++
  30. #define ADD_INCOUNTER(x, y) pddProtStats->Input.Specific.Reserved[x] += y
  31. #define INC_OUTCOUNTER(x) pddProtStats->Output.Specific.Reserved[x]++
  32. #define DEC_OUTCOUNTER(x) pddProtStats->Output.Specific.Reserved[x]--
  33. #define ADD_OUTCOUNTER(x, y) pddProtStats->Output.Specific.Reserved[x] += y
  34. #else
  35. #define INC_INCOUNTER(x) m_pTSWd->pProtocolStatus->Input.Specific.Reserved[x]++
  36. #define ADD_INCOUNTER(x, y) m_pTSWd->pProtocolStatus->Input.Specific.Reserved[x] += y
  37. #define SUB_INCOUNTER(x, y) m_pTSWd->pProtocolStatus->Input.Specific.Reserved[x] -= y
  38. #define SET_INCOUNTER(x, y) m_pTSWd->pProtocolStatus->Input.Specific.Reserved[x] = y
  39. #define INC_OUTCOUNTER(x) m_pTSWd->pProtocolStatus->Output.Specific.Reserved[x]++
  40. #endif
  41. #else // DC_COUNTERS
  42. #define INC_INCOUNTER(x)
  43. #define ADD_INCOUNTER(x, y)
  44. #define SET_INCOUNTER(x, y)
  45. #define SUB_INCOUNTER(x, y)
  46. #define INC_OUTCOUNTER(x)
  47. #define DEC_OUTCOUNTER(x)
  48. #define ADD_OUTCOUNTER(x, y)
  49. #endif // DC_COUNTERS
  50. /****************************************************************************/
  51. /* Index values for performance statistics counters */
  52. /****************************************************************************/
  53. #define BITMAP 0
  54. #define GLYPH 1
  55. #define BRUSH 2
  56. #define SSI 3
  57. #define FREE_4 4
  58. #define FREE_5 5
  59. #define FREE_6 6
  60. #define FREE_7 7
  61. #define FREE_8 8
  62. #define FREE_9 9
  63. // OUTPUT COUNTERS
  64. #define OUT_BITBLT_ALL 0 // No. of calls to DrvBitBlt
  65. #define OUT_BITBLT_SDA 1 // sent as SDA
  66. #define OUT_BITBLT_NOOFFSCR 2 // DrvBitBlt calls failed due to no-offscr flag
  67. #define OUT_BITBLT_SDA_ROP4 3 // SDA: ROP4
  68. #define OUT_BITBLT_SDA_UNSUPPORTED 4 // SDA: order unsupported
  69. #define OUT_BITBLT_SDA_NOROP3 5 // SDA: unsupported ROP3
  70. #define OUT_BITBLT_SDA_COMPLEXCLIP 6 // SDA: complex clipping
  71. #define OUT_BITBLT_SDA_MBUNCACHEABLE 7 // SDA: uncacheable memblt
  72. #define OUT_BITBLT_SDA_NOCOLORTABLE 8 // SDA: color table not queued
  73. #define OUT_BITBLT_SDA_HEAPALLOCFAILED 9 // SDA: failed to alloc heap order
  74. #define OUT_BITBLT_SDA_SBCOMPLEXCLIP 10 // SDA: ScrBlt complex clip
  75. #define OUT_BITBLT_SDA_M3BCOMPLEXBRUSH 11 // SDA: Mem3Blt with complex brush
  76. #define OUT_BITBLT_SDA_WINDOWSAYERING 12 // SDA: Windows layering bitmap
  77. #define OUT_OFFSCREEN_BITMAP_ALL 13 // No. of calls to DrvCreateDeviceBitmap
  78. #define OUT_OFFSCREEN_BITMAP_ORDER 14 // Number of Create Offscreen Bitmap orders sent.
  79. #define OUT_OFFSCREEN_BITMAP_ORDER_BYTES 15 // Total size of Create Offscreen Bitmap orders.
  80. #define OUT_SWITCHSURFACE 16 // Number of switch surface orders sent.
  81. #define OUT_SWITCHSURFACE_BYTES 17 // Bytes of Switch Surface orders.
  82. #define OUT_STRTCHBLT_ALL 18 // No. of calls to DrvStretchBlt
  83. #define OUT_STRTCHBLT_SDA 19 // sent as SDA
  84. #define OUT_STRTCHBLT_BITBLT 20 // passed to DrvBitBlt
  85. #define OUT_STRTCHBLT_SDA_MASK 21 // SDA: mask specified
  86. #define OUT_STRTCHBLT_SDA_COMPLEXCLIP 22 // SDA: complex clipping
  87. #define OUT_COPYBITS_ALL 23 // No. of calls to DrvCopyBits
  88. #define OUT_TEXTOUT_ALL 24 // No. of calls to DrvTextOut
  89. #define OUT_TEXTOUT_SDA 25 // sent as SDA
  90. #define OUT_TEXTOUT_SDA_EXTRARECTS 26 // SDA: extra rects
  91. #define OUT_TEXTOUT_SDA_NOSTRING 27 // SDA: no string
  92. #define OUT_TEXTOUT_SDA_COMPLEXCLIP 28 // SDA: complex clipping
  93. #define OUT_TEXTOUT_SDA_NOFCI 29 // SDA: Failed alloc fontcacheinfo
  94. #define OUT_TEXTOUT_GLYPH_INDEX 30 // Num Index orders
  95. #define OUT_TEXTOUT_FAST_GLYPH 31 // Num FastGlyph orders
  96. #define OUT_TEXTOUT_FAST_INDEX 32 // Num FastIndex orders
  97. #define OUT_CACHEGLYPH 33 // Num Cache Glyph secondary orders
  98. #define OUT_CACHEGLYPH_BYTES 34 // Bytes of Cache Glyph
  99. #define OUT_CACHEBITMAP 35 // Number of Cache Bitmap secondary orders
  100. #define OUT_CACHEBITMAP_FAILALLOC 36 // Number of failures during heap alloc
  101. #define OUT_CACHEBITMAP_BYTES 37 // Bytes of CacheBitmap
  102. #define OUT_CACHECOLORTABLE 38 // Number of Cache Color Table secondary orders
  103. #define OUT_CACHECOLORTABLE_BYTES 39 // CacheColorTable bytes
  104. #define OUT_LINETO_ALL 40 // No. of calls to DrvLineTo
  105. #define OUT_LINETO_ORDR 41 // sent as orders
  106. #define OUT_LINETO_SDA 42 // sent as SDA
  107. #define OUT_LINETO_SDA_UNSUPPORTED 43 // SDA: order unsupported
  108. #define OUT_LINETO_SDA_BADBRUSH 44 // SDA: unsupported brush
  109. #define OUT_LINETO_SDA_COMPLEXCLIP 45 // SDA: complex clipping
  110. #define OUT_LINETO_SDA_FAILEDADD 46 // SDA: failed to add order
  111. #define OUT_STROKEPATH_ALL 47 // No. of calls to DrvStrokePath
  112. #define OUT_STROKEPATH_SDA 48 // sent as SDA
  113. #define OUT_STROKEPATH_UNSENT 49 // not sent
  114. #define OUT_STROKEPATH_SDA_NOLINETO 50 // SDA: LineTo unsupported
  115. #define OUT_STROKEPATH_SDA_BADBRUSH 51 // SDA: unsupported brush
  116. #define OUT_STROKEPATH_SDA_COMPLEXCLIP 52 // SDA: complex clipping
  117. #define OUT_STROKEPATH_SDA_FAILEDADD 53 // SDA: failed to add line
  118. #define OUT_STROKEPATH_POLYLINE 54 // PolyLine orders sent
  119. #define OUT_STROKEPATH_ELLIPSE_SC 55 // Hollow ellipses sent.
  120. #define OUT_FILLPATH_ALL 56 // No. of calls to DrvFillPath
  121. #define OUT_FILLPATH_SDA 57 // sent as SDA
  122. #define OUT_FILLPATH_UNSENT 58 // not sent
  123. #define OUT_FILLPATH_SDA_NOPOLYGON 59 // SDA: polygon unsupported
  124. #define OUT_FILLPATH_SDA_BADBRUSH 60 // SDA: unsupported brush
  125. #define OUT_FILLPATH_SDA_COMPLEXCLIP 61 // SDA: complex clipping
  126. #define OUT_FILLPATH_SDA_FAILEDADD 62 // SDA: failed to add polygon
  127. #define OUT_FILLPATH_ELLIPSE_SC 63 // Ellipse solid color
  128. #define OUT_FILLPATH_ELLIPSE_CB 64 // Ellipse color brush
  129. #define OUT_FILLPATH_POLYGON_SC 65 // Polygon solid solid color
  130. #define OUT_FILLPATH_POLYGON_CB 66 // Polygon color brush
  131. #define OUT_DSTBLT_ORDER 67 // DstBlt orders
  132. #define OUT_MULTI_DSTBLT_ORDER 68 // MultiDstBlt orders
  133. #define OUT_PATBLT_ORDER 69 // PatBlt orders
  134. #define OUT_MULTI_PATBLT_ORDER 70 // MultiPatBlt orders
  135. #define OUT_OPAQUERECT_ORDER 71 // OpaqueRect orders
  136. #define OUT_MULTI_OPAQUERECT_ORDER 72 // MultiOpaqueRect orders
  137. #define OUT_SCRBLT_ORDER 73 // ScrBlt orders
  138. #define OUT_MULTI_SCRBLT_ORDER 74 // MultiScrBlt orders
  139. #define OUT_MEMBLT_ORDER 75 // MemBlt orders
  140. #define OUT_MEM3BLT_ORDER 76 // Mem3Blt orders
  141. #define OUT_PAINT_ALL 77 // No. of calls to DrvPaint
  142. #define OUT_PAINT_SDA 78 // sent as SDA
  143. #define OUT_PAINT_UNSENT 79 // not sent
  144. #define OUT_PAINT_SDA_COMPLEXCLIP 80 // SDA: complex clipping
  145. #define OUT_BRUSH_ALL 81 // No. of calls to DrvRealizeBrush
  146. #define OUT_BRUSH_STORED 82 // brush gets stored
  147. #define OUT_BRUSH_MONO 83 // brush was mono, not standard
  148. #define OUT_BRUSH_STANDARD 84 // standard brush
  149. #define OUT_BRUSH_REJECTED 85 // cannot be sent over the wire
  150. #define OUT_CACHEBRUSH 86 // CacheBrushPDUs sent.
  151. #define OUT_CACHEBRUSH_BYTES 87 // Bytes of CacheBrushPDU
  152. //free: 88-89
  153. #define OUT_SAVESCREEN_ALL 90 // No. of calls to DrvSaveScreenBits
  154. #define OUT_SAVEBITMAP_ORDERS 91 // sent as orders
  155. #define OUT_SAVESCREEN_UNSUPP 92 // not handled cos order not supported
  156. #define OUT_CHECKBRUSH_NOREALIZATION 93 // CheckBrush failed - not realized
  157. #define OUT_CHECKBRUSH_COMPLEX 94 // CheckBrush failed - complex brush
  158. // free: 95-99
  159. // "Input" counters (not really input-related, just used as more space for
  160. // counters).
  161. #define CORE_IN_COUNT (m_pTSWd->pProtocolStatus)->Input.Specific.Reserved
  162. #define IN_SCH_SMALL_PAYLOAD 0 // PDU small target size
  163. #define IN_SCH_LARGE_PAYLOAD 1 // PDU large target size
  164. #define IN_SCH_OUT_ALL 2 // Number of calls to SCH_DDOutputAvailable
  165. // Flush reasons:
  166. #define IN_SCH_MUSTSEND 3 // due to timer pop
  167. #define IN_SCH_OUTPUT 4 // Output estimate reached target
  168. #define IN_SCH_OE_NUMBER 5 // due to reached heap limit
  169. #define IN_SCH_NEW_CURSOR 6 // due to new cursor shape
  170. #define IN_SCH_ASLEEP 7 // due to first output while asleep
  171. #define IN_SCH_DO_NOTHING 8 // nowt to do, sum to total.
  172. #define IN_SND_TOTAL_ORDER 9 // total number of orders sent
  173. #define IN_SND_ORDER_BYTES 10 // uncompressed raw update orders
  174. #define IN_SND_NO_BUFFER 11 // failed to allocate an OutBuf
  175. #define IN_MEMBLT_BYTES 12
  176. #define IN_MEM3BLT_BYTES 13
  177. #define IN_DSTBLT_BYTES 14
  178. #define IN_MULTI_DSTBLT_BYTES 15
  179. #define IN_OPAQUERECT_BYTES 16
  180. #define IN_MULTI_OPAQUERECT_BYTES 17
  181. #define IN_PATBLT_BYTES 18
  182. #define IN_MULTI_PATBLT_BYTES 19
  183. #define IN_SCRBLT_BYTES 20
  184. #define IN_MULTI_SCRBLT_BYTES 21
  185. #define IN_LINETO_BYTES 22
  186. #define IN_FASTGLYPH_BYTES 23
  187. #define IN_FASTINDEX_BYTES 24
  188. #define IN_GLYPHINDEX_BYTES 25
  189. #define IN_POLYLINE_BYTES 26
  190. #define IN_ELLIPSE_SC_BYTES 27
  191. #define IN_ELLIPSE_CB_BYTES 28
  192. #define IN_POLYGON_SC_BYTES 29
  193. #define IN_POLYGON_CB_BYTES 30
  194. #define IN_SAVEBITMAP_BYTES 31
  195. #define IN_REPLAY_ORDERS 40
  196. #define IN_REPLAY_BYTES 41
  197. #define IN_SND_SDA_ALL 42 // Number of calls to SDG_SendSDA
  198. #define IN_SND_SDA_AREA 43 // uncompressed bytes of SDA
  199. #define IN_SND_SDA_PDUS 44 // number of SDA packets
  200. #define IN_SDA_BITBLT_ROP4_AREA 45
  201. #define IN_SDA_BITBLT_NOROP3_AREA 46
  202. #define IN_SDA_BITBLT_COMPLEXCLIP_AREA 47
  203. #define IN_SDA_OPAQUERECT_AREA 48
  204. #define IN_SDA_PATBLT_AREA 49
  205. #define IN_SDA_DSTBLT_AREA 50
  206. #define IN_SDA_MEMBLT_AREA 51
  207. #define IN_SDA_MEM3BLT_AREA 52
  208. #define IN_SDA_SCRBLT_AREA 53
  209. #define IN_SDA_SCRSCR_FAILROP_AREA 54
  210. #define IN_SDA_TEXTOUT_AREA 55
  211. #define IN_SDA_LINETO_AREA 56
  212. #define IN_SDA_STROKEPATH_AREA 57
  213. #define IN_SDA_FILLPATH_AREA 58
  214. //free: 59-84
  215. #define IN_PKT_TOTAL_SENT 85 // total number of packets sent
  216. #define IN_PKT_BYTE_SPREAD1 86 // sent pkt of 0 - 200 bytes
  217. #define IN_PKT_BYTE_SPREAD2 87 // sent pkt of 201 - 400 bytes
  218. #define IN_PKT_BYTE_SPREAD3 88 // sent pkt of 401 - 600 bytes
  219. #define IN_PKT_BYTE_SPREAD4 89 // sent pkt of 601 - 800 bytes
  220. #define IN_PKT_BYTE_SPREAD5 90 // sent pkt of 801 - 1000 bytes
  221. #define IN_PKT_BYTE_SPREAD6 91 // sent pkt of 1001 - 1200 bytes
  222. #define IN_PKT_BYTE_SPREAD7 92 // sent pkt of 1201 - 1400 bytes
  223. #define IN_PKT_BYTE_SPREAD8 93 // sent pkt of 1401 - 1600 bytes
  224. #define IN_PKT_BYTE_SPREAD9 94 // sent pkt of 1601 - 2000 bytes
  225. #define IN_PKT_BYTE_SPREAD10 95 // sent pkt of 2001 - 4000 bytes
  226. #define IN_PKT_BYTE_SPREAD11 96 // sent pkt of 4001 - 6000 bytes
  227. #define IN_PKT_BYTE_SPREAD12 97 // sent pkt of 6001 - 8000 bytes
  228. #define IN_PKT_BYTE_SPREAD13 98 // sent pkt of >8000 bytes
  229. #define IN_MAX_PKT_SIZE 99 // biggest single datalen for MCS
  230. #endif /* _H_NPRCOUNT */