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.

432 lines
11 KiB

  1. /*++
  2. Copyright (c) 1996 Microsoft Corporation
  3. Module Name:
  4. datamem.c
  5. Abstract:
  6. a file containing the constant data structures used by the Performance
  7. Monitor data for the Memory performance data objects
  8. Created:
  9. Bob Watson 20-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 "datamem.h"
  21. //
  22. // Constant structure initializations
  23. // defined in datagen.h
  24. //
  25. MEMORY_DATA_DEFINITION MemoryDataDefinition = {
  26. { sizeof(MEMORY_DATA_DEFINITION) + sizeof(MEMORY_COUNTER_DATA),
  27. sizeof(MEMORY_DATA_DEFINITION),
  28. sizeof(PERF_OBJECT_TYPE),
  29. MEMORY_OBJECT_TITLE_INDEX,
  30. 0,
  31. 5,
  32. 0,
  33. PERF_DETAIL_NOVICE,
  34. (sizeof(MEMORY_DATA_DEFINITION)-sizeof(PERF_OBJECT_TYPE))/
  35. sizeof(PERF_COUNTER_DEFINITION),
  36. 8,
  37. -1,
  38. UNICODE_CODE_PAGE,
  39. {0L,0L},
  40. {0L,0L}
  41. },
  42. { sizeof(PERF_COUNTER_DEFINITION),
  43. 28,
  44. 0,
  45. 29,
  46. 0,
  47. -1,
  48. PERF_DETAIL_NOVICE,
  49. PERF_COUNTER_COUNTER,
  50. RTL_FIELD_SIZE(MEMORY_COUNTER_DATA, PageFaults),
  51. (DWORD)(ULONG_PTR)&((PMEMORY_COUNTER_DATA)0)->PageFaults
  52. },
  53. { sizeof(PERF_COUNTER_DEFINITION),
  54. 24,
  55. 0,
  56. 25,
  57. 0,
  58. -6,
  59. PERF_DETAIL_EXPERT,
  60. PERF_COUNTER_LARGE_RAWCOUNT,
  61. RTL_FIELD_SIZE(MEMORY_COUNTER_DATA, AvailablePages),
  62. (DWORD)(ULONG_PTR)&((PMEMORY_COUNTER_DATA)0)->AvailablePages
  63. },
  64. { sizeof(PERF_COUNTER_DEFINITION),
  65. 26,
  66. 0,
  67. 27,
  68. 0,
  69. -6,
  70. PERF_DETAIL_EXPERT,
  71. PERF_COUNTER_LARGE_RAWCOUNT,
  72. RTL_FIELD_SIZE(MEMORY_COUNTER_DATA, CommittedPages),
  73. (DWORD)(ULONG_PTR)&((PMEMORY_COUNTER_DATA)0)->CommittedPages
  74. },
  75. { sizeof(PERF_COUNTER_DEFINITION),
  76. 30,
  77. 0,
  78. 31,
  79. 0,
  80. -6,
  81. PERF_DETAIL_WIZARD,
  82. PERF_COUNTER_LARGE_RAWCOUNT,
  83. RTL_FIELD_SIZE(MEMORY_COUNTER_DATA, CommitList),
  84. (DWORD)(ULONG_PTR)&((PMEMORY_COUNTER_DATA)0)->CommitList
  85. },
  86. { sizeof(PERF_COUNTER_DEFINITION),
  87. 32,
  88. 0,
  89. 33,
  90. 0,
  91. 0,
  92. PERF_DETAIL_WIZARD,
  93. PERF_COUNTER_COUNTER,
  94. RTL_FIELD_SIZE(MEMORY_COUNTER_DATA, WriteCopies),
  95. (DWORD)(ULONG_PTR)&((PMEMORY_COUNTER_DATA)0)->WriteCopies
  96. },
  97. { sizeof(PERF_COUNTER_DEFINITION),
  98. 34,
  99. 0,
  100. 35,
  101. 0,
  102. -1,
  103. PERF_DETAIL_WIZARD,
  104. PERF_COUNTER_COUNTER,
  105. RTL_FIELD_SIZE(MEMORY_COUNTER_DATA, TransitionFaults),
  106. (DWORD)(ULONG_PTR)&((PMEMORY_COUNTER_DATA)0)->TransitionFaults
  107. },
  108. { sizeof(PERF_COUNTER_DEFINITION),
  109. 36,
  110. 0,
  111. 37,
  112. 0,
  113. -1,
  114. PERF_DETAIL_WIZARD,
  115. PERF_COUNTER_COUNTER,
  116. RTL_FIELD_SIZE(MEMORY_COUNTER_DATA, CacheFaults),
  117. (DWORD)(ULONG_PTR)&((PMEMORY_COUNTER_DATA)0)->CacheFaults
  118. },
  119. { sizeof(PERF_COUNTER_DEFINITION),
  120. 38,
  121. 0,
  122. 39,
  123. 0,
  124. -1,
  125. PERF_DETAIL_WIZARD,
  126. PERF_COUNTER_COUNTER,
  127. RTL_FIELD_SIZE(MEMORY_COUNTER_DATA, DemandZeroFaults),
  128. (DWORD)(ULONG_PTR)&((PMEMORY_COUNTER_DATA)0)->DemandZeroFaults
  129. },
  130. { sizeof(PERF_COUNTER_DEFINITION),
  131. 40,
  132. 0,
  133. 41,
  134. 0,
  135. 0,
  136. PERF_DETAIL_NOVICE,
  137. PERF_COUNTER_COUNTER,
  138. RTL_FIELD_SIZE(MEMORY_COUNTER_DATA, Pages),
  139. (DWORD)(ULONG_PTR)&((PMEMORY_COUNTER_DATA)0)->Pages
  140. },
  141. { sizeof(PERF_COUNTER_DEFINITION),
  142. 822,
  143. 0,
  144. 823,
  145. 0,
  146. 0,
  147. PERF_DETAIL_NOVICE,
  148. PERF_COUNTER_COUNTER,
  149. RTL_FIELD_SIZE(MEMORY_COUNTER_DATA, PagesInput),
  150. (DWORD)(ULONG_PTR)&((PMEMORY_COUNTER_DATA)0)->PagesInput
  151. },
  152. { sizeof(PERF_COUNTER_DEFINITION),
  153. 42,
  154. 0,
  155. 43,
  156. 0,
  157. 0,
  158. PERF_DETAIL_EXPERT,
  159. PERF_COUNTER_COUNTER,
  160. RTL_FIELD_SIZE(MEMORY_COUNTER_DATA, PageReads),
  161. (DWORD)(ULONG_PTR)&((PMEMORY_COUNTER_DATA)0)->PageReads
  162. },
  163. { sizeof(PERF_COUNTER_DEFINITION),
  164. 48,
  165. 0,
  166. 49,
  167. 0,
  168. 0,
  169. PERF_DETAIL_ADVANCED,
  170. PERF_COUNTER_COUNTER,
  171. RTL_FIELD_SIZE(MEMORY_COUNTER_DATA, DirtyPages),
  172. (DWORD)(ULONG_PTR)&((PMEMORY_COUNTER_DATA)0)->DirtyPages
  173. },
  174. { sizeof(PERF_COUNTER_DEFINITION),
  175. 56,
  176. 0,
  177. 57,
  178. 0,
  179. -5,
  180. PERF_DETAIL_ADVANCED,
  181. PERF_COUNTER_LARGE_RAWCOUNT,
  182. RTL_FIELD_SIZE(MEMORY_COUNTER_DATA, PagedPool),
  183. (DWORD)(ULONG_PTR)&((PMEMORY_COUNTER_DATA)0)->PagedPool
  184. },
  185. { sizeof(PERF_COUNTER_DEFINITION),
  186. 58,
  187. 0,
  188. 59,
  189. 0,
  190. -5,
  191. PERF_DETAIL_ADVANCED,
  192. PERF_COUNTER_LARGE_RAWCOUNT,
  193. RTL_FIELD_SIZE(MEMORY_COUNTER_DATA, NonPagedPool),
  194. (DWORD)(ULONG_PTR)&((PMEMORY_COUNTER_DATA)0)->NonPagedPool
  195. },
  196. { sizeof(PERF_COUNTER_DEFINITION),
  197. 50,
  198. 0,
  199. 51,
  200. 0,
  201. 0,
  202. PERF_DETAIL_EXPERT,
  203. PERF_COUNTER_COUNTER,
  204. RTL_FIELD_SIZE(MEMORY_COUNTER_DATA, DirtyWrites),
  205. (DWORD)(ULONG_PTR)&((PMEMORY_COUNTER_DATA)0)->DirtyWrites
  206. },
  207. { sizeof(PERF_COUNTER_DEFINITION),
  208. 60,
  209. 0,
  210. 61,
  211. 0,
  212. -2,
  213. PERF_DETAIL_WIZARD,
  214. PERF_COUNTER_RAWCOUNT,
  215. RTL_FIELD_SIZE(MEMORY_COUNTER_DATA, PagedPoolAllocs),
  216. (DWORD)(ULONG_PTR)&((PMEMORY_COUNTER_DATA)0)->PagedPoolAllocs
  217. },
  218. { sizeof(PERF_COUNTER_DEFINITION),
  219. 64,
  220. 0,
  221. 65,
  222. 0,
  223. -2,
  224. PERF_DETAIL_WIZARD,
  225. PERF_COUNTER_RAWCOUNT,
  226. RTL_FIELD_SIZE(MEMORY_COUNTER_DATA, NonPagedPoolAllocs),
  227. (DWORD)(ULONG_PTR)&((PMEMORY_COUNTER_DATA)0)->NonPagedPoolAllocs
  228. },
  229. { sizeof(PERF_COUNTER_DEFINITION),
  230. 678,
  231. 0,
  232. 679,
  233. 0,
  234. -2,
  235. PERF_DETAIL_WIZARD,
  236. PERF_COUNTER_RAWCOUNT,
  237. RTL_FIELD_SIZE(MEMORY_COUNTER_DATA, FreeSystemPtes),
  238. (DWORD)(ULONG_PTR)&((PMEMORY_COUNTER_DATA)0)->FreeSystemPtes
  239. },
  240. { sizeof(PERF_COUNTER_DEFINITION),
  241. 818,
  242. 0,
  243. 819,
  244. 0,
  245. -5,
  246. PERF_DETAIL_ADVANCED,
  247. PERF_COUNTER_LARGE_RAWCOUNT,
  248. RTL_FIELD_SIZE(MEMORY_COUNTER_DATA, CacheBytes),
  249. (DWORD)(ULONG_PTR)&((PMEMORY_COUNTER_DATA)0)->CacheBytes
  250. },
  251. { sizeof(PERF_COUNTER_DEFINITION),
  252. 820,
  253. 0,
  254. 821,
  255. 0,
  256. -5,
  257. PERF_DETAIL_ADVANCED,
  258. PERF_COUNTER_LARGE_RAWCOUNT,
  259. RTL_FIELD_SIZE(MEMORY_COUNTER_DATA, PeakCacheBytes),
  260. (DWORD)(ULONG_PTR)&((PMEMORY_COUNTER_DATA)0)->PeakCacheBytes
  261. },
  262. { sizeof(PERF_COUNTER_DEFINITION),
  263. 66,
  264. 0,
  265. 63,
  266. 0,
  267. -5,
  268. PERF_DETAIL_ADVANCED,
  269. PERF_COUNTER_LARGE_RAWCOUNT,
  270. RTL_FIELD_SIZE(MEMORY_COUNTER_DATA, ResidentPagedPoolBytes),
  271. (DWORD)(ULONG_PTR)&((PMEMORY_COUNTER_DATA)0)->ResidentPagedPoolBytes
  272. },
  273. { sizeof(PERF_COUNTER_DEFINITION),
  274. 68,
  275. 0,
  276. 69,
  277. 0,
  278. -5,
  279. PERF_DETAIL_ADVANCED,
  280. PERF_COUNTER_LARGE_RAWCOUNT,
  281. RTL_FIELD_SIZE(MEMORY_COUNTER_DATA, TotalSysCodeBytes),
  282. (DWORD)(ULONG_PTR)&((PMEMORY_COUNTER_DATA)0)->TotalSysCodeBytes
  283. },
  284. { sizeof(PERF_COUNTER_DEFINITION),
  285. 70,
  286. 0,
  287. 71,
  288. 0,
  289. -5,
  290. PERF_DETAIL_ADVANCED,
  291. PERF_COUNTER_LARGE_RAWCOUNT,
  292. RTL_FIELD_SIZE(MEMORY_COUNTER_DATA, ResidentSysCodeBytes),
  293. (DWORD)(ULONG_PTR)&((PMEMORY_COUNTER_DATA)0)->ResidentSysCodeBytes
  294. },
  295. { sizeof(PERF_COUNTER_DEFINITION),
  296. 72,
  297. 0,
  298. 73,
  299. 0,
  300. -5,
  301. PERF_DETAIL_ADVANCED,
  302. PERF_COUNTER_LARGE_RAWCOUNT,
  303. RTL_FIELD_SIZE(MEMORY_COUNTER_DATA, TotalSysDriverBytes),
  304. (DWORD)(ULONG_PTR)&((PMEMORY_COUNTER_DATA)0)->TotalSysDriverBytes
  305. },
  306. { sizeof(PERF_COUNTER_DEFINITION),
  307. 74,
  308. 0,
  309. 75,
  310. 0,
  311. -5,
  312. PERF_DETAIL_ADVANCED,
  313. PERF_COUNTER_LARGE_RAWCOUNT,
  314. RTL_FIELD_SIZE(MEMORY_COUNTER_DATA, ResidentSysDriverBytes),
  315. (DWORD)(ULONG_PTR)&((PMEMORY_COUNTER_DATA)0)->ResidentSysDriverBytes
  316. },
  317. { sizeof(PERF_COUNTER_DEFINITION),
  318. 76,
  319. 0,
  320. 77,
  321. 0,
  322. -5,
  323. PERF_DETAIL_ADVANCED,
  324. PERF_COUNTER_LARGE_RAWCOUNT,
  325. RTL_FIELD_SIZE(MEMORY_COUNTER_DATA, ResidentSysCacheBytes),
  326. (DWORD)(ULONG_PTR)&((PMEMORY_COUNTER_DATA)0)->ResidentSysCacheBytes
  327. },
  328. { sizeof(PERF_COUNTER_DEFINITION),
  329. 1406,
  330. 0,
  331. 1407,
  332. 0,
  333. 0,
  334. PERF_DETAIL_EXPERT,
  335. PERF_RAW_FRACTION,
  336. RTL_FIELD_SIZE(MEMORY_COUNTER_DATA, CommitBytesInUse),
  337. (DWORD)(ULONG_PTR)&((PMEMORY_COUNTER_DATA)0)->CommitBytesInUse
  338. },
  339. { sizeof(PERF_COUNTER_DEFINITION),
  340. 1406,
  341. 0,
  342. 1407,
  343. 0,
  344. 0,
  345. PERF_DETAIL_EXPERT,
  346. PERF_RAW_BASE,
  347. RTL_FIELD_SIZE(MEMORY_COUNTER_DATA, CommitBytesLimit),
  348. (DWORD)(ULONG_PTR)&((PMEMORY_COUNTER_DATA)0)->CommitBytesLimit
  349. },
  350. { sizeof(PERF_COUNTER_DEFINITION),
  351. 1380,
  352. 0,
  353. 1381,
  354. 0,
  355. 0,
  356. PERF_DETAIL_EXPERT,
  357. PERF_COUNTER_LARGE_RAWCOUNT,
  358. RTL_FIELD_SIZE(MEMORY_COUNTER_DATA, AvailableKBytes),
  359. (DWORD)(ULONG_PTR)&((PMEMORY_COUNTER_DATA)0)->AvailableKBytes
  360. },
  361. { sizeof(PERF_COUNTER_DEFINITION),
  362. 1382,
  363. 0,
  364. 1383,
  365. 0,
  366. 0,
  367. PERF_DETAIL_EXPERT,
  368. PERF_COUNTER_LARGE_RAWCOUNT,
  369. RTL_FIELD_SIZE(MEMORY_COUNTER_DATA, AvailableMBytes),
  370. (DWORD)(ULONG_PTR)&((PMEMORY_COUNTER_DATA)0)->AvailableMBytes
  371. },
  372. { sizeof(PERF_COUNTER_DEFINITION),
  373. 824,
  374. 0,
  375. 825,
  376. 0,
  377. -1,
  378. PERF_DETAIL_WIZARD,
  379. PERF_COUNTER_COUNTER,
  380. RTL_FIELD_SIZE(MEMORY_COUNTER_DATA, TransitionRePurpose),
  381. (DWORD)(ULONG_PTR)&((PMEMORY_COUNTER_DATA)0)->TransitionRePurpose
  382. #if 0 // these are no longer supported
  383. },
  384. { sizeof(PERF_COUNTER_DEFINITION),
  385. 1374,
  386. 0,
  387. 1375,
  388. 0,
  389. 0,
  390. PERF_DETAIL_EXPERT,
  391. PERF_COUNTER_LARGE_RAWCOUNT,
  392. RTL_FIELD_SIZE(MEMORY_COUNTER_DATA, SystemVlmCommitCharge),
  393. (DWORD)(ULONG_PTR)&((PMEMORY_COUNTER_DATA)0)->SystemVlmCommitCharge
  394. },
  395. { sizeof(PERF_COUNTER_DEFINITION),
  396. 1376,
  397. 0,
  398. 1377,
  399. 0,
  400. 0,
  401. PERF_DETAIL_EXPERT,
  402. PERF_COUNTER_LARGE_RAWCOUNT,
  403. RTL_FIELD_SIZE(MEMORY_COUNTER_DATA, SystemVlmPeakCommitCharge),
  404. (DWORD)(ULONG_PTR)&((PMEMORY_COUNTER_DATA)0)->SystemVlmPeakCommitCharge
  405. },
  406. { sizeof(PERF_COUNTER_DEFINITION),
  407. 1378,
  408. 0,
  409. 1379,
  410. 0,
  411. 0,
  412. PERF_DETAIL_EXPERT,
  413. PERF_COUNTER_LARGE_RAWCOUNT,
  414. RTL_FIELD_SIZE(MEMORY_COUNTER_DATA, SystemVlmSharedCommitCharge),
  415. (DWORD)(ULONG_PTR)&((PMEMORY_COUNTER_DATA)0)->SystemVlmSharedCommitCharge
  416. #endif
  417. }
  418. };