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.

201 lines
7.2 KiB

  1. /*
  2. * Module Name: WSDATA.H
  3. *
  4. * Description:
  5. *
  6. * Working set tuner include file. Contains common structure
  7. * declarations and constant definitions.
  8. *
  9. *
  10. * This is an OS/2 2.x specific file
  11. *
  12. * IBM/Microsoft Confidential
  13. *
  14. * Copyright (c) IBM Corporation 1987, 1989
  15. * Copyright (c) Microsoft Corporation 1987-1998
  16. *
  17. * All Rights Reserved
  18. *
  19. * Modification History:
  20. *
  21. * 03/23/90 - created
  22. * 04/16/98 - QFE DerrickG (mdg):
  23. * - modified dtqo_s.dtqo_resv from "unsigned short" to "unsigned long"
  24. * to accommodate large symbol counts
  25. *
  26. */
  27. /*
  28. * Constant definitions.
  29. */
  30. #define NUM_VAR_BITS (sizeof(ULONG) << 3)
  31. #ifdef TMIFILEHACK
  32. #define MAXLINE 80
  33. #endif /* TMIFILEHACK */
  34. /*
  35. * Type definitions and structure declarations.
  36. */
  37. typedef ULONG fxnbits_t;
  38. struct dtqo_s {
  39. unsigned long dtqo_hMTE; /* MTE handle */
  40. unsigned short dtqo_usID; /* Identifier */
  41. unsigned long dtqo_resv; /* Reserved */ // mdg 98/4
  42. unsigned long dtqo_cbPathname; /* Module pathname length */
  43. unsigned long dtqo_clVar; /* Number of dyntrc variables */
  44. };
  45. typedef struct dtqo_s dtqo_t;
  46. /*
  47. * WSI file layout:
  48. *
  49. * _________________________________________
  50. * | |
  51. * | wsihdr_s |
  52. * |_______________________________________|
  53. * |_______________________________________|
  54. * | sentinel 0 (dtgp_s) | <----------
  55. * |=======================================| |
  56. * | snapshot 0 (dtgp_s) for module X | | S
  57. * |---------------------------------------| | n
  58. * | dynamic trace variables for X | | a
  59. * |---------------------------------------| | p
  60. * | snapshot 0 (dtgp_s) for module Y | | s
  61. * |---------------------------------------| | h
  62. * | dynamic trace variables for Y | | o
  63. * |---------------------------------------| | t
  64. * | etc. | |
  65. * |=======================================| | D
  66. * | sentinel 1 (dtgp_s) | | a
  67. * |=======================================| | t
  68. * | snapshot 1 (dtgp_s) for module X | | a
  69. * |---------------------------------------| |
  70. * | dynamic trace variables for X | |
  71. * |---------------------------------------| |
  72. * | snapshot 1 (dtgp_s) for module Y | |
  73. * |---------------------------------------| |
  74. * | dynamic trace variables for Y | |
  75. * |---------------------------------------| |
  76. * | etc. | |
  77. * |=======================================| |
  78. * | sentinel 2 (dtgp_s) | |
  79. * |=======================================| |
  80. * | etc. | |
  81. * |=======================================| |
  82. * | end sentinel (dtgp_s) | |
  83. * |_______________________________________| <----------
  84. * |_______________________________________|
  85. * | | <---------- Q
  86. * | dtqo_s for module X | | u
  87. * |---------------------------------------| | e
  88. * | module X pathname string | | r
  89. * |=======================================| | y
  90. * | dtqo_s for module Y | |
  91. * |---------------------------------------| | I
  92. * | module Y pathname string | | n
  93. * |=======================================| | f
  94. * | etc. | <---------- o
  95. * |=======================================|
  96. * |_______________________________________|
  97. *
  98. */
  99. /* WSI file header format */
  100. struct wsihdr_s {
  101. CHAR wsihdr_chSignature[4]; // file signature
  102. ULONG wsihdr_ulLevel; // format level
  103. ULONG wsihdr_ulTimeStamp; // time stamp
  104. ULONG wsihdr_ulOffGetvar; // offset to DT_GETVAR data
  105. ULONG wsihdr_ulOffQuery; // offset to DT_QUERY data
  106. ULONG wsihdr_cbFile; // size of file (in bytes)
  107. ULONG wsihdr_ulSnaps; // number of snapshots
  108. };
  109. typedef struct wsihdr_s wsihdr_t;
  110. /*
  111. * WSP file layout:
  112. *
  113. * _________________________________________
  114. * | |
  115. * | wsphdr_s |
  116. * |---------------------------------------|
  117. * | module pathname array |
  118. * |_______________________________________|
  119. * |_______________________________________|
  120. * | function #0 bitstring |
  121. * | (rounded to DWORD boundary) |
  122. * |=======================================|
  123. * | function #1 bitstring |
  124. * |=======================================|
  125. * | etc. |
  126. * |=======================================|
  127. * |_______________________________________|
  128. *
  129. */
  130. /* WSP file header format */
  131. struct wsphdr_s {
  132. CHAR wsphdr_chSignature[4]; // file signature
  133. ULONG wsphdr_ulTimeStamp; // time stamp
  134. dtqo_t wsphdr_dtqo; // query info
  135. ULONG wsphdr_ulOffBits; // offset to first bitstring
  136. ULONG wsphdr_ulSnaps; // number of snapshots
  137. /* followed by module pathname char array, length specified in dtqo */
  138. };
  139. typedef struct wsphdr_s wsphdr_t;
  140. /*
  141. * TMI file layout:
  142. *
  143. * _________________________________________
  144. * | |
  145. * | tmihdr_s |
  146. * |_______________________________________|
  147. * |_______________________________________|
  148. * | function #0 tmirec_s |
  149. * |---------------------------------------|
  150. * | function #0 name array |
  151. * |=======================================|
  152. * | function #1 tmirec_s |
  153. * |---------------------------------------|
  154. * | function #1 name array |
  155. * |=======================================|
  156. * | etc. |
  157. * |=======================================|
  158. * |_______________________________________|
  159. *
  160. */
  161. /* TMI file header. */
  162. typedef struct tmihdr_s {
  163. CHAR tmihdr_chSignature[4]; // "TMI\0"
  164. USHORT tmihdr_usMajor; // Range 0x0001 to 0x00FF
  165. USHORT tmihdr_cTmiRec; // Number of tmirec in file
  166. CHAR tmihdr_chModName[256]; // Name of traced module
  167. USHORT tmihdr_usID; // Module identifier
  168. CHAR tmihdr_resv[30]; // Reserved
  169. };
  170. typedef struct tmihdr_s tmihdr_t;
  171. /* Per-function information from TMI file */
  172. struct tmirec_s {
  173. ULONG tmirec_ulFxnBit; // function's bit reference position
  174. ULONG tmirec_usFxnAddrObj; // object portion of function address
  175. ULONG tmirec_ulFxnAddrOff; // offset portion of function address
  176. ULONG tmirec_cbFxn; // size of function (in bytes)
  177. USHORT tmirec_cbFxnName; // size in bytes of function name
  178. CHAR tmirec_FxnName[1]; // bytes of function name start here
  179. };
  180. typedef struct tmirec_s tmirec_t;