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.

814 lines
17 KiB

  1. /*++
  2. Copyright (c) 1995 Microsoft Corporation
  3. Module Name:
  4. cpdata.h
  5. Abstract:
  6. cp data internal data structures
  7. Author:
  8. 08-Apr-1998 mraghu
  9. Revision History:
  10. --*/
  11. #ifndef __CPDATA__
  12. #define __CPDATA__
  13. #include <stdlib.h>
  14. #include <stdio.h>
  15. #include <nt.h>
  16. #pragma warning (disable:4306)
  17. #include <ntrtl.h>
  18. #include <nturtl.h>
  19. #pragma warning (default:4306)
  20. #include <windows.h>
  21. #include <shellapi.h>
  22. #include <tchar.h>
  23. #include <wmistr.h>
  24. #include <wtypes.h>
  25. #pragma warning (disable:4201)
  26. #include <wmistr.h>
  27. #include <tchar.h>
  28. #include <objbase.h>
  29. #include <initguid.h>
  30. #include <wmium.h>
  31. #include <ntwmi.h>
  32. #include <wmiumkm.h>
  33. #include <wmiguid.h>
  34. #include <evntrace.h>
  35. #pragma warning (default:4201)
  36. #include "list.h"
  37. #include "workload.h"
  38. #define MAX_FILE_TABLE_SIZE 64 // Must match ntos\wmi\callout.c
  39. #define MAX_TRANS_LEVEL 32
  40. #ifndef IsEqualGUID
  41. #define IsEqualGUID(guid1, guid2) \
  42. (!memcmp((guid1), (guid2), sizeof(GUID)))
  43. #endif
  44. #define THREAD_HASH_TABLESIZE 29
  45. #define MAXSTR 1024
  46. #define CHECK_HR(hr) if( ERROR_SUCCESS != hr ){ goto cleanup; }
  47. typedef struct _TRACE_CONTEXT_BLOCK {
  48. PEVENT_TRACE_PROPERTIES LoggerInfo;
  49. ULONG LogFileCount;
  50. ULONG LoggerCount;
  51. LPWSTR LogFileName[MAXLOGGERS];
  52. LPWSTR LoggerName[MAXLOGGERS];
  53. LPCSTR PdhFileName; // ANSI ??
  54. LPWSTR ProcFileName;
  55. LPWSTR DumpFileName;
  56. LPWSTR MofFileName;
  57. LPWSTR MergeFileName;
  58. LPWSTR SummaryFileName;
  59. LPWSTR CompFileName;
  60. HANDLE hEvent;
  61. FILE* hDumpFile;
  62. ULONGLONG StartTime; // If Sequential, start, End Times to window.
  63. ULONGLONG EndTime; //
  64. ULONG Flags;
  65. BOOLEAN LoggerStartedHere;
  66. HANDLE hThreadVector;
  67. TRACEHANDLE HandleArray[MAXLOGGERS];
  68. PVOID pUserContext;
  69. } TRACE_CONTEXT_BLOCK, *PTRACE_CONTEXT_BLOCK;
  70. typedef struct _HPF_FILE_RECORD
  71. {
  72. LIST_ENTRY Entry;
  73. ULONG RecordID;
  74. ULONG IrpFlags;
  75. ULONG DiskNumber;
  76. ULONG BytesCount;
  77. ULONGLONG ByteOffset;
  78. PVOID fDO;
  79. } HPF_FILE_RECORD, *PHPF_FILE_RECORD;
  80. typedef struct _HPF_RECORD
  81. {
  82. LIST_ENTRY Entry;
  83. ULONG RecordID;
  84. ULONG lProgramCounter;
  85. ULONG lFaultAddress;
  86. PVOID fDO;
  87. LONG lByteCount;
  88. LONGLONG lByteOffset;
  89. LIST_ENTRY HPFReadListHead;
  90. } HPF_RECORD, *PHPF_RECORD;
  91. typedef struct _TDISK_RECORD
  92. {
  93. LIST_ENTRY Entry;
  94. ULONG DiskNumber;
  95. LPWSTR DiskName;
  96. ULONG ReadCount;
  97. ULONG WriteCount;
  98. ULONG ReadSize;
  99. ULONG WriteSize;
  100. ULONG HPF;
  101. ULONG HPFSize;
  102. LIST_ENTRY FileListHead;
  103. LIST_ENTRY ProcessListHead;
  104. } TDISK_RECORD, *PTDISK_RECORD;
  105. typedef struct _FILE_RECORD
  106. {
  107. LIST_ENTRY Entry;
  108. LIST_ENTRY ProtoProcessListHead; // List of Processes touching this file.
  109. PWCHAR FileName;
  110. ULONG DiskNumber;
  111. ULONG ReadCount;
  112. ULONG HPF;
  113. ULONG WriteCount;
  114. ULONG ReadSize;
  115. ULONG WriteSize;
  116. ULONG HPFSize;
  117. } FILE_RECORD, *PFILE_RECORD;
  118. typedef struct _FILE_OBJECT
  119. {
  120. PVOID fDO;
  121. PFILE_RECORD fileRec;
  122. LIST_ENTRY ProtoFileRecordListHead;
  123. }FILE_OBJECT, *PFILE_OBJECT;
  124. typedef struct _PROTO_FILE_RECORD
  125. {
  126. LIST_ENTRY Entry;
  127. BOOLEAN ReadFlag;
  128. ULONG DiskNumber;
  129. ULONG IoSize;
  130. } PROTO_FILE_RECORD, *PPROTO_FILE_RECORD;
  131. typedef struct _TRANS_RECORD
  132. {
  133. LIST_ENTRY Entry;
  134. LIST_ENTRY SubTransListHead;
  135. LPGUID pGuid;
  136. BOOL bStarted;
  137. ULONG UCpu;
  138. ULONG KCpu;
  139. ULONG DeltaReadIO;
  140. ULONG DeltaWriteIO;
  141. ULONG RefCount;
  142. ULONG RefCount1;
  143. } TRANS_RECORD, *PTRANS_RECORD;
  144. typedef struct _PROCESS_RECORD
  145. {
  146. LIST_ENTRY Entry;
  147. LIST_ENTRY ThreadListHead;
  148. LIST_ENTRY DiskListHead;
  149. LIST_ENTRY FileListHead; // All the Files this process touched.
  150. LIST_ENTRY ModuleListHead; // All the modules this process loaded.
  151. LIST_ENTRY HPFListHead;
  152. PWCHAR UserName;
  153. PWCHAR ImageName;
  154. ULONG PID;
  155. ULONG DeadFlag;
  156. ULONG ReadIO;
  157. ULONG WriteIO;
  158. ULONG SendCount;
  159. ULONG RecvCount;
  160. ULONG SendSize;
  161. ULONG RecvSize;
  162. ULONG HPF;
  163. ULONG HPFSize;
  164. ULONG SPF;
  165. ULONG PrivateWSet;
  166. ULONG GlobalWSet;
  167. ULONG ReadIOSize;
  168. ULONG WriteIOSize;
  169. ULONG lDataFaultHF;
  170. ULONG lDataFaultTF;
  171. ULONG lDataFaultDZF;
  172. ULONG lDataFaultCOW;
  173. ULONG lCodeFaultHF;
  174. ULONG lCodeFaultTF;
  175. ULONG lCodeFaultDZF;
  176. ULONG lCodeFaultCOW;
  177. ULONGLONG ResponseTime;
  178. ULONGLONG TxnStartTime;
  179. ULONGLONG TxnEndTime;
  180. } PROCESS_RECORD, *PPROCESS_RECORD;
  181. typedef struct _THREAD_RECORD
  182. {
  183. LIST_ENTRY Entry;
  184. LIST_ENTRY DiskListHead;
  185. LIST_ENTRY TransListHead; // transactions list
  186. LIST_ENTRY HPFReadListHead;
  187. LIST_ENTRY HPFWriteListHead;
  188. WCHAR strSortKey[MAXSTR];
  189. ULONG TID;
  190. PPROCESS_RECORD pProcess;
  191. BOOLEAN fOrphan;
  192. ULONG DeadFlag;
  193. ULONG ProcessorID;
  194. ULONG ClassNumber; // Class to which this thread is assigned.
  195. ULONG ReadIO;
  196. ULONG WriteIO;
  197. ULONG SendCount;
  198. ULONG RecvCount;
  199. ULONG SendSize;
  200. ULONG RecvSize;
  201. ULONG HPF;
  202. ULONG SPF;
  203. ULONG ReadIOSize;
  204. ULONG WriteIOSize;
  205. ULONG HPFSize;
  206. ULONGLONG TimeStart;
  207. ULONGLONG TimeEnd;
  208. ULONG KCPUStart;
  209. ULONG KCPUEnd;
  210. ULONG UCPUStart;
  211. ULONG UCPUEnd;
  212. // The Following fields are used in getting the Delta
  213. // CPU, I/O to charge on a transaction basis.
  214. // The Current Transaction being executed by this thread is
  215. // given by pMofInfo and when the trans is completed the Delta CPU, I/O
  216. // are charged to that transaction.
  217. ULONG DeltaReadIO;
  218. ULONG DeltaWriteIO;
  219. ULONG DeltaSend;
  220. ULONG DeltaRecv;
  221. ULONG RefCount;
  222. ULONG JobId; // Keeps track of the Current Job this thread is working on
  223. PVOID pMofData; // Keep Track of the Current transaction Guid
  224. ULONG KCPU_Trans;
  225. ULONG UCPU_Trans;
  226. ULONG KCPU_NoTrans;
  227. ULONG UCPU_NoTrans;
  228. ULONG KCPU_PrevTrans;
  229. ULONG UCPU_PrevTrans;
  230. LONG TransLevel;
  231. ULONG KCPU_PrevEvent;
  232. ULONG UCPU_PrevEvent;
  233. ULONGLONG Time_PrevEvent;
  234. PTRANS_RECORD TransStack[MAX_TRANS_LEVEL];
  235. }THREAD_RECORD, *PTHREAD_RECORD;
  236. typedef struct _MODULE_RECORD MODULE_RECORD, *PMODULE_RECORD;
  237. struct _MODULE_RECORD
  238. {
  239. LIST_ENTRY Entry;
  240. PPROCESS_RECORD pProcess;
  241. ULONG lBaseAddress;
  242. ULONG lModuleSize;
  243. ULONG lDataFaultHF;
  244. ULONG lDataFaultTF;
  245. ULONG lDataFaultDZF;
  246. ULONG lDataFaultCOW;
  247. ULONG lCodeFaultHF;
  248. ULONG lCodeFaultTF;
  249. ULONG lCodeFaultDZF;
  250. ULONG lCodeFaultCOW;
  251. WCHAR * strModuleName;
  252. PMODULE_RECORD pGlobalPtr;
  253. };
  254. typedef struct _SYSTEM_RECORD {
  255. ULONGLONG StartTime;
  256. ULONGLONG EndTime;
  257. FILE* TempFile;
  258. BOOLEAN fNoEndTime;
  259. ULONG CurrentThread0;
  260. ULONG ElapseTime;
  261. ULONG TimerResolution;
  262. ULONG NumberOfEvents;
  263. ULONG NumberOfProcessors;
  264. ULONG NumberOfWorkloads;
  265. ULONG BuildNumber;
  266. PFILE_OBJECT *FileTable;
  267. PLIST_ENTRY ThreadHashList;
  268. LIST_ENTRY ProcessListHead;
  269. LIST_ENTRY GlobalThreadListHead;
  270. LIST_ENTRY GlobalDiskListHead;
  271. LIST_ENTRY HotFileListHead;
  272. LIST_ENTRY WorkloadListHead;
  273. LIST_ENTRY InstanceListHead;
  274. LIST_ENTRY EventListHead;
  275. LIST_ENTRY GlobalModuleListHead; // Global module list.
  276. LIST_ENTRY ProcessFileListHead;
  277. LIST_ENTRY JobListHead;
  278. HANDLE hLoggerUpEvent;
  279. } SYSTEM_RECORD, *PSYSTEM_RECORD;
  280. typedef struct _PROCESS_FILE_RECORD {
  281. LIST_ENTRY Entry;
  282. ULONGLONG StartTime;
  283. ULONGLONG EndTime;
  284. LPWSTR FileName;
  285. LPWSTR TraceName;
  286. } PROCESS_FILE_RECORD, *PPROCESS_FILE_RECORD;
  287. typedef struct _PROTO_PROCESS_RECORD
  288. {
  289. LIST_ENTRY Entry;
  290. PPROCESS_RECORD ProcessRecord;
  291. ULONG ReadCount;
  292. ULONG WriteCount;
  293. ULONG HPF;
  294. ULONG ReadSize;
  295. ULONG WriteSize;
  296. ULONG HPFSize;
  297. }PROTO_PROCESS_RECORD, *PPROTO_PROCESS_RECORD;
  298. //
  299. // MOF_INFO structure maintains the global information for the GUID.
  300. // For each GUID, the event layouts are maintained by Version, Level and Type.
  301. //
  302. typedef struct _MOF_INFO {
  303. LIST_ENTRY Entry;
  304. LIST_ENTRY DataListHead;
  305. LPWSTR strDescription; // Class Name
  306. LPWSTR strSortField;
  307. ULONG EventCount;
  308. GUID Guid;
  309. LIST_ENTRY VersionHeader;
  310. BOOL bKernelEvent;
  311. } MOF_INFO, *PMOF_INFO;
  312. //
  313. // MOF_VERSION structure ic created one per Version, Level Type combination.
  314. //
  315. typedef struct _MOF_VERSION {
  316. LIST_ENTRY Entry;
  317. LIST_ENTRY ItemHeader; // Maintains the list of ITEM_DESC for this type.
  318. LPWSTR strType;
  319. SHORT Version;
  320. SHORT TypeIndex;
  321. CHAR Level;
  322. ULONG EventCountByType; // Count of Events by this type for this Guid
  323. } MOF_VERSION, *PMOF_VERSION;
  324. typedef struct _MOF_DATA {
  325. LIST_ENTRY Entry;
  326. PWCHAR strSortKey;
  327. ULONG CompleteCount;
  328. LONG InProgressCount;
  329. LONGLONG AverageResponseTime;
  330. LONGLONG TotalResponseTime;
  331. ULONGLONG PrevClockTime;
  332. ULONG MmTf;
  333. ULONG MmDzf;
  334. ULONG MmCow;
  335. ULONG MmGpf;
  336. ULONG UserCPU;
  337. ULONG KernelCPU;
  338. ULONG EventCount;
  339. ULONG ReadCount;
  340. ULONG WriteCount;
  341. ULONG SendCount;
  342. ULONG RecvCount;
  343. LONG MinKCpu;
  344. LONG MaxKCpu;
  345. LONG MinUCpu;
  346. LONG MaxUCpu;
  347. } MOF_DATA, *PMOF_DATA;
  348. // A Job record is one that passses through several threads to complete.
  349. // Jobs are identified by a Job Id, usually created during the Start
  350. // event and recorded as an additional field in the mof data.
  351. // Since there can be any number of jobs in the system over the data
  352. // collection interval, we will flush the completed jobs to a temp file
  353. // and reread it back at the end to print a report.
  354. // Note: Job_record needs to be Guid based. (ie., per type of transaction).
  355. // Currently it is not.
  356. //
  357. #define MAX_THREADS 10 // Upto threads can be working on a Job.
  358. typedef struct _THREAD_DATA {
  359. ULONG ThreadId;
  360. ULONG PrevKCPUTime;
  361. ULONG PrevUCPUTime;
  362. ULONG PrevReadIO;
  363. ULONG PrevWriteIO;
  364. ULONG KCPUTime;
  365. ULONG UCPUTime;
  366. ULONG ReadIO;
  367. ULONG WriteIO;
  368. ULONG Reserved;
  369. } THREAD_DATA, *PTHREAD_DATA;
  370. typedef struct _JOB_RECORD {
  371. LIST_ENTRY Entry;
  372. ULONG JobId;
  373. ULONG KCPUTime;
  374. ULONG UCPUTime;
  375. ULONG ReadIO;
  376. ULONG WriteIO;
  377. ULONG DataType;
  378. ULONG JobSize;
  379. ULONG Pages;
  380. ULONG PagesPerSide;
  381. ULONG ICMMethod;
  382. ULONG GdiJobSize;
  383. ULONGLONG StartTime;
  384. ULONGLONG EndTime;
  385. ULONGLONG ResponseTime;
  386. ULONGLONG PauseTime;
  387. ULONGLONG PauseStartTime;
  388. ULONGLONG PrintJobTime;
  389. SHORT FilesOpened;
  390. SHORT Color;
  391. SHORT XRes;
  392. SHORT YRes;
  393. SHORT Quality;
  394. SHORT Copies;
  395. SHORT TTOption;
  396. ULONG NumberOfThreads; // Total Number of Threads worked on this Job
  397. THREAD_DATA ThreadData[MAX_THREADS];
  398. } JOB_RECORD, *PJOB_RECORD;
  399. //
  400. // Global that holds everything about the current session
  401. //
  402. extern SYSTEM_RECORD CurrentSystem;
  403. extern BOOLEAN fDSOnly;
  404. extern ULONGLONG DSStartTime;
  405. extern ULONGLONG DSEndTime;
  406. extern RTL_CRITICAL_SECTION TLCritSect;
  407. #define EnterTracelibCritSection() RtlEnterCriticalSection(&TLCritSect)
  408. #define LeaveTracelibCritSection() RtlLeaveCriticalSection(&TLCritSect)
  409. //
  410. // Initialization Routines.
  411. //
  412. VOID
  413. InitDiskRecord(
  414. PTDISK_RECORD pDisk,
  415. ULONG DiskNumber
  416. );
  417. VOID
  418. InitMofData(
  419. PMOF_DATA pMofData
  420. );
  421. VOID
  422. InitThreadRecord(
  423. PTHREAD_RECORD pThread
  424. );
  425. VOID
  426. InitTransRecord(
  427. PTRANS_RECORD pThread
  428. );
  429. VOID
  430. InitProcessRecord(
  431. PPROCESS_RECORD pProcess
  432. );
  433. VOID
  434. InitFileRecord(
  435. PFILE_RECORD pFile
  436. );
  437. //
  438. // Add, Delete and Find routines
  439. BOOLEAN
  440. AddModuleRecord(
  441. PMODULE_RECORD * pModule,
  442. ULONG lBaseAddress,
  443. ULONG lModuleSize,
  444. WCHAR * strModuleName
  445. );
  446. BOOLEAN
  447. AddHPFFileRecord(
  448. PHPF_FILE_RECORD * ppHPFFileRecord,
  449. ULONG RecordID,
  450. ULONG IrpFlags,
  451. ULONG DiskNumber,
  452. ULONGLONG ByteOffset,
  453. ULONG BytesCount,
  454. PVOID fDO
  455. );
  456. BOOLEAN
  457. AddHPFRecord(
  458. PHPF_RECORD * ppHPFRRecord,
  459. ULONG lFaultAddress,
  460. PVOID fDO,
  461. LONG ByteCount,
  462. LONGLONG ByteOffset
  463. );
  464. void
  465. DeleteHPFRecord(
  466. PHPF_RECORD pHPFRecord
  467. );
  468. BOOLEAN
  469. AddProcess(
  470. ULONG ProcessId,
  471. PPROCESS_RECORD *Process
  472. );
  473. BOOLEAN
  474. DeleteTrans(
  475. PTRANS_RECORD Trans
  476. );
  477. BOOLEAN
  478. DeleteTransList(
  479. PLIST_ENTRY Head,
  480. ULONG level
  481. );
  482. PTRANS_RECORD
  483. FindTransByList(
  484. PLIST_ENTRY Head,
  485. LPGUID pGuid,
  486. ULONG level
  487. );
  488. PMOF_DATA
  489. FindMofData(
  490. PMOF_INFO pMofInfo,
  491. PWCHAR strSortKey
  492. );
  493. BOOLEAN
  494. DeleteProcess(
  495. PPROCESS_RECORD Process
  496. );
  497. BOOLEAN
  498. AddThread(
  499. ULONG ThreadId,
  500. PEVENT_TRACE pEvent,
  501. PTHREAD_RECORD * Thread
  502. );
  503. BOOLEAN
  504. DeleteThread(
  505. PTHREAD_RECORD Thread
  506. );
  507. BOOLEAN
  508. AddFile(
  509. WCHAR* fileName,
  510. PFILE_RECORD *ReturnedFile
  511. );
  512. BOOLEAN
  513. DeleteFileRecord(
  514. PFILE_RECORD fileRec
  515. );
  516. BOOLEAN
  517. DeleteFileObject(
  518. PFILE_OBJECT fileObj
  519. );
  520. PPROCESS_RECORD
  521. FindProcessById(
  522. ULONG Id,
  523. BOOLEAN CheckAlive
  524. );
  525. PTDISK_RECORD
  526. FindLocalDiskById(
  527. PLIST_ENTRY Head,
  528. ULONG DiskNumber
  529. );
  530. PTDISK_RECORD
  531. FindProcessDiskById(
  532. PPROCESS_RECORD pProcess,
  533. ULONG DiskNumber
  534. );
  535. PFILE_RECORD
  536. FindFileInProcess(
  537. PPROCESS_RECORD pProcess,
  538. WCHAR* Name
  539. );
  540. PPROTO_PROCESS_RECORD
  541. FindProtoProcessRecord(
  542. PFILE_RECORD pFile,
  543. PPROCESS_RECORD pProcess
  544. );
  545. PFILE_RECORD
  546. FindFileRecordByName(
  547. WCHAR* Name
  548. );
  549. PTHREAD_RECORD
  550. FindGlobalThreadById(
  551. ULONG ThreadId,
  552. PEVENT_TRACE pEvent
  553. );
  554. PTDISK_RECORD
  555. FindGlobalDiskById(
  556. ULONG Id
  557. );
  558. PPROCESS_RECORD
  559. FindDiskProcessById(
  560. PTDISK_RECORD Disk,
  561. ULONG Id
  562. );
  563. ULONGLONG CalculateProcessLifeTime(PPROCESS_RECORD pProcess);
  564. ULONG CalculateProcessKCPU(PPROCESS_RECORD pProcess);
  565. ULONG CalculateProcessUCPU(PPROCESS_RECORD pProcess);
  566. VOID
  567. Cleanup();
  568. BOOLEAN
  569. AddDisk(
  570. ULONG DiskNumber,
  571. PTDISK_RECORD *ReturnedDisk
  572. );
  573. BOOLEAN
  574. DeleteDisk(
  575. PTDISK_RECORD Disk
  576. );
  577. ULONG
  578. DeleteJobRecord(
  579. PJOB_RECORD pJob,
  580. ULONG bSave
  581. );
  582. PJOB_RECORD
  583. AddJobRecord(
  584. ULONG JobId
  585. );
  586. PJOB_RECORD
  587. FindJobRecord(
  588. ULONG JobId
  589. );
  590. int EtwRelogEtl(
  591. PTRACE_CONTEXT_BLOCK TraceContext
  592. );
  593. //
  594. // Trace Event Callbacks
  595. //
  596. VOID
  597. ShutdownThreads(); // Shuts down the running threads before finishing
  598. VOID
  599. ShutdownProcesses(); // Shuts down the running processes before finishing
  600. ULONG
  601. GetMofData(
  602. PEVENT_TRACE pEvent,
  603. WCHAR *strName,
  604. PVOID ReturnValue,
  605. ULONG ReturnLength
  606. );
  607. VOID GeneralEventCallback(PEVENT_TRACE pEvent);
  608. VOID DeclareKernelEvents();
  609. VOID
  610. ProcessCallback(
  611. PEVENT_TRACE pEvent
  612. );
  613. VOID
  614. PsStartCallback(
  615. PEVENT_TRACE pEvent
  616. );
  617. VOID
  618. PsEndCallback(
  619. PEVENT_TRACE pEvent
  620. );
  621. VOID
  622. ThreadCallback(
  623. PEVENT_TRACE pEvent
  624. );
  625. VOID
  626. ThStartCallback(
  627. PEVENT_TRACE pEvent
  628. );
  629. VOID
  630. ThEndCallback(
  631. PEVENT_TRACE pEvent
  632. );
  633. VOID
  634. DiskIoCallback(
  635. PEVENT_TRACE pEvent,
  636. PTHREAD_RECORD pThread
  637. );
  638. VOID
  639. IoReadCallback(
  640. PEVENT_TRACE pEvent,
  641. PTHREAD_RECORD pThread
  642. );
  643. VOID
  644. IoWriteCallback(
  645. PEVENT_TRACE pEvent,
  646. PTHREAD_RECORD pThread
  647. );
  648. VOID
  649. HotFileCallback(
  650. PEVENT_TRACE pEvent
  651. );
  652. VOID
  653. LogHeaderCallback(
  654. PEVENT_TRACE pEvent
  655. );
  656. VOID
  657. EventCallback(
  658. PEVENT_TRACE pEvent,
  659. PTHREAD_RECORD pThread
  660. );
  661. VOID AddEvent(
  662. IN PFILE_OBJECT fileObject,
  663. IN ULONG DiskNumber,
  664. IN ULONG IoSize,
  665. IN BOOLEAN ReadFlag);
  666. PFILE_OBJECT FindFileInTable (
  667. IN PVOID fDO
  668. );
  669. //VOID
  670. //ProcessPdh(
  671. // IN LPCSTR LogFileName,
  672. // IN ULONGLONG StartTime,
  673. // IN ULONGLONG EndTime
  674. // );
  675. //
  676. // Workload Classification Routines
  677. //
  678. VOID
  679. Classify();
  680. VOID
  681. Aggregate();
  682. VOID
  683. InitClass();
  684. VOID
  685. AssignClass(
  686. IN PPROCESS_RECORD pProcess,
  687. IN PTHREAD_RECORD pThread
  688. );
  689. ULONG
  690. ProcessRunDown();
  691. PMOF_INFO
  692. GetMofInfoHead(
  693. LPCGUID pGuid
  694. );
  695. void
  696. WriteSummary();
  697. #define IsEmpty( string ) ((BOOL)( (NULL != string) && ( L'\0' != string[0]) ))
  698. #define ASSIGN_STRING( dest, src ) \
  699. if( NULL != src ){ \
  700. dest = (LPWSTR)malloc( (wcslen(src)+1)*sizeof(WCHAR) ); \
  701. if( NULL != dest ){ \
  702. wcscpy( dest, src ); \
  703. } \
  704. } \
  705. #endif // __CPDATA__