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.

544 lines
14 KiB

  1. /*++
  2. Copyright (c) 1996 Microsoft Corporation
  3. Module Name:
  4. datajob.c
  5. Abstract:
  6. a file containing the constant data structures used by the Performance
  7. Monitor data for the Job Performance data objects
  8. Created:
  9. Bob Watson 10-Oct-97
  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 "datajob.h"
  21. // dummy variable for field sizing.
  22. static JOB_COUNTER_DATA jcd;
  23. static JOB_DETAILS_COUNTER_DATA jdd;
  24. //
  25. // Constant structure initializations
  26. // defined in datajob.h
  27. //
  28. JOB_DATA_DEFINITION JobDataDefinition = {
  29. { 0, // depends on number of instances found
  30. sizeof(JOB_DATA_DEFINITION),
  31. sizeof(PERF_OBJECT_TYPE),
  32. JOB_OBJECT_TITLE_INDEX,
  33. 0,
  34. JOB_OBJECT_TITLE_INDEX + 1,
  35. 0,
  36. PERF_DETAIL_ADVANCED,
  37. (sizeof(JOB_DATA_DEFINITION)-sizeof(PERF_OBJECT_TYPE))/
  38. sizeof(PERF_COUNTER_DEFINITION),
  39. 0,
  40. 0,
  41. UNICODE_CODE_PAGE,
  42. {0L,0L},
  43. {10000000L,0L}
  44. },
  45. { sizeof(PERF_COUNTER_DEFINITION),
  46. JOB_FIRST_COUNTER_INDEX + 2,
  47. 0,
  48. JOB_FIRST_COUNTER_INDEX + 3,
  49. 0,
  50. 0,
  51. PERF_DETAIL_ADVANCED,
  52. PERF_100NSEC_TIMER,
  53. sizeof(jcd.CurrentProcessorTime),
  54. (DWORD)(ULONG_PTR)&((PJOB_COUNTER_DATA)0)->CurrentProcessorTime
  55. },
  56. { sizeof(PERF_COUNTER_DEFINITION),
  57. JOB_FIRST_COUNTER_INDEX + 4,
  58. 0,
  59. JOB_FIRST_COUNTER_INDEX + 5,
  60. 0,
  61. 0,
  62. PERF_DETAIL_ADVANCED,
  63. PERF_100NSEC_TIMER,
  64. sizeof(jcd.CurrentUserTime),
  65. (DWORD)(ULONG_PTR)&((PJOB_COUNTER_DATA)0)->CurrentUserTime
  66. },
  67. { sizeof(PERF_COUNTER_DEFINITION),
  68. JOB_FIRST_COUNTER_INDEX + 6,
  69. 0,
  70. JOB_FIRST_COUNTER_INDEX + 7,
  71. 0,
  72. 0,
  73. PERF_DETAIL_ADVANCED,
  74. PERF_100NSEC_TIMER,
  75. sizeof(jcd.CurrentKernelTime),
  76. (DWORD)(ULONG_PTR)&((PJOB_COUNTER_DATA)0)->CurrentKernelTime
  77. },
  78. #ifdef _DATAJOB_INCLUDE_TOTAL_COUNTERS
  79. { sizeof(PERF_COUNTER_DEFINITION),
  80. JOB_FIRST_COUNTER_INDEX + 8,
  81. 0,
  82. JOB_FIRST_COUNTER_INDEX + 9,
  83. 0,
  84. -4,
  85. PERF_DETAIL_ADVANCED,
  86. PERF_COUNTER_LARGE_RAWCOUNT,
  87. sizeof(jcd.TotalProcessorTime),
  88. (DWORD)(ULONG_PTR)&((PJOB_COUNTER_DATA)0)->TotalProcessorTime
  89. },
  90. { sizeof(PERF_COUNTER_DEFINITION),
  91. JOB_FIRST_COUNTER_INDEX + 10,
  92. 0,
  93. JOB_FIRST_COUNTER_INDEX + 11,
  94. 0,
  95. -4,
  96. PERF_DETAIL_ADVANCED,
  97. PERF_COUNTER_LARGE_RAWCOUNT,
  98. sizeof(jcd.TotalUserTime),
  99. (DWORD)(ULONG_PTR)&((PJOB_COUNTER_DATA)0)->TotalUserTime
  100. },
  101. { sizeof(PERF_COUNTER_DEFINITION),
  102. JOB_FIRST_COUNTER_INDEX + 12,
  103. 0,
  104. JOB_FIRST_COUNTER_INDEX + 13,
  105. 0,
  106. -4,
  107. PERF_DETAIL_ADVANCED,
  108. PERF_COUNTER_LARGE_RAWCOUNT,
  109. sizeof(jcd.TotalKernelTime),
  110. (DWORD)(ULONG_PTR)&((PJOB_COUNTER_DATA)0)->TotalKernelTime
  111. },
  112. { sizeof(PERF_COUNTER_DEFINITION),
  113. JOB_FIRST_COUNTER_INDEX + 22,
  114. 0,
  115. JOB_FIRST_COUNTER_INDEX + 23,
  116. 0,
  117. -4,
  118. PERF_DETAIL_ADVANCED,
  119. PERF_COUNTER_LARGE_RAWCOUNT,
  120. sizeof(jcd.CurrentProcessorUsage),
  121. (DWORD)(ULONG_PTR)&((PJOB_COUNTER_DATA)0)->CurrentProcessorUsage
  122. },
  123. { sizeof(PERF_COUNTER_DEFINITION),
  124. JOB_FIRST_COUNTER_INDEX + 24,
  125. 0,
  126. JOB_FIRST_COUNTER_INDEX + 25,
  127. 0,
  128. -4,
  129. PERF_DETAIL_ADVANCED,
  130. PERF_COUNTER_LARGE_RAWCOUNT,
  131. sizeof(jcd.CurrentUserUsage),
  132. (DWORD)(ULONG_PTR)&((PJOB_COUNTER_DATA)0)->CurrentUserUsage
  133. },
  134. { sizeof(PERF_COUNTER_DEFINITION),
  135. JOB_FIRST_COUNTER_INDEX + 26,
  136. 0,
  137. JOB_FIRST_COUNTER_INDEX + 27,
  138. 0,
  139. -4,
  140. PERF_DETAIL_ADVANCED,
  141. PERF_COUNTER_LARGE_RAWCOUNT,
  142. sizeof(jcd.CurrentKernelUsage),
  143. (DWORD)(ULONG_PTR)&((PJOB_COUNTER_DATA)0)->CurrentKernelUsage
  144. },
  145. #endif //_DATAJOB_INCLUDE_TOTAL_COUNTERS
  146. { sizeof(PERF_COUNTER_DEFINITION),
  147. JOB_FIRST_COUNTER_INDEX + 14,
  148. 0,
  149. JOB_FIRST_COUNTER_INDEX + 15,
  150. 0,
  151. 0,
  152. PERF_DETAIL_ADVANCED,
  153. PERF_COUNTER_COUNTER,
  154. sizeof(jcd.PageFaults),
  155. (DWORD)(ULONG_PTR)&((PJOB_COUNTER_DATA)0)->PageFaults
  156. },
  157. { sizeof(PERF_COUNTER_DEFINITION),
  158. JOB_FIRST_COUNTER_INDEX + 16,
  159. 0,
  160. JOB_FIRST_COUNTER_INDEX + 17,
  161. 0,
  162. 0,
  163. PERF_DETAIL_ADVANCED,
  164. PERF_COUNTER_RAWCOUNT,
  165. sizeof(jcd.TotalProcessCount),
  166. (DWORD)(ULONG_PTR)&((PJOB_COUNTER_DATA)0)->TotalProcessCount
  167. },
  168. { sizeof(PERF_COUNTER_DEFINITION),
  169. JOB_FIRST_COUNTER_INDEX + 18,
  170. 0,
  171. JOB_FIRST_COUNTER_INDEX + 19,
  172. 0,
  173. 0,
  174. PERF_DETAIL_ADVANCED,
  175. PERF_COUNTER_RAWCOUNT,
  176. sizeof(jcd.ActiveProcessCount),
  177. (DWORD)(ULONG_PTR)&((PJOB_COUNTER_DATA)0)->ActiveProcessCount
  178. },
  179. { sizeof(PERF_COUNTER_DEFINITION),
  180. JOB_FIRST_COUNTER_INDEX + 20,
  181. 0,
  182. JOB_FIRST_COUNTER_INDEX + 21,
  183. 0,
  184. 0,
  185. PERF_DETAIL_ADVANCED,
  186. PERF_COUNTER_RAWCOUNT,
  187. sizeof(jcd.TerminatedProcessCount),
  188. (DWORD)(ULONG_PTR)&((PJOB_COUNTER_DATA)0)->TerminatedProcessCount
  189. }
  190. };
  191. JOB_DETAILS_DATA_DEFINITION JobDetailsDataDefinition = {
  192. { 0, // depends on number of instanced found
  193. sizeof(JOB_DETAILS_DATA_DEFINITION),
  194. sizeof(PERF_OBJECT_TYPE),
  195. JOB_DETAILS_OBJECT_TITLE_INDEX,
  196. 0,
  197. JOB_DETAILS_OBJECT_TITLE_INDEX + 1,
  198. 0,
  199. PERF_DETAIL_ADVANCED,
  200. (sizeof(JOB_DETAILS_DATA_DEFINITION)-sizeof(PERF_OBJECT_TYPE))/
  201. sizeof(PERF_COUNTER_DEFINITION),
  202. 0,
  203. 0,
  204. UNICODE_CODE_PAGE,
  205. {0L,0L},
  206. {10000000L,0L}
  207. },
  208. { sizeof(PERF_COUNTER_DEFINITION),
  209. 6,
  210. 0,
  211. 189,
  212. 0,
  213. 0,
  214. PERF_DETAIL_ADVANCED,
  215. PERF_100NSEC_TIMER,
  216. sizeof(jdd.ProcessorTime),
  217. (DWORD)(ULONG_PTR)&((PJOB_DETAILS_COUNTER_DATA)0)->ProcessorTime
  218. },
  219. { sizeof(PERF_COUNTER_DEFINITION),
  220. 142,
  221. 0,
  222. 157,
  223. 0,
  224. 0,
  225. PERF_DETAIL_ADVANCED,
  226. PERF_100NSEC_TIMER,
  227. sizeof(jdd.UserTime),
  228. (DWORD)(ULONG_PTR)&((PJOB_DETAILS_COUNTER_DATA)0)->UserTime
  229. },
  230. { sizeof(PERF_COUNTER_DEFINITION),
  231. 144,
  232. 0,
  233. 159,
  234. 0,
  235. 0,
  236. PERF_DETAIL_ADVANCED,
  237. PERF_100NSEC_TIMER,
  238. sizeof(jdd.KernelTime),
  239. (DWORD)(ULONG_PTR)&((PJOB_DETAILS_COUNTER_DATA)0)->KernelTime
  240. },
  241. { sizeof(PERF_COUNTER_DEFINITION),
  242. 172,
  243. 0,
  244. 173,
  245. 0,
  246. -6,
  247. PERF_DETAIL_EXPERT,
  248. PERF_COUNTER_LARGE_RAWCOUNT,
  249. sizeof(jdd.PeakVirtualSize),
  250. (DWORD)(ULONG_PTR)&((PJOB_DETAILS_COUNTER_DATA)0)->PeakVirtualSize
  251. },
  252. { sizeof(PERF_COUNTER_DEFINITION),
  253. 174,
  254. 0,
  255. 175,
  256. 0,
  257. -6,
  258. PERF_DETAIL_EXPERT,
  259. PERF_COUNTER_LARGE_RAWCOUNT,
  260. sizeof(jdd.VirtualSize),
  261. (DWORD)(ULONG_PTR)&((PJOB_DETAILS_COUNTER_DATA)0)->VirtualSize
  262. },
  263. { sizeof(PERF_COUNTER_DEFINITION),
  264. 28,
  265. 0,
  266. 177,
  267. 0,
  268. -1,
  269. PERF_DETAIL_ADVANCED,
  270. PERF_COUNTER_COUNTER,
  271. sizeof(jdd.PageFaults),
  272. (DWORD)(ULONG_PTR)&((PJOB_DETAILS_COUNTER_DATA)0)->PageFaults
  273. },
  274. { sizeof(PERF_COUNTER_DEFINITION),
  275. 178,
  276. 0,
  277. 179,
  278. 0,
  279. -5,
  280. PERF_DETAIL_ADVANCED,
  281. PERF_COUNTER_LARGE_RAWCOUNT,
  282. sizeof(jdd.PeakWorkingSet),
  283. (DWORD)(ULONG_PTR)&((PJOB_DETAILS_COUNTER_DATA)0)->PeakWorkingSet
  284. },
  285. { sizeof(PERF_COUNTER_DEFINITION),
  286. 180,
  287. 0,
  288. 181,
  289. 0,
  290. -5,
  291. PERF_DETAIL_ADVANCED,
  292. PERF_COUNTER_LARGE_RAWCOUNT,
  293. sizeof(jdd.TotalWorkingSet),
  294. (DWORD)(ULONG_PTR)&((PJOB_DETAILS_COUNTER_DATA)0)->TotalWorkingSet
  295. },
  296. #ifdef _DATAPROC_PRIVATE_WS_
  297. { sizeof(PERF_COUNTER_DEFINITION),
  298. 1478,
  299. 0,
  300. 1479,
  301. 0,
  302. -5,
  303. PERF_DETAIL_ADVANCED,
  304. PERF_COUNTER_LARGE_RAWCOUNT,
  305. sizeof(jdd.PrivateWorkingSet),
  306. (DWORD)(ULONG_PTR)&((PJOB_DETAILS_COUNTER_DATA)0)->PrivateWorkingSet
  307. },
  308. { sizeof(PERF_COUNTER_DEFINITION),
  309. 1480,
  310. 0,
  311. 1481,
  312. 0,
  313. -5,
  314. PERF_DETAIL_ADVANCED,
  315. PERF_COUNTER_LARGE_RAWCOUNT,
  316. sizeof(jdd.SharedWorkingSet),
  317. (DWORD)(ULONG_PTR)&((PJOB_DETAILS_COUNTER_DATA)0)->SharedWorkingSet
  318. },
  319. #endif
  320. { sizeof(PERF_COUNTER_DEFINITION),
  321. 182,
  322. 0,
  323. 183,
  324. 0,
  325. -6,
  326. PERF_DETAIL_ADVANCED,
  327. PERF_COUNTER_LARGE_RAWCOUNT,
  328. sizeof(jdd.PeakPageFile),
  329. (DWORD)(ULONG_PTR)&((PJOB_DETAILS_COUNTER_DATA)0)->PeakPageFile
  330. },
  331. { sizeof(PERF_COUNTER_DEFINITION),
  332. 184,
  333. 0,
  334. 185,
  335. 0,
  336. -6,
  337. PERF_DETAIL_ADVANCED,
  338. PERF_COUNTER_LARGE_RAWCOUNT,
  339. sizeof(jdd.PageFile),
  340. (DWORD)(ULONG_PTR)&((PJOB_DETAILS_COUNTER_DATA)0)->PageFile
  341. },
  342. { sizeof(PERF_COUNTER_DEFINITION),
  343. 186,
  344. 0,
  345. 187,
  346. 0,
  347. -5,
  348. PERF_DETAIL_ADVANCED,
  349. PERF_COUNTER_LARGE_RAWCOUNT,
  350. sizeof(jdd.PrivatePages),
  351. (DWORD)(ULONG_PTR)&((PJOB_DETAILS_COUNTER_DATA)0)->PrivatePages
  352. },
  353. { sizeof(PERF_COUNTER_DEFINITION),
  354. 680,
  355. 0,
  356. 681,
  357. 0,
  358. 0,
  359. PERF_DETAIL_ADVANCED,
  360. PERF_COUNTER_RAWCOUNT,
  361. sizeof(jdd.ThreadCount),
  362. (DWORD)(ULONG_PTR)&((PJOB_DETAILS_COUNTER_DATA)0)->ThreadCount
  363. },
  364. { sizeof(PERF_COUNTER_DEFINITION),
  365. 682,
  366. 0,
  367. 683,
  368. 0,
  369. 0,
  370. PERF_DETAIL_ADVANCED,
  371. PERF_COUNTER_RAWCOUNT,
  372. sizeof(jdd.BasePriority),
  373. (DWORD)(ULONG_PTR)&((PJOB_DETAILS_COUNTER_DATA)0)->BasePriority
  374. },
  375. { sizeof(PERF_COUNTER_DEFINITION),
  376. 684,
  377. 0,
  378. 685,
  379. 0,
  380. -4,
  381. PERF_DETAIL_ADVANCED,
  382. PERF_ELAPSED_TIME,
  383. sizeof(jdd.ElapsedTime),
  384. (DWORD)(ULONG_PTR)&((PJOB_DETAILS_COUNTER_DATA)0)->ElapsedTime
  385. },
  386. { sizeof(PERF_COUNTER_DEFINITION),
  387. 784,
  388. 0,
  389. 785,
  390. 0,
  391. -1,
  392. PERF_DETAIL_ADVANCED,
  393. PERF_COUNTER_LARGE_RAWCOUNT,
  394. sizeof(jdd.ProcessId),
  395. (DWORD)(ULONG_PTR)&((PJOB_DETAILS_COUNTER_DATA)0)->ProcessId
  396. },
  397. { sizeof(PERF_COUNTER_DEFINITION),
  398. 1410,
  399. 0,
  400. 1411,
  401. 0,
  402. -1,
  403. PERF_DETAIL_ADVANCED,
  404. PERF_COUNTER_LARGE_RAWCOUNT,
  405. sizeof(jdd.CreatorProcessId),
  406. (DWORD)(ULONG_PTR)&((PJOB_DETAILS_COUNTER_DATA)0)->CreatorProcessId
  407. },
  408. { sizeof(PERF_COUNTER_DEFINITION),
  409. 56,
  410. 0,
  411. 57,
  412. 0,
  413. -5,
  414. PERF_DETAIL_ADVANCED,
  415. PERF_COUNTER_RAWCOUNT,
  416. sizeof(jdd.PagedPool),
  417. (DWORD)(ULONG_PTR)&((PJOB_DETAILS_COUNTER_DATA)0)->PagedPool
  418. },
  419. { sizeof(PERF_COUNTER_DEFINITION),
  420. 58,
  421. 0,
  422. 59,
  423. 0,
  424. -5,
  425. PERF_DETAIL_ADVANCED,
  426. PERF_COUNTER_RAWCOUNT,
  427. sizeof(jdd.NonPagedPool),
  428. (DWORD)(ULONG_PTR)&((PJOB_DETAILS_COUNTER_DATA)0)->NonPagedPool
  429. },
  430. { sizeof(PERF_COUNTER_DEFINITION),
  431. 952,
  432. 0,
  433. 953,
  434. 0,
  435. 0,
  436. PERF_DETAIL_ADVANCED,
  437. PERF_COUNTER_RAWCOUNT,
  438. sizeof(jdd.HandleCount),
  439. (DWORD)(ULONG_PTR)&((PJOB_DETAILS_COUNTER_DATA)0)->HandleCount
  440. },
  441. { sizeof(PERF_COUNTER_DEFINITION),
  442. 1412,
  443. 0,
  444. 1413,
  445. 0,
  446. 0,
  447. PERF_DETAIL_ADVANCED,
  448. PERF_COUNTER_BULK_COUNT,
  449. sizeof(jdd.ReadOperationCount),
  450. (DWORD)(ULONG_PTR)&((PJOB_DETAILS_COUNTER_DATA)0)->ReadOperationCount
  451. },
  452. { sizeof(PERF_COUNTER_DEFINITION),
  453. 1414,
  454. 0,
  455. 1415,
  456. 0,
  457. 0,
  458. PERF_DETAIL_ADVANCED,
  459. PERF_COUNTER_BULK_COUNT,
  460. sizeof(jdd.WriteOperationCount),
  461. (DWORD)(ULONG_PTR)&((PJOB_DETAILS_COUNTER_DATA)0)->WriteOperationCount
  462. },
  463. { sizeof(PERF_COUNTER_DEFINITION),
  464. 1416,
  465. 0,
  466. 1417,
  467. 0,
  468. 0,
  469. PERF_DETAIL_ADVANCED,
  470. PERF_COUNTER_BULK_COUNT,
  471. sizeof(jdd.DataOperationCount),
  472. (DWORD)(ULONG_PTR)&((PJOB_DETAILS_COUNTER_DATA)0)->DataOperationCount
  473. },
  474. { sizeof(PERF_COUNTER_DEFINITION),
  475. 1418,
  476. 0,
  477. 1419,
  478. 0,
  479. 0,
  480. PERF_DETAIL_ADVANCED,
  481. PERF_COUNTER_BULK_COUNT,
  482. sizeof(jdd.OtherOperationCount),
  483. (DWORD)(ULONG_PTR)&((PJOB_DETAILS_COUNTER_DATA)0)->OtherOperationCount
  484. },
  485. { sizeof(PERF_COUNTER_DEFINITION),
  486. 1420,
  487. 0,
  488. 1421,
  489. 0,
  490. 0,
  491. PERF_DETAIL_ADVANCED,
  492. PERF_COUNTER_BULK_COUNT,
  493. sizeof(jdd.ReadTransferCount),
  494. (DWORD)(ULONG_PTR)&((PJOB_DETAILS_COUNTER_DATA)0)->ReadTransferCount
  495. },
  496. { sizeof(PERF_COUNTER_DEFINITION),
  497. 1422,
  498. 0,
  499. 1423,
  500. 0,
  501. 0,
  502. PERF_DETAIL_ADVANCED,
  503. PERF_COUNTER_BULK_COUNT,
  504. sizeof(jdd.WriteTransferCount),
  505. (DWORD)(ULONG_PTR)&((PJOB_DETAILS_COUNTER_DATA)0)->WriteTransferCount
  506. },
  507. { sizeof(PERF_COUNTER_DEFINITION),
  508. 1424,
  509. 0,
  510. 1425,
  511. 0,
  512. 0,
  513. PERF_DETAIL_ADVANCED,
  514. PERF_COUNTER_BULK_COUNT,
  515. sizeof(jdd.DataTransferCount),
  516. (DWORD)(ULONG_PTR)&((PJOB_DETAILS_COUNTER_DATA)0)->DataTransferCount
  517. },
  518. { sizeof(PERF_COUNTER_DEFINITION),
  519. 1426,
  520. 0,
  521. 1427,
  522. 0,
  523. 0,
  524. PERF_DETAIL_ADVANCED,
  525. PERF_COUNTER_BULK_COUNT,
  526. sizeof(jdd.OtherTransferCount),
  527. (DWORD)(ULONG_PTR)&((PJOB_DETAILS_COUNTER_DATA)0)->OtherTransferCount
  528. }
  529. };