Source code of Windows XP (NT5)
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.

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