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.

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