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.

136 lines
3.9 KiB

  1. /*++
  2. Copyright (c) 2000 Microsoft Corporation
  3. Module Name:
  4. traceump.h
  5. Abstract:
  6. Private headers for Event Tracing user mode
  7. Author:
  8. 19-Jul-2000 Melur Raghuraman
  9. Revision History:
  10. --*/
  11. #ifndef MEMPHIS
  12. #define MAXSTR 1024
  13. #define BUFFER_SIZE 64*1024
  14. #define MAX_BUFFER_SIZE 10*1024*1024
  15. #define NOTIFY_RETRY_COUNT 10
  16. #define TRACE_VERSION_MAJOR 1
  17. #define TRACE_VERSION_MINOR 0
  18. #define SYSTEM_TRACE_VERSION1 1
  19. #ifdef _WIN64
  20. #define SYSTEM_TRACE_MARKER1 TRACE_HEADER_FLAG | TRACE_HEADER_EVENT_TRACE \
  21. | (TRACE_HEADER_TYPE_SYSTEM64 << 16) | SYSTEM_TRACE_VERSION1
  22. #else
  23. #define SYSTEM_TRACE_MARKER1 TRACE_HEADER_FLAG | TRACE_HEADER_EVENT_TRACE \
  24. | (TRACE_HEADER_TYPE_SYSTEM32 << 16) | SYSTEM_TRACE_VERSION1
  25. #endif
  26. #define LOGFILE_FIELD_OFFSET(field) \
  27. sizeof(WMI_BUFFER_HEADER) + \
  28. sizeof(SYSTEM_TRACE_HEADER) +\
  29. FIELD_OFFSET(TRACE_LOGFILE_HEADER, field)
  30. typedef struct _WMI_LOGGER_CONTEXT {
  31. LARGE_INTEGER StartTime;
  32. HANDLE LogFileHandle;
  33. HANDLE NewFileHandle;
  34. ULONG LoggerId;
  35. ULONG LocalSequence;
  36. HANDLE Semaphore;
  37. HANDLE LoggerThreadId;
  38. HANDLE hThread;
  39. HANDLE LoggerEvent;
  40. NTSTATUS LoggerStatus;
  41. ULONG BuffersAvailable;
  42. ULONG NumberOfProcessors;
  43. ULONG BufferPageSize; // BufferSize rounded to page
  44. LIST_ENTRY FreeList;
  45. LIST_ENTRY FlushList;
  46. PLIST_ENTRY TransitionBuffer;
  47. PWMI_BUFFER_HEADER* ProcessorBuffers; // Per Processor Buffer
  48. UNICODE_STRING LoggerName;
  49. UNICODE_STRING LogFileName;
  50. ULONG CollectionOn;
  51. ULONG NewFileFlag;
  52. ULONG EnableFlags;
  53. ULONG MaximumFileSize;
  54. ULONG LogFileMode;
  55. ULONG LastFlushedBuffer;
  56. LARGE_INTEGER FlushTimer;
  57. LARGE_INTEGER FirstBufferOffset;
  58. LARGE_INTEGER ByteOffset;
  59. LARGE_INTEGER BufferAgeLimit;
  60. ULONG TimerResolution; // Used for backtracking in Rundown code
  61. ULONG UsePerfClock; // Logger Specific PerfClock flags
  62. // the following are attributes available for query
  63. ULONG BufferSize;
  64. ULONG NumberOfBuffers;
  65. ULONG MaximumBuffers;
  66. ULONG MinimumBuffers;
  67. ULONG EventsLost;
  68. ULONG BuffersWritten;
  69. ULONG LogBuffersLost;
  70. ULONG RealTimeBuffersLost;
  71. PULONG SequencePtr;
  72. GUID InstanceGuid;
  73. // logger specific extension to context
  74. PVOID BufferSpace; // Reserved Buffer Space
  75. } WMI_LOGGER_CONTEXT, *PWMI_LOGGER_CONTEXT;
  76. //
  77. // logsup.c
  78. //
  79. PVOID
  80. WmipGetTraceBuffer(
  81. IN PWMI_LOGGER_CONTEXT Logger,
  82. IN PSYSTEM_THREAD_INFORMATION pThread,
  83. IN ULONG GroupType,
  84. IN ULONG RequiredSize
  85. );
  86. //
  87. // tracehw.c
  88. //
  89. ULONG
  90. WmipDumpHardwareConfig(
  91. IN PWMI_LOGGER_CONTEXT LoggerContext
  92. );
  93. ULONG
  94. WmipDumpGuidMaps(
  95. IN PWMI_LOGGER_CONTEXT Logger,
  96. IN PLIST_ENTRY GuidMapListHeadPtr,
  97. IN ULONG StartFlag
  98. );
  99. ULONG
  100. WmipAddGuidHandleToGuidMapList(
  101. IN PLIST_ENTRY GuidMapListHeadPtr,
  102. IN ULONGLONG GuidHandle,
  103. IN LPGUID Guid
  104. );
  105. #endif