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.

380 lines
8.9 KiB

  1. /*++
  2. Copyright (c) 1996 Microsoft Corporation
  3. Module Name:
  4. dataproc.c
  5. Abstract:
  6. a file containing the constant data structures used by the Performance
  7. Monitor data for the Process 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 "dataproc.h"
  21. // dummy variable for field sizing.
  22. static PROCESS_COUNTER_DATA pcd;
  23. //
  24. // Constant structure initializations
  25. // defined in dataproc.h
  26. //
  27. PROCESS_DATA_DEFINITION ProcessDataDefinition = {
  28. { 0, // depends on number of instanced found
  29. sizeof(PROCESS_DATA_DEFINITION),
  30. sizeof(PERF_OBJECT_TYPE),
  31. PROCESS_OBJECT_TITLE_INDEX,
  32. 0,
  33. 231,
  34. 0,
  35. PERF_DETAIL_NOVICE,
  36. (sizeof(PROCESS_DATA_DEFINITION)-sizeof(PERF_OBJECT_TYPE))/
  37. sizeof(PERF_COUNTER_DEFINITION),
  38. 0,
  39. 0,
  40. UNICODE_CODE_PAGE,
  41. {0L,0L},
  42. {10000000L,0L}
  43. },
  44. { sizeof(PERF_COUNTER_DEFINITION),
  45. 6,
  46. 0,
  47. 189,
  48. 0,
  49. 0,
  50. PERF_DETAIL_NOVICE,
  51. PERF_100NSEC_TIMER,
  52. sizeof(pcd.ProcessorTime),
  53. (DWORD)(ULONG_PTR)&((PPROCESS_COUNTER_DATA)0)->ProcessorTime
  54. },
  55. { sizeof(PERF_COUNTER_DEFINITION),
  56. 142,
  57. 0,
  58. 157,
  59. 0,
  60. 0,
  61. PERF_DETAIL_ADVANCED,
  62. PERF_100NSEC_TIMER,
  63. sizeof(pcd.UserTime),
  64. (DWORD)(ULONG_PTR)&((PPROCESS_COUNTER_DATA)0)->UserTime
  65. },
  66. { sizeof(PERF_COUNTER_DEFINITION),
  67. 144,
  68. 0,
  69. 159,
  70. 0,
  71. 0,
  72. PERF_DETAIL_ADVANCED,
  73. PERF_100NSEC_TIMER,
  74. sizeof(pcd.KernelTime),
  75. (DWORD)(ULONG_PTR)&((PPROCESS_COUNTER_DATA)0)->KernelTime
  76. },
  77. { sizeof(PERF_COUNTER_DEFINITION),
  78. 172,
  79. 0,
  80. 173,
  81. 0,
  82. -6,
  83. PERF_DETAIL_EXPERT,
  84. PERF_COUNTER_LARGE_RAWCOUNT,
  85. sizeof(pcd.PeakVirtualSize),
  86. (DWORD)(ULONG_PTR)&((PPROCESS_COUNTER_DATA)0)->PeakVirtualSize
  87. },
  88. { sizeof(PERF_COUNTER_DEFINITION),
  89. 174,
  90. 0,
  91. 175,
  92. 0,
  93. -6,
  94. PERF_DETAIL_EXPERT,
  95. PERF_COUNTER_LARGE_RAWCOUNT,
  96. sizeof(pcd.VirtualSize),
  97. (DWORD)(ULONG_PTR)&((PPROCESS_COUNTER_DATA)0)->VirtualSize
  98. },
  99. { sizeof(PERF_COUNTER_DEFINITION),
  100. 28,
  101. 0,
  102. 177,
  103. 0,
  104. -1,
  105. PERF_DETAIL_NOVICE,
  106. PERF_COUNTER_COUNTER,
  107. sizeof(pcd.PageFaults),
  108. (DWORD)(ULONG_PTR)&((PPROCESS_COUNTER_DATA)0)->PageFaults
  109. },
  110. { sizeof(PERF_COUNTER_DEFINITION),
  111. 178,
  112. 0,
  113. 179,
  114. 0,
  115. -5,
  116. PERF_DETAIL_ADVANCED,
  117. PERF_COUNTER_LARGE_RAWCOUNT,
  118. sizeof(pcd.PeakWorkingSet),
  119. (DWORD)(ULONG_PTR)&((PPROCESS_COUNTER_DATA)0)->PeakWorkingSet
  120. },
  121. { sizeof(PERF_COUNTER_DEFINITION),
  122. 180,
  123. 0,
  124. 181,
  125. 0,
  126. -5,
  127. PERF_DETAIL_NOVICE,
  128. PERF_COUNTER_LARGE_RAWCOUNT,
  129. sizeof(pcd.TotalWorkingSet),
  130. (DWORD)(ULONG_PTR)&((PPROCESS_COUNTER_DATA)0)->TotalWorkingSet
  131. },
  132. #ifdef _DATAPROC_PRIVATE_WS_
  133. { sizeof(PERF_COUNTER_DEFINITION),
  134. 1478,
  135. 0,
  136. 1479,
  137. 0,
  138. -5,
  139. PERF_DETAIL_NOVICE,
  140. PERF_COUNTER_LARGE_RAWCOUNT,
  141. sizeof(pcd.PrivateWorkingSet),
  142. (DWORD)(ULONG_PTR)&((PPROCESS_COUNTER_DATA)0)->PrivateWorkingSet
  143. },
  144. { sizeof(PERF_COUNTER_DEFINITION),
  145. 1480,
  146. 0,
  147. 1481,
  148. 0,
  149. -5,
  150. PERF_DETAIL_NOVICE,
  151. PERF_COUNTER_LARGE_RAWCOUNT,
  152. sizeof(pcd.SharedWorkingSet),
  153. (DWORD)(ULONG_PTR)&((PPROCESS_COUNTER_DATA)0)->SharedWorkingSet
  154. },
  155. #endif
  156. { sizeof(PERF_COUNTER_DEFINITION),
  157. 182,
  158. 0,
  159. 183,
  160. 0,
  161. -6,
  162. PERF_DETAIL_ADVANCED,
  163. PERF_COUNTER_LARGE_RAWCOUNT,
  164. sizeof(pcd.PeakPageFile),
  165. (DWORD)(ULONG_PTR)&((PPROCESS_COUNTER_DATA)0)->PeakPageFile
  166. },
  167. { sizeof(PERF_COUNTER_DEFINITION),
  168. 184,
  169. 0,
  170. 185,
  171. 0,
  172. -6,
  173. PERF_DETAIL_ADVANCED,
  174. PERF_COUNTER_LARGE_RAWCOUNT,
  175. sizeof(pcd.PageFile),
  176. (DWORD)(ULONG_PTR)&((PPROCESS_COUNTER_DATA)0)->PageFile
  177. },
  178. { sizeof(PERF_COUNTER_DEFINITION),
  179. 186,
  180. 0,
  181. 187,
  182. 0,
  183. -5,
  184. PERF_DETAIL_ADVANCED,
  185. PERF_COUNTER_LARGE_RAWCOUNT,
  186. sizeof(pcd.PrivatePages),
  187. (DWORD)(ULONG_PTR)&((PPROCESS_COUNTER_DATA)0)->PrivatePages
  188. },
  189. { sizeof(PERF_COUNTER_DEFINITION),
  190. 680,
  191. 0,
  192. 681,
  193. 0,
  194. 0,
  195. PERF_DETAIL_ADVANCED,
  196. PERF_COUNTER_RAWCOUNT,
  197. sizeof(pcd.ThreadCount),
  198. (DWORD)(ULONG_PTR)&((PPROCESS_COUNTER_DATA)0)->ThreadCount
  199. },
  200. { sizeof(PERF_COUNTER_DEFINITION),
  201. 682,
  202. 0,
  203. 683,
  204. 0,
  205. 0,
  206. PERF_DETAIL_ADVANCED,
  207. PERF_COUNTER_RAWCOUNT,
  208. sizeof(pcd.BasePriority),
  209. (DWORD)(ULONG_PTR)&((PPROCESS_COUNTER_DATA)0)->BasePriority
  210. },
  211. { sizeof(PERF_COUNTER_DEFINITION),
  212. 684,
  213. 0,
  214. 685,
  215. 0,
  216. -4,
  217. PERF_DETAIL_ADVANCED,
  218. PERF_ELAPSED_TIME,
  219. sizeof(pcd.ElapsedTime),
  220. (DWORD)(ULONG_PTR)&((PPROCESS_COUNTER_DATA)0)->ElapsedTime
  221. },
  222. { sizeof(PERF_COUNTER_DEFINITION),
  223. 784,
  224. 0,
  225. 785,
  226. 0,
  227. -1,
  228. PERF_DETAIL_NOVICE,
  229. PERF_COUNTER_RAWCOUNT,
  230. sizeof(pcd.ProcessId),
  231. (DWORD)(ULONG_PTR)&((PPROCESS_COUNTER_DATA)0)->ProcessId
  232. },
  233. { sizeof(PERF_COUNTER_DEFINITION),
  234. 1410,
  235. 0,
  236. 1411,
  237. 0,
  238. -1,
  239. PERF_DETAIL_NOVICE,
  240. PERF_COUNTER_RAWCOUNT,
  241. sizeof(pcd.CreatorProcessId),
  242. (DWORD)(ULONG_PTR)&((PPROCESS_COUNTER_DATA)0)->CreatorProcessId
  243. },
  244. { sizeof(PERF_COUNTER_DEFINITION),
  245. 56,
  246. 0,
  247. 57,
  248. 0,
  249. -5,
  250. PERF_DETAIL_ADVANCED,
  251. PERF_COUNTER_RAWCOUNT,
  252. sizeof(pcd.PagedPool),
  253. (DWORD)(ULONG_PTR)&((PPROCESS_COUNTER_DATA)0)->PagedPool
  254. },
  255. { sizeof(PERF_COUNTER_DEFINITION),
  256. 58,
  257. 0,
  258. 59,
  259. 0,
  260. -5,
  261. PERF_DETAIL_ADVANCED,
  262. PERF_COUNTER_RAWCOUNT,
  263. sizeof(pcd.NonPagedPool),
  264. (DWORD)(ULONG_PTR)&((PPROCESS_COUNTER_DATA)0)->NonPagedPool
  265. },
  266. { sizeof(PERF_COUNTER_DEFINITION),
  267. 952,
  268. 0,
  269. 953,
  270. 0,
  271. 0,
  272. PERF_DETAIL_ADVANCED,
  273. PERF_COUNTER_RAWCOUNT,
  274. sizeof(pcd.HandleCount),
  275. (DWORD)(ULONG_PTR)&((PPROCESS_COUNTER_DATA)0)->HandleCount
  276. },
  277. { sizeof(PERF_COUNTER_DEFINITION),
  278. 1412,
  279. 0,
  280. 1413,
  281. 0,
  282. 0,
  283. PERF_DETAIL_ADVANCED,
  284. PERF_COUNTER_BULK_COUNT,
  285. sizeof(pcd.ReadOperationCount),
  286. (DWORD)(ULONG_PTR)&((PPROCESS_COUNTER_DATA)0)->ReadOperationCount
  287. },
  288. { sizeof(PERF_COUNTER_DEFINITION),
  289. 1414,
  290. 0,
  291. 1415,
  292. 0,
  293. 0,
  294. PERF_DETAIL_ADVANCED,
  295. PERF_COUNTER_BULK_COUNT,
  296. sizeof(pcd.WriteOperationCount),
  297. (DWORD)(ULONG_PTR)&((PPROCESS_COUNTER_DATA)0)->WriteOperationCount
  298. },
  299. { sizeof(PERF_COUNTER_DEFINITION),
  300. 1416,
  301. 0,
  302. 1417,
  303. 0,
  304. 0,
  305. PERF_DETAIL_ADVANCED,
  306. PERF_COUNTER_BULK_COUNT,
  307. sizeof(pcd.DataOperationCount),
  308. (DWORD)(ULONG_PTR)&((PPROCESS_COUNTER_DATA)0)->DataOperationCount
  309. },
  310. { sizeof(PERF_COUNTER_DEFINITION),
  311. 1418,
  312. 0,
  313. 1419,
  314. 0,
  315. 0,
  316. PERF_DETAIL_ADVANCED,
  317. PERF_COUNTER_BULK_COUNT,
  318. sizeof(pcd.OtherOperationCount),
  319. (DWORD)(ULONG_PTR)&((PPROCESS_COUNTER_DATA)0)->OtherOperationCount
  320. },
  321. { sizeof(PERF_COUNTER_DEFINITION),
  322. 1420,
  323. 0,
  324. 1421,
  325. 0,
  326. 0,
  327. PERF_DETAIL_ADVANCED,
  328. PERF_COUNTER_BULK_COUNT,
  329. sizeof(pcd.ReadTransferCount),
  330. (DWORD)(ULONG_PTR)&((PPROCESS_COUNTER_DATA)0)->ReadTransferCount
  331. },
  332. { sizeof(PERF_COUNTER_DEFINITION),
  333. 1422,
  334. 0,
  335. 1423,
  336. 0,
  337. 0,
  338. PERF_DETAIL_ADVANCED,
  339. PERF_COUNTER_BULK_COUNT,
  340. sizeof(pcd.WriteTransferCount),
  341. (DWORD)(ULONG_PTR)&((PPROCESS_COUNTER_DATA)0)->WriteTransferCount
  342. },
  343. { sizeof(PERF_COUNTER_DEFINITION),
  344. 1424,
  345. 0,
  346. 1425,
  347. 0,
  348. 0,
  349. PERF_DETAIL_ADVANCED,
  350. PERF_COUNTER_BULK_COUNT,
  351. sizeof(pcd.DataTransferCount),
  352. (DWORD)(ULONG_PTR)&((PPROCESS_COUNTER_DATA)0)->DataTransferCount
  353. },
  354. { sizeof(PERF_COUNTER_DEFINITION),
  355. 1426,
  356. 0,
  357. 1427,
  358. 0,
  359. 0,
  360. PERF_DETAIL_ADVANCED,
  361. PERF_COUNTER_BULK_COUNT,
  362. sizeof(pcd.OtherTransferCount),
  363. (DWORD)(ULONG_PTR)&((PPROCESS_COUNTER_DATA)0)->OtherTransferCount
  364. }
  365. };