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.

131 lines
3.4 KiB

  1. /*++
  2. Copyright (c) 2000-2001 Microsoft Corporation
  3. Module Name:
  4. timetrace.h
  5. Abstract:
  6. This module contains public declarations and definitions for tracing
  7. and debugging the timing of request processing.
  8. Author:
  9. Michael Courage (mcourage) 8-Mar-2000
  10. Revision History:
  11. --*/
  12. #ifndef _TIMETRACE_H_
  13. #define _TIMETRACE_H_
  14. #if defined(__cplusplus)
  15. extern "C" {
  16. #endif // __cplusplus
  17. //
  18. // This defines the entry written to the trace log.
  19. //
  20. typedef struct _TIME_TRACE_LOG_ENTRY
  21. {
  22. ULONGLONG TimeStamp;
  23. HTTP_CONNECTION_ID ConnectionId;
  24. HTTP_REQUEST_ID RequestId;
  25. USHORT Action;
  26. USHORT Processor;
  27. } TIME_TRACE_LOG_ENTRY, *PTIME_TRACE_LOG_ENTRY;
  28. //
  29. // Action codes.
  30. //
  31. // N.B. These codes must be contiguous, starting at zero. If you update
  32. // this list, you must also update the corresponding array in
  33. // ul\ulkd\time.c.
  34. //
  35. #define TIME_ACTION_CREATE_CONNECTION 0
  36. #define TIME_ACTION_CREATE_REQUEST 1
  37. #define TIME_ACTION_ROUTE_REQUEST 2
  38. #define TIME_ACTION_COPY_REQUEST 3
  39. #define TIME_ACTION_SEND_RESPONSE 4
  40. #define TIME_ACTION_SEND_COMPLETE 5
  41. #define TIME_ACTION_COUNT 6
  42. #define TIME_TRACE_LOG_SIGNATURE ((LONG)'gLmT')
  43. //
  44. // Manipulators.
  45. //
  46. PTRACE_LOG
  47. CreateTimeTraceLog(
  48. IN LONG LogSize,
  49. IN LONG ExtraBytesInHeader
  50. );
  51. VOID
  52. DestroyTimeTraceLog(
  53. IN PTRACE_LOG pLog
  54. );
  55. VOID
  56. WriteTimeTraceLog(
  57. IN PTRACE_LOG pLog,
  58. IN HTTP_CONNECTION_ID ConnectionId,
  59. IN HTTP_REQUEST_ID RequestId,
  60. IN USHORT Action
  61. );
  62. #if ENABLE_TIME_TRACE
  63. #define CREATE_TIME_TRACE_LOG( ptr, size, extra ) \
  64. (ptr) = CreateTimeTraceLog( (size), (extra) )
  65. #define DESTROY_TIME_TRACE_LOG( ptr ) \
  66. do \
  67. { \
  68. DestroyTimeTraceLog( ptr ); \
  69. (ptr) = NULL; \
  70. } while (FALSE)
  71. #define WRITE_TIME_TRACE_LOG( plog, cid, rid, act ) \
  72. WriteTimeTraceLog( \
  73. (plog), \
  74. (cid), \
  75. (rid), \
  76. (act) \
  77. )
  78. #else // !ENABLE_TIME_TRACE
  79. #define CREATE_TIME_TRACE_LOG( ptr, size, extra )
  80. #define DESTROY_TIME_TRACE_LOG( ptr )
  81. #define WRITE_TIME_TRACE_LOG( plog, cid, rid, act )
  82. #endif // ENABLE_TIME_TRACE
  83. #define TRACE_TIME( cid, rid, act ) \
  84. WRITE_TIME_TRACE_LOG( \
  85. g_pTimeTraceLog, \
  86. (cid), \
  87. (rid), \
  88. (act) \
  89. )
  90. #if defined(__cplusplus)
  91. } // extern "C"
  92. #endif // __cplusplus
  93. #endif // _TIMETRACE_H_