Leaked source code of windows server 2003
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.

118 lines
2.9 KiB

  1. /*++
  2. Copyright (c) 2001-2002 Microsoft Corporation
  3. Module Name:
  4. uletw.h (UL IIS+ ETW logging)
  5. Abstract:
  6. This module implements the Event Tracer for Windows (ETW)
  7. tracing capability for UL.
  8. Author:
  9. Melur Raghuraman (mraghu) 26-Feb-2001
  10. Revision History:
  11. --*/
  12. #ifndef _ULETW_H_
  13. #define _ULETW_H_
  14. DEFINE_GUID ( /* 3c419e3d-1d18-415b-a91a-9b558938de4b */
  15. UlTransGuid,
  16. 0x3c419e3d,
  17. 0x1d18,
  18. 0x415b,
  19. 0xa9, 0x1a, 0x9b, 0x55, 0x89, 0x38, 0xde, 0x4b
  20. );
  21. DEFINE_GUID( /* dd5ef90a-6398-47a4-ad34-4dcecdef795f */
  22. UlControlGuid,
  23. 0xdd5ef90a,
  24. 0x6398,
  25. 0x47a4,
  26. 0xad, 0x34, 0x4d, 0xce, 0xcd, 0xef, 0x79, 0x5f
  27. );
  28. //
  29. // UL Specific Event Levels are defined here
  30. //
  31. #define ULMAX_TRACE_LEVEL 4
  32. #define ETW_LEVEL_MIN 0 // Basic Logging of cache Miss case
  33. #define ETW_LEVEL_CP 1 // Capacity Planning Resource Tracking
  34. #define ETW_LEVEL_DBG 2 // Performance Analysis or Debug Tracing
  35. #define ETW_LEVEL_MAX 3 // Very Detailed Debugging trace
  36. #define ETW_FLAG_LOG_URL 0x00000001 // Log Url for ULDELIVER event.
  37. //
  38. // UL specific EventTypes are defined here.
  39. //
  40. #define ETW_TYPE_START 0x01 // Request is received
  41. #define ETW_TYPE_END 0x02 // Response is sent
  42. #define ETW_TYPE_ULPARSE_REQ 0x0A // Parse the received Request
  43. #define ETW_TYPE_ULDELIVER 0x0B // Deliver Request to UM
  44. #define ETW_TYPE_ULRECV_RESP 0x0C // Receive Response from UM
  45. #define ETW_TYPE_ULRECV_RESPBODY 0x0D // Receive Entity Body
  46. #define ETW_TYPE_CACHED_END 0x0E // Cached Response
  47. #define ETW_TYPE_CACHE_AND_SEND 0x0F // Cache And Send Response
  48. #define ETW_TYPE_ULRECV_FASTRESP 0x10 // Receive Resp thru fast path
  49. #define ETW_TYPE_FAST_SEND 0x11 // Fast Send
  50. #define ETW_TYPE_ZERO_SEND 0x12 // Last send 0 bytes
  51. #define ETW_TYPE_SEND_ERROR 0x13 // Error sending last response
  52. //
  53. // Globals & Macros
  54. //
  55. extern LONG g_UlEtwTraceEnable;
  56. #define ETW_LOG_MIN() (g_UlEtwTraceEnable >> ETW_LEVEL_MIN)
  57. #define ETW_LOG_RESOURCE() (g_UlEtwTraceEnable >> ETW_LEVEL_CP)
  58. #define ETW_LOG_DEBUG() (g_UlEtwTraceEnable >> ETW_LEVEL_DBG)
  59. #define ETW_LOG_MAX() (g_UlEtwTraceEnable >> ETW_LEVEL_MAX)
  60. #define ETW_LOG_URL() (UlEtwGetTraceEnableFlags() & ETW_FLAG_LOG_URL)
  61. //
  62. // Functions
  63. //
  64. NTSTATUS
  65. UlEtwTraceEvent(
  66. IN LPCGUID pGuid,
  67. IN ULONG EventType,
  68. ...
  69. );
  70. NTSTATUS
  71. UlEtwInitLog(
  72. IN PDEVICE_OBJECT pDeviceObject
  73. );
  74. NTSTATUS
  75. UlEtwUnRegisterLog(
  76. IN PDEVICE_OBJECT pDeviceObject
  77. );
  78. ULONG
  79. UlEtwGetTraceEnableFlags(
  80. VOID
  81. );
  82. #endif // _ULETW_H_