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.

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