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.

333 lines
8.5 KiB

  1. /*++
  2. Copyright (c) 1996 Microsoft Corporation
  3. Module Name:
  4. datacpu.c
  5. Abstract:
  6. a file containing the constant data structures used by the Performance
  7. Monitor data for the Processor Performance data objects
  8. Created:
  9. Bob Watson 22-Oct-1996
  10. Revision History:
  11. None.
  12. --*/
  13. //
  14. // Include Files
  15. //
  16. #include <windows.h>
  17. #include <winperf.h>
  18. #include <ntprfctr.h>
  19. #include <perfutil.h>
  20. #include "datacpu.h"
  21. //
  22. // Constant structure initializations
  23. // defined in datacpu.h
  24. //
  25. PROCESSOR_DATA_DEFINITION ProcessorDataDefinition = {
  26. { 0,
  27. sizeof(PROCESSOR_DATA_DEFINITION),
  28. sizeof(PERF_OBJECT_TYPE),
  29. PROCESSOR_OBJECT_TITLE_INDEX,
  30. 0,
  31. 239,
  32. 0,
  33. PERF_DETAIL_NOVICE,
  34. (sizeof(PROCESSOR_DATA_DEFINITION)-sizeof(PERF_OBJECT_TYPE))/
  35. sizeof(PERF_COUNTER_DEFINITION),
  36. 0,
  37. 1,
  38. UNICODE_CODE_PAGE,
  39. {0L,0L},
  40. {0L,0L}
  41. },
  42. { sizeof(PERF_COUNTER_DEFINITION),
  43. 6,
  44. 0,
  45. 7,
  46. 0,
  47. 0,
  48. PERF_DETAIL_NOVICE,
  49. PERF_100NSEC_TIMER_INV,
  50. RTL_FIELD_SIZE(PROCESSOR_COUNTER_DATA, ProcessorTime),
  51. (DWORD)(ULONG_PTR)&((PPROCESSOR_COUNTER_DATA)0)->ProcessorTime
  52. },
  53. { sizeof(PERF_COUNTER_DEFINITION),
  54. 142,
  55. 0,
  56. 143,
  57. 0,
  58. 0,
  59. PERF_DETAIL_ADVANCED,
  60. PERF_100NSEC_TIMER,
  61. RTL_FIELD_SIZE(PROCESSOR_COUNTER_DATA, UserTime),
  62. (DWORD)(ULONG_PTR)&((PPROCESSOR_COUNTER_DATA)0)->UserTime
  63. },
  64. { sizeof(PERF_COUNTER_DEFINITION),
  65. 144,
  66. 0,
  67. 145,
  68. 0,
  69. 0,
  70. PERF_DETAIL_ADVANCED,
  71. PERF_100NSEC_TIMER,
  72. RTL_FIELD_SIZE(PROCESSOR_COUNTER_DATA, KernelTime),
  73. (DWORD)(ULONG_PTR)&((PPROCESSOR_COUNTER_DATA)0)->KernelTime
  74. },
  75. { sizeof(PERF_COUNTER_DEFINITION),
  76. 148,
  77. 0,
  78. 149,
  79. 0,
  80. -2,
  81. PERF_DETAIL_NOVICE,
  82. PERF_COUNTER_COUNTER,
  83. RTL_FIELD_SIZE(PROCESSOR_COUNTER_DATA, Interrupts),
  84. (DWORD)(ULONG_PTR)&((PPROCESSOR_COUNTER_DATA)0)->Interrupts
  85. },
  86. { sizeof(PERF_COUNTER_DEFINITION),
  87. 696,
  88. 0,
  89. 339,
  90. 0,
  91. 0,
  92. PERF_DETAIL_ADVANCED,
  93. PERF_100NSEC_TIMER,
  94. RTL_FIELD_SIZE(PROCESSOR_COUNTER_DATA, DpcTime),
  95. (DWORD)(ULONG_PTR)&((PPROCESSOR_COUNTER_DATA)0)->DpcTime
  96. },
  97. { sizeof(PERF_COUNTER_DEFINITION),
  98. 698,
  99. 0,
  100. 397,
  101. 0,
  102. 0,
  103. PERF_DETAIL_ADVANCED,
  104. PERF_100NSEC_TIMER,
  105. RTL_FIELD_SIZE(PROCESSOR_COUNTER_DATA, InterruptTime),
  106. (DWORD)(ULONG_PTR)&((PPROCESSOR_COUNTER_DATA)0)->InterruptTime
  107. },
  108. { sizeof(PERF_COUNTER_DEFINITION),
  109. 1334,
  110. 0,
  111. 1335,
  112. 0,
  113. 0,
  114. PERF_DETAIL_ADVANCED,
  115. PERF_COUNTER_COUNTER,
  116. RTL_FIELD_SIZE(PROCESSOR_COUNTER_DATA, DpcCountRate),
  117. (DWORD)(ULONG_PTR)&((PPROCESSOR_COUNTER_DATA)0)->DpcCountRate
  118. },
  119. { sizeof(PERF_COUNTER_DEFINITION),
  120. 1336,
  121. 0,
  122. 1337,
  123. 0,
  124. 0,
  125. PERF_DETAIL_ADVANCED,
  126. PERF_COUNTER_RAWCOUNT,
  127. RTL_FIELD_SIZE(PROCESSOR_COUNTER_DATA, DpcRate),
  128. (DWORD)(ULONG_PTR)&((PPROCESSOR_COUNTER_DATA)0)->DpcRate
  129. },
  130. };
  131. //
  132. // Constant structure initializations
  133. // defined in datacpu.h
  134. //
  135. EX_PROCESSOR_DATA_DEFINITION ExProcessorDataDefinition = {
  136. { 0,
  137. sizeof(EX_PROCESSOR_DATA_DEFINITION),
  138. sizeof(PERF_OBJECT_TYPE),
  139. PROCESSOR_OBJECT_TITLE_INDEX,
  140. 0,
  141. 239,
  142. 0,
  143. PERF_DETAIL_NOVICE,
  144. (sizeof(EX_PROCESSOR_DATA_DEFINITION)-sizeof(PERF_OBJECT_TYPE))/
  145. sizeof(PERF_COUNTER_DEFINITION),
  146. 0,
  147. 1,
  148. UNICODE_CODE_PAGE,
  149. {0L,0L},
  150. {0L,0L}
  151. },
  152. { sizeof(PERF_COUNTER_DEFINITION),
  153. 6,
  154. 0,
  155. 7,
  156. 0,
  157. 0,
  158. PERF_DETAIL_NOVICE,
  159. PERF_100NSEC_TIMER_INV,
  160. RTL_FIELD_SIZE(EX_PROCESSOR_COUNTER_DATA, ProcessorTime),
  161. (DWORD)(ULONG_PTR)&((PEX_PROCESSOR_COUNTER_DATA)0)->ProcessorTime
  162. },
  163. { sizeof(PERF_COUNTER_DEFINITION),
  164. 142,
  165. 0,
  166. 143,
  167. 0,
  168. 0,
  169. PERF_DETAIL_ADVANCED,
  170. PERF_100NSEC_TIMER,
  171. RTL_FIELD_SIZE(EX_PROCESSOR_COUNTER_DATA, UserTime),
  172. (DWORD)(ULONG_PTR)&((PEX_PROCESSOR_COUNTER_DATA)0)->UserTime
  173. },
  174. { sizeof(PERF_COUNTER_DEFINITION),
  175. 144,
  176. 0,
  177. 145,
  178. 0,
  179. 0,
  180. PERF_DETAIL_ADVANCED,
  181. PERF_100NSEC_TIMER,
  182. RTL_FIELD_SIZE(EX_PROCESSOR_COUNTER_DATA, KernelTime),
  183. (DWORD)(ULONG_PTR)&((PEX_PROCESSOR_COUNTER_DATA)0)->KernelTime
  184. },
  185. { sizeof(PERF_COUNTER_DEFINITION),
  186. 148,
  187. 0,
  188. 149,
  189. 0,
  190. -2,
  191. PERF_DETAIL_NOVICE,
  192. PERF_COUNTER_COUNTER,
  193. RTL_FIELD_SIZE(EX_PROCESSOR_COUNTER_DATA, Interrupts),
  194. (DWORD)(ULONG_PTR)&((PEX_PROCESSOR_COUNTER_DATA)0)->Interrupts
  195. },
  196. { sizeof(PERF_COUNTER_DEFINITION),
  197. 696,
  198. 0,
  199. 339,
  200. 0,
  201. 0,
  202. PERF_DETAIL_ADVANCED,
  203. PERF_100NSEC_TIMER,
  204. RTL_FIELD_SIZE(EX_PROCESSOR_COUNTER_DATA, DpcTime),
  205. (DWORD)(ULONG_PTR)&((PEX_PROCESSOR_COUNTER_DATA)0)->DpcTime
  206. },
  207. { sizeof(PERF_COUNTER_DEFINITION),
  208. 698,
  209. 0,
  210. 397,
  211. 0,
  212. 0,
  213. PERF_DETAIL_ADVANCED,
  214. PERF_100NSEC_TIMER,
  215. RTL_FIELD_SIZE(EX_PROCESSOR_COUNTER_DATA, InterruptTime),
  216. (DWORD)(ULONG_PTR)&((PEX_PROCESSOR_COUNTER_DATA)0)->InterruptTime
  217. },
  218. { sizeof(PERF_COUNTER_DEFINITION),
  219. 1334,
  220. 0,
  221. 1335,
  222. 0,
  223. 0,
  224. PERF_DETAIL_ADVANCED,
  225. PERF_COUNTER_COUNTER,
  226. RTL_FIELD_SIZE(EX_PROCESSOR_COUNTER_DATA, DpcCountRate),
  227. (DWORD)(ULONG_PTR)&((PEX_PROCESSOR_COUNTER_DATA)0)->DpcCountRate
  228. },
  229. { sizeof(PERF_COUNTER_DEFINITION),
  230. 1336,
  231. 0,
  232. 1337,
  233. 0,
  234. 0,
  235. PERF_DETAIL_ADVANCED,
  236. PERF_COUNTER_RAWCOUNT,
  237. RTL_FIELD_SIZE(EX_PROCESSOR_COUNTER_DATA, DpcRate),
  238. (DWORD)(ULONG_PTR)&((PEX_PROCESSOR_COUNTER_DATA)0)->DpcRate
  239. },
  240. { sizeof(PERF_COUNTER_DEFINITION),
  241. 1746,
  242. 0,
  243. 1747,
  244. 0,
  245. 0,
  246. PERF_DETAIL_WIZARD,
  247. PERF_100NSEC_TIMER,
  248. RTL_FIELD_SIZE(EX_PROCESSOR_COUNTER_DATA, IdleTime),
  249. (DWORD)(ULONG_PTR)&((PEX_PROCESSOR_COUNTER_DATA)0)->IdleTime
  250. },
  251. { sizeof(PERF_COUNTER_DEFINITION),
  252. 1748,
  253. 0,
  254. 1749,
  255. 0,
  256. 0,
  257. PERF_DETAIL_WIZARD,
  258. PERF_100NSEC_TIMER,
  259. RTL_FIELD_SIZE(EX_PROCESSOR_COUNTER_DATA, C1Time),
  260. (DWORD)(ULONG_PTR)&((PEX_PROCESSOR_COUNTER_DATA)0)->C1Time
  261. },
  262. { sizeof(PERF_COUNTER_DEFINITION),
  263. 1750,
  264. 0,
  265. 1751,
  266. 0,
  267. 0,
  268. PERF_DETAIL_WIZARD,
  269. PERF_100NSEC_TIMER,
  270. RTL_FIELD_SIZE(EX_PROCESSOR_COUNTER_DATA, C2Time),
  271. (DWORD)(ULONG_PTR)&((PEX_PROCESSOR_COUNTER_DATA)0)->C2Time
  272. },
  273. { sizeof(PERF_COUNTER_DEFINITION),
  274. 1752,
  275. 0,
  276. 1753,
  277. 0,
  278. 0,
  279. PERF_DETAIL_WIZARD,
  280. PERF_100NSEC_TIMER,
  281. RTL_FIELD_SIZE(EX_PROCESSOR_COUNTER_DATA, C3Time),
  282. (DWORD)(ULONG_PTR)&((PEX_PROCESSOR_COUNTER_DATA)0)->C3Time
  283. },
  284. { sizeof(PERF_COUNTER_DEFINITION),
  285. 1754,
  286. 0,
  287. 1755,
  288. 0,
  289. 0,
  290. PERF_DETAIL_WIZARD,
  291. PERF_COUNTER_BULK_COUNT,
  292. RTL_FIELD_SIZE(EX_PROCESSOR_COUNTER_DATA, C1Transitions),
  293. (DWORD)(ULONG_PTR)&((PEX_PROCESSOR_COUNTER_DATA)0)->C1Transitions
  294. },
  295. { sizeof(PERF_COUNTER_DEFINITION),
  296. 1756,
  297. 0,
  298. 1757,
  299. 0,
  300. 0,
  301. PERF_DETAIL_WIZARD,
  302. PERF_COUNTER_BULK_COUNT,
  303. RTL_FIELD_SIZE(EX_PROCESSOR_COUNTER_DATA, C2Transitions),
  304. (DWORD)(ULONG_PTR)&((PEX_PROCESSOR_COUNTER_DATA)0)->C2Transitions
  305. },
  306. { sizeof(PERF_COUNTER_DEFINITION),
  307. 1758,
  308. 0,
  309. 1759,
  310. 0,
  311. 0,
  312. PERF_DETAIL_WIZARD,
  313. PERF_COUNTER_BULK_COUNT,
  314. RTL_FIELD_SIZE(EX_PROCESSOR_COUNTER_DATA, C3Transitions),
  315. (DWORD)(ULONG_PTR)&((PEX_PROCESSOR_COUNTER_DATA)0)->C3Transitions
  316. }
  317. };