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.

400 lines
9.3 KiB

  1. /*++
  2. Copyright (c) 1996 Microsoft Corporation
  3. Module Name:
  4. dataphys.c
  5. Abstract:
  6. a file containing the constant data structures used by the Performance
  7. Monitor data for the Physical Disk 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 "dataphys.h"
  21. // dummy variable for field sizing.
  22. static PDISK_COUNTER_DATA pcd;
  23. //
  24. // Constant structure initializations
  25. // defined in dataphys.h
  26. //
  27. PDISK_DATA_DEFINITION PhysicalDiskDataDefinition = {
  28. { 0,
  29. sizeof(PDISK_DATA_DEFINITION),
  30. sizeof(PERF_OBJECT_TYPE),
  31. PHYSICAL_DISK_OBJECT_TITLE_INDEX,
  32. 0,
  33. 235,
  34. 0,
  35. PERF_DETAIL_NOVICE,
  36. (sizeof(PDISK_DATA_DEFINITION)-sizeof(PERF_OBJECT_TYPE))/
  37. sizeof(PERF_COUNTER_DEFINITION),
  38. 2,
  39. 0,
  40. UNICODE_CODE_PAGE,
  41. {0L,0L},
  42. {0L,0L}
  43. },
  44. { sizeof(PERF_COUNTER_DEFINITION),
  45. 198,
  46. 0,
  47. 199,
  48. 0,
  49. 1,
  50. PERF_DETAIL_NOVICE,
  51. PERF_COUNTER_RAWCOUNT,
  52. sizeof (pcd.DiskCurrentQueueLength),
  53. (DWORD)(ULONG_PTR)&((PPDISK_COUNTER_DATA)0)->DiskCurrentQueueLength
  54. },
  55. { sizeof(PERF_COUNTER_DEFINITION),
  56. 200,
  57. 0,
  58. 201,
  59. 0,
  60. 0,
  61. PERF_DETAIL_NOVICE,
  62. PERF_PRECISION_100NS_TIMER,
  63. sizeof (pcd.DiskTime),
  64. (DWORD)(ULONG_PTR)&((PPDISK_COUNTER_DATA)0)->DiskTime
  65. },
  66. { sizeof(PERF_COUNTER_DEFINITION),
  67. 200,
  68. 0,
  69. 201,
  70. 0,
  71. 0,
  72. PERF_DETAIL_NOVICE,
  73. PERF_PRECISION_TIMESTAMP,
  74. sizeof (pcd.DiskTimeTimeStamp),
  75. (DWORD)(ULONG_PTR)&((PPDISK_COUNTER_DATA)0)->DiskTimeTimeStamp
  76. },
  77. { sizeof(PERF_COUNTER_DEFINITION),
  78. 1400,
  79. 0,
  80. 1401,
  81. 0,
  82. 2,
  83. PERF_DETAIL_NOVICE,
  84. PERF_COUNTER_100NS_QUEUELEN_TYPE,
  85. sizeof (pcd.DiskAvgQueueLength),
  86. (DWORD)(ULONG_PTR)&((PPDISK_COUNTER_DATA)0)->DiskAvgQueueLength
  87. },
  88. { sizeof(PERF_COUNTER_DEFINITION),
  89. 202,
  90. 0,
  91. 203,
  92. 0,
  93. 0,
  94. PERF_DETAIL_NOVICE,
  95. PERF_PRECISION_100NS_TIMER,
  96. sizeof (pcd.DiskReadTime),
  97. (DWORD)(ULONG_PTR)&((PPDISK_COUNTER_DATA)0)->DiskReadTime
  98. },
  99. { sizeof(PERF_COUNTER_DEFINITION),
  100. 202,
  101. 0,
  102. 203,
  103. 0,
  104. 0,
  105. PERF_DETAIL_NOVICE,
  106. PERF_PRECISION_TIMESTAMP,
  107. sizeof (pcd.DiskTimeTimeStamp),
  108. (DWORD)(ULONG_PTR)&((PPDISK_COUNTER_DATA)0)->DiskTimeTimeStamp
  109. },
  110. { sizeof(PERF_COUNTER_DEFINITION),
  111. 1402,
  112. 0,
  113. 1403,
  114. 0,
  115. 2,
  116. PERF_DETAIL_NOVICE,
  117. PERF_COUNTER_100NS_QUEUELEN_TYPE,
  118. sizeof (pcd.DiskReadQueueLength),
  119. (DWORD)(ULONG_PTR)&((PPDISK_COUNTER_DATA)0)->DiskReadQueueLength
  120. },
  121. { sizeof(PERF_COUNTER_DEFINITION),
  122. 204,
  123. 0,
  124. 205,
  125. 0,
  126. 0,
  127. PERF_DETAIL_NOVICE,
  128. PERF_PRECISION_100NS_TIMER,
  129. sizeof (pcd.DiskWriteTime),
  130. (DWORD)(ULONG_PTR)&((PPDISK_COUNTER_DATA)0)->DiskWriteTime
  131. },
  132. { sizeof(PERF_COUNTER_DEFINITION),
  133. 204,
  134. 0,
  135. 205,
  136. 0,
  137. 0,
  138. PERF_DETAIL_NOVICE,
  139. PERF_PRECISION_TIMESTAMP,
  140. sizeof (pcd.DiskTimeTimeStamp),
  141. (DWORD)(ULONG_PTR)&((PPDISK_COUNTER_DATA)0)->DiskTimeTimeStamp
  142. },
  143. { sizeof(PERF_COUNTER_DEFINITION),
  144. 1404,
  145. 0,
  146. 1405,
  147. 0,
  148. 2,
  149. PERF_DETAIL_NOVICE,
  150. PERF_COUNTER_100NS_QUEUELEN_TYPE,
  151. sizeof (pcd.DiskWriteQueueLength),
  152. (DWORD)(ULONG_PTR)&((PPDISK_COUNTER_DATA)0)->DiskWriteQueueLength
  153. },
  154. { sizeof(PERF_COUNTER_DEFINITION),
  155. 206,
  156. 0,
  157. 207,
  158. 0,
  159. 3,
  160. PERF_DETAIL_ADVANCED,
  161. PERF_AVERAGE_TIMER,
  162. sizeof (pcd.DiskAvgTime),
  163. (DWORD)(ULONG_PTR)&((PPDISK_COUNTER_DATA)0)->DiskAvgTime
  164. },
  165. { sizeof(PERF_COUNTER_DEFINITION),
  166. 206,
  167. 0,
  168. 207,
  169. 0,
  170. 0,
  171. PERF_DETAIL_ADVANCED,
  172. PERF_AVERAGE_BASE,
  173. sizeof (pcd.DiskTransfersBase1),
  174. (DWORD)(ULONG_PTR)&((PPDISK_COUNTER_DATA)0)->DiskTransfersBase1
  175. },
  176. { sizeof(PERF_COUNTER_DEFINITION),
  177. 208,
  178. 0,
  179. 209,
  180. 0,
  181. 3,
  182. PERF_DETAIL_ADVANCED,
  183. PERF_AVERAGE_TIMER,
  184. sizeof (pcd.DiskAvgReadTime),
  185. (DWORD)(ULONG_PTR)&((PPDISK_COUNTER_DATA)0)->DiskAvgReadTime
  186. },
  187. { sizeof(PERF_COUNTER_DEFINITION),
  188. 208,
  189. 0,
  190. 209,
  191. 0,
  192. 0,
  193. PERF_DETAIL_ADVANCED,
  194. PERF_AVERAGE_BASE,
  195. sizeof (pcd.DiskReadsBase1),
  196. (DWORD)(ULONG_PTR)&((PPDISK_COUNTER_DATA)0)->DiskReadsBase1
  197. },
  198. { sizeof(PERF_COUNTER_DEFINITION),
  199. 210,
  200. 0,
  201. 211,
  202. 0,
  203. 3,
  204. PERF_DETAIL_ADVANCED,
  205. PERF_AVERAGE_TIMER,
  206. sizeof (pcd.DiskAvgWriteTime),
  207. (DWORD)(ULONG_PTR)&((PPDISK_COUNTER_DATA)0)->DiskAvgWriteTime
  208. },
  209. { sizeof(PERF_COUNTER_DEFINITION),
  210. 210,
  211. 0,
  212. 211,
  213. 0,
  214. 0,
  215. PERF_DETAIL_ADVANCED,
  216. PERF_AVERAGE_BASE,
  217. sizeof (pcd.DiskWritesBase1),
  218. (DWORD)(ULONG_PTR)&((PPDISK_COUNTER_DATA)0)->DiskWritesBase1
  219. },
  220. { sizeof(PERF_COUNTER_DEFINITION),
  221. 212,
  222. 0,
  223. 213,
  224. 0,
  225. 0,
  226. PERF_DETAIL_NOVICE,
  227. PERF_COUNTER_COUNTER,
  228. sizeof (pcd.DiskTransfers),
  229. (DWORD)(ULONG_PTR)&((PPDISK_COUNTER_DATA)0)->DiskTransfers
  230. },
  231. { sizeof(PERF_COUNTER_DEFINITION),
  232. 214,
  233. 0,
  234. 215,
  235. 0,
  236. 0,
  237. PERF_DETAIL_NOVICE,
  238. PERF_COUNTER_COUNTER,
  239. sizeof (pcd.DiskReads),
  240. (DWORD)(ULONG_PTR)&((PPDISK_COUNTER_DATA)0)->DiskReads
  241. },
  242. { sizeof(PERF_COUNTER_DEFINITION),
  243. 216,
  244. 0,
  245. 217,
  246. 0,
  247. 0,
  248. PERF_DETAIL_NOVICE,
  249. PERF_COUNTER_COUNTER,
  250. sizeof (pcd.DiskWrites),
  251. (DWORD)(ULONG_PTR)&((PPDISK_COUNTER_DATA)0)->DiskWrites
  252. },
  253. { sizeof(PERF_COUNTER_DEFINITION),
  254. 218,
  255. 0,
  256. 219,
  257. 0,
  258. -4,
  259. PERF_DETAIL_ADVANCED,
  260. PERF_COUNTER_BULK_COUNT,
  261. sizeof (pcd.DiskBytes),
  262. (DWORD)(ULONG_PTR)&((PPDISK_COUNTER_DATA)0)->DiskBytes
  263. },
  264. { sizeof(PERF_COUNTER_DEFINITION),
  265. 220,
  266. 0,
  267. 221,
  268. 0,
  269. -4,
  270. PERF_DETAIL_ADVANCED,
  271. PERF_COUNTER_BULK_COUNT,
  272. sizeof (pcd.DiskReadBytes),
  273. (DWORD)(ULONG_PTR)&((PPDISK_COUNTER_DATA)0)->DiskReadBytes
  274. },
  275. { sizeof(PERF_COUNTER_DEFINITION),
  276. 222,
  277. 0,
  278. 223,
  279. 0,
  280. -4,
  281. PERF_DETAIL_ADVANCED,
  282. PERF_COUNTER_BULK_COUNT,
  283. sizeof (pcd.DiskWriteBytes),
  284. (DWORD)(ULONG_PTR)&((PPDISK_COUNTER_DATA)0)->DiskWriteBytes
  285. },
  286. { sizeof(PERF_COUNTER_DEFINITION),
  287. 224,
  288. 0,
  289. 225,
  290. 0,
  291. -2,
  292. PERF_DETAIL_EXPERT,
  293. PERF_AVERAGE_BULK,
  294. sizeof (pcd.DiskAvgBytes),
  295. (DWORD)(ULONG_PTR)&((PPDISK_COUNTER_DATA)0)->DiskAvgBytes
  296. },
  297. { sizeof(PERF_COUNTER_DEFINITION),
  298. 224,
  299. 0,
  300. 225,
  301. 0,
  302. 0,
  303. PERF_DETAIL_EXPERT,
  304. PERF_AVERAGE_BASE,
  305. sizeof (pcd.DiskTransfersBase2),
  306. (DWORD)(ULONG_PTR)&((PPDISK_COUNTER_DATA)0)->DiskTransfersBase2
  307. },
  308. { sizeof(PERF_COUNTER_DEFINITION),
  309. 226,
  310. 0,
  311. 227,
  312. 0,
  313. -2,
  314. PERF_DETAIL_EXPERT,
  315. PERF_AVERAGE_BULK,
  316. sizeof (pcd.DiskAvgReadBytes),
  317. (DWORD)(ULONG_PTR)&((PPDISK_COUNTER_DATA)0)->DiskAvgReadBytes
  318. },
  319. { sizeof(PERF_COUNTER_DEFINITION),
  320. 226,
  321. 0,
  322. 227,
  323. 0,
  324. 0,
  325. PERF_DETAIL_EXPERT,
  326. PERF_AVERAGE_BASE,
  327. sizeof (pcd.DiskReadsBase2),
  328. (DWORD)(ULONG_PTR)&((PPDISK_COUNTER_DATA)0)->DiskReadsBase2
  329. },
  330. { sizeof(PERF_COUNTER_DEFINITION),
  331. 228,
  332. 0,
  333. 229,
  334. 0,
  335. -2,
  336. PERF_DETAIL_EXPERT,
  337. PERF_AVERAGE_BULK,
  338. sizeof (pcd.DiskAvgWriteBytes),
  339. (DWORD)(ULONG_PTR)&((PPDISK_COUNTER_DATA)0)->DiskAvgWriteBytes
  340. },
  341. { sizeof(PERF_COUNTER_DEFINITION),
  342. 228,
  343. 0,
  344. 229,
  345. 0,
  346. 0,
  347. PERF_DETAIL_EXPERT,
  348. PERF_AVERAGE_BASE,
  349. sizeof (pcd.DiskWritesBase2),
  350. (DWORD)(ULONG_PTR)&((PPDISK_COUNTER_DATA)0)->DiskWritesBase2
  351. },
  352. { sizeof(PERF_COUNTER_DEFINITION),
  353. 1482,
  354. 0,
  355. 1483,
  356. 0,
  357. 0,
  358. PERF_DETAIL_ADVANCED,
  359. PERF_PRECISION_100NS_TIMER,
  360. sizeof (pcd.IdleTime),
  361. (DWORD)(ULONG_PTR)&((PPDISK_COUNTER_DATA)0)->IdleTime
  362. },
  363. { sizeof(PERF_COUNTER_DEFINITION),
  364. 1482,
  365. 0,
  366. 1483,
  367. 0,
  368. 0,
  369. PERF_DETAIL_NOVICE,
  370. PERF_PRECISION_TIMESTAMP,
  371. sizeof (pcd.DiskTimeTimeStamp),
  372. (DWORD)(ULONG_PTR)&((PPDISK_COUNTER_DATA)0)->DiskTimeTimeStamp
  373. },
  374. { sizeof(PERF_COUNTER_DEFINITION),
  375. 1484,
  376. 0,
  377. 1485,
  378. 0,
  379. 0,
  380. PERF_DETAIL_ADVANCED,
  381. PERF_COUNTER_COUNTER,
  382. sizeof (pcd.SplitCount),
  383. (DWORD)(ULONG_PTR)&((PPDISK_COUNTER_DATA)0)->SplitCount
  384. }
  385. };