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.

119 lines
2.9 KiB

  1. //+---------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1992 - 1994.
  5. //
  6. // File: perfmnce.hxx
  7. //
  8. // Contents:
  9. //
  10. // Classes:
  11. //
  12. // Functions:
  13. //
  14. // History: 3-06-95 JohannP (Johann Posch) Created
  15. //
  16. //----------------------------------------------------------------------------
  17. #ifdef _PERF_BUILD_
  18. #ifndef _PERFORMANCE_DEFINED_
  19. #define _PERFORMANCE_DEFINED_
  20. typedef struct perfdata
  21. {
  22. WORD wPos;
  23. char szName[32];
  24. LARGE_INTEGER liStart;
  25. LARGE_INTEGER liEnd;
  26. } PerfData;
  27. typedef struct perflist
  28. {
  29. UINT cElements;
  30. PerfData rgPerfData[32];
  31. } PerfRg, *PPerfRg;
  32. extern PerfRg perfrg;
  33. typedef enum
  34. {
  35. DebugTerminal = 1,
  36. Consol = 2,
  37. OleStream,
  38. SzStr,
  39. } PrintDestination;
  40. #undef INTERFACE
  41. #define INTERFACE IPerformance
  42. DECLARE_INTERFACE_(IPerformance, IUnknown)
  43. {
  44. // *** IUnknown methods ***
  45. STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR* ppvObj) PURE;
  46. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  47. STDMETHOD_(ULONG,Release) (THIS) PURE;
  48. // *** IPerformance methods ***
  49. STDMETHOD (Init) (THIS_ ) PURE;
  50. STDMETHOD (Print) (THIS_ DWORD PrntDest) PURE;
  51. STDMETHOD (Reset) (THIS_ ) PURE;
  52. };
  53. typedef IPerformance FAR* LPPerformance, *PPerformance;
  54. #define _Perf_LoadLibraryOle 0
  55. #define _Perf_OleInitialize 1
  56. #define _Perf_CoInitialize 2
  57. #define _Perf_ChannelProcessInit 3
  58. #define _Perf_ChannelThreadInit 4
  59. #define _Perf_CreateFileMap 5
  60. #define _Perf_CreateFileMapConvert 6
  61. #define _Perf_CheckAndStartScm 7
  62. #define _Perf_EndScm 8
  63. #define _Perf_ISLClassCacheList 9
  64. #define _Perf_ISLCreateAllocator 10
  65. #define _Perf_ISLInProcList 11
  66. #define _Perf_ISLLocSrvList 12
  67. #define _Perf_ISLScmRot 13
  68. #define _Perf_InitClassCache 14
  69. #define _Perf_InitRot 15
  70. #define _Perf_InitSharedLists 16
  71. #define _Perf_MDFDllMain 17
  72. #define _Perf_ServiceListen 18
  73. #define _Perf_ShrdTbl 19
  74. #define _Perf_StartScm 20
  75. #define _Perf_StartScmX1 21
  76. #define _Perf_StartScmX2 22
  77. #define _Perf_StartScmX3 23
  78. #define _Perf_ThreadInit 24
  79. #define _Perf_CoUnitialzie 25
  80. #define _Perf_DllMain 26
  81. #define _Perf_RpcService 27
  82. #define _Perf_RpcListen 28
  83. #define _Perf_RpcReqProtseq 29
  84. #define _Perf_ChannelControl 30
  85. #define _Perf_27 31
  86. #define StartPerfCounter(x) \
  87. QueryPerformanceCounter(&perfrg.rgPerfData[_Perf_##x].liStart);
  88. #define EndPerfCounter(x) \
  89. QueryPerformanceCounter(&perfrg.rgPerfData[_Perf_##x].liEnd);
  90. STDAPI CoGetPerformance(PPerformance *ppPerformance);
  91. #endif // _PERFORMANCE_DEFINED_
  92. #else // !_PERF_BUILD_
  93. #define StartPerfCounter(x)
  94. #define EndPerfCounter(x)
  95. #define CoGetPerformance(x )
  96. #endif // !_PERF_BUILD_