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.

113 lines
3.7 KiB

  1. //+---------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1993 - 1999.
  5. //
  6. // File: perfci.hxx
  7. //
  8. // Contents: Define the Object and Counter structures for performance monitor DLL
  9. // for Content Index
  10. //
  11. // History: 23-March-94 t-joshh Created
  12. //
  13. //----------------------------------------------------------------------------
  14. #pragma once
  15. #include <perfci.h>
  16. #include <perffilt.h>
  17. //
  18. // The offsets of each counter's data. The first DWORD is for the total size
  19. // of the counter data block.
  20. //
  21. #define NUM_WORDLIST_OFF sizeof(DWORD)
  22. #define NUM_PERSISTENT_INDEX_OFF ( NUM_WORDLIST_OFF + sizeof(DWORD) )
  23. #define INDEX_SIZE_OFF ( NUM_PERSISTENT_INDEX_OFF + sizeof(DWORD) )
  24. #define FILES_TO_BE_FILTERED_OFF ( INDEX_SIZE_OFF + sizeof(DWORD) )
  25. #define NUM_UNIQUE_KEY_OFF ( FILES_TO_BE_FILTERED_OFF + sizeof(DWORD) )
  26. #define RUNNING_QUERIES_OFF ( NUM_UNIQUE_KEY_OFF + sizeof(DWORD) )
  27. #define MERGE_PROGRESS_OFF ( RUNNING_QUERIES_OFF + sizeof(DWORD) )
  28. #define DOCUMENTS_FILTERED_OFF ( MERGE_PROGRESS_OFF + sizeof(DWORD) )
  29. #define NUM_DOCUMENTS_OFF ( DOCUMENTS_FILTERED_OFF + sizeof(DWORD) )
  30. #define TOTAL_QUERIES_OFF ( NUM_DOCUMENTS_OFF + sizeof(DWORD) )
  31. #define DEFERRED_FILTER_FILES_OFF ( TOTAL_QUERIES_OFF + sizeof(DWORD) )
  32. #define CI_SIZE_OF_COUNTER_BLOCK ( DEFERRED_FILTER_FILES_OFF + sizeof(DWORD) )
  33. //
  34. // The data definition of Content Index
  35. //
  36. struct CI_DATA_DEFINITION
  37. {
  38. PERF_OBJECT_TYPE CIObjectType;
  39. PERF_COUNTER_DEFINITION Wordlist;
  40. PERF_COUNTER_DEFINITION PersistentIndex;
  41. PERF_COUNTER_DEFINITION IndexSize;
  42. PERF_COUNTER_DEFINITION FilesToBeFiltered;
  43. PERF_COUNTER_DEFINITION UniqueKey;
  44. PERF_COUNTER_DEFINITION RunningQueries;
  45. PERF_COUNTER_DEFINITION MergeProgress;
  46. PERF_COUNTER_DEFINITION DocumentsFiltered;
  47. PERF_COUNTER_DEFINITION NumDocuments;
  48. PERF_COUNTER_DEFINITION TotalQueries;
  49. PERF_COUNTER_DEFINITION DeferredFilterFiles;
  50. };
  51. const unsigned CI_TOTAL_NUM_COUNTERS = ( sizeof CI_DATA_DEFINITION - sizeof PERF_OBJECT_TYPE ) /
  52. sizeof PERF_COUNTER_DEFINITION;
  53. //
  54. // Defines Title and Help Index
  55. //
  56. //
  57. // The offsets of each counter's data. The first DWORD is for the total size of
  58. // the counter data block.
  59. //
  60. #define FILTER_TIME_TOTAL_OFF sizeof(DWORD)
  61. #define BIND_TIME_OFF ( FILTER_TIME_TOTAL_OFF + sizeof(DWORD) )
  62. #define FILTER_TIME_OFF ( BIND_TIME_OFF + sizeof(DWORD) )
  63. #define FILTER_SIZE_OF_COUNTER_BLOCK ( FILTER_TIME_OFF + sizeof(DWORD) )
  64. //
  65. // The data definition of Filtering
  66. //
  67. struct FILTER_DATA_DEFINITION
  68. {
  69. PERF_OBJECT_TYPE FILTERObjectType;
  70. PERF_COUNTER_DEFINITION TotalFilterTime;
  71. PERF_COUNTER_DEFINITION BindingTime;
  72. PERF_COUNTER_DEFINITION FilterTime;
  73. };
  74. #define FILTER_TOTAL_NUM_COUNTERS ((sizeof(FILTER_DATA_DEFINITION)-sizeof(PERF_OBJECT_TYPE)) / \
  75. sizeof(PERF_COUNTER_DEFINITION))
  76. //
  77. // Number of counters only existed in the filter daemon
  78. //
  79. const ULONG NUM_KERNEL_AND_USER_COUNTER = FILTER_TOTAL_NUM_COUNTERS;
  80. const ULONG KERNEL_USER_INDEX = ( NUM_KERNEL_AND_USER_COUNTER * 2 );
  81. //
  82. // The prefix of catalogs must be unique in first 29 wchars.
  83. // The size in WCHARs should be evenly divisible by sizeof ULONG.
  84. //
  85. const ULONG CI_PERF_MAX_CATALOG_LEN = 30;
  86. //
  87. // Prefix these names with Global\ so that Terminal Services clients can see
  88. // them.
  89. //
  90. #define CI_PERF_MEM_NAME L"Global\\__CiPerfMonMemory"
  91. #define CI_PERF_MUTEX_NAME L"Global\\__CiPerfMonMutex"