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.

142 lines
2.7 KiB

  1. /*++
  2. Copyright (c) 1990 Microsoft Corporation
  3. Module Name:
  4. perfmtrp.h
  5. Abstract:
  6. This module contains NT/Win32 Perfmtr private data and types
  7. Author:
  8. Mark Enstrom (marke) 28-Mar-1991
  9. Revision History:
  10. --*/
  11. #ifndef _CALCPERFH_INCLUDED_
  12. #define _CALCPERFH_INCLUDED_
  13. #define MAX_PROCESSOR 16
  14. #define DATA_LIST_LENGTH 100
  15. #define DELAY_SECONDS 2
  16. //
  17. // display const
  18. //
  19. #define SAVE_SUBJECTS (MAX_PROCESSOR+12+3+1)
  20. #define BORDER_WIDTH 2
  21. #define INDENT_WIDTH 8
  22. #define GRAPH_WIDTH 130
  23. #define GRAPH_HEIGHT 40
  24. #define PERF_METER_CPU_CYCLE 10
  25. //
  26. // time constant for sampling performance
  27. //
  28. #define PERF_TIME_DELAY 1000
  29. //
  30. // types of display modes
  31. //
  32. #define DISPLAY_MODE_CPU_ONLY 0
  33. #define DISPLAY_MODE_CPU 10
  34. #define DISPLAY_MODE_VM 20
  35. #define DISPLAY_MODE_CACHE 30
  36. #define DISPLAY_MODE_POOL 40
  37. #define DISPLAY_MODE_IO 50
  38. #define DISPLAY_MODE_LPC 60
  39. #define DISPLAY_MODE_SVR 70
  40. //
  41. // structure to save screen statistics
  42. //
  43. typedef struct _CPU_DATA_LIST
  44. {
  45. PUCHAR KernelTime;
  46. PUCHAR UserTime;
  47. PUCHAR TotalTime;
  48. } CPU_DATA_LIST,*PCPU_DATA_LIST;
  49. typedef struct _PERF_DATA_LIST
  50. {
  51. PULONG PerfData;
  52. } PERF_DATA_LIST,*PPERF_DATA_LIST;
  53. //
  54. // This info packet is associated with each
  55. // performance item
  56. //
  57. typedef struct tagDISPLAYITEM
  58. {
  59. HDC MemoryDC;
  60. HBITMAP MemoryBitmap;
  61. ULONG Max;
  62. ULONG PositionX;
  63. ULONG PositionY;
  64. ULONG Width;
  65. ULONG Height;
  66. ULONG NumberOfElements;
  67. ULONG CurrentDrawingPos;
  68. RECT Border;
  69. RECT GraphBorder;
  70. RECT TextBorder;
  71. BOOL Display;
  72. BOOL ChangeScale;
  73. ULONG KernelTime[DATA_LIST_LENGTH];
  74. ULONG UserTime[DATA_LIST_LENGTH];
  75. ULONG TotalTime[DATA_LIST_LENGTH];
  76. ULONG DpcTime[DATA_LIST_LENGTH];
  77. ULONG InterruptTime[DATA_LIST_LENGTH];
  78. } DISPLAY_ITEM,*PDISPLAY_ITEM;
  79. //
  80. // flag to activate each menu selection
  81. //
  82. #define DISPLAY_INACTIVE 0
  83. #define DISPLAY_ACTIVE 1
  84. //
  85. // Keep book-keeping info for all processors
  86. //
  87. typedef struct _CPU_VALUE
  88. {
  89. LARGE_INTEGER KernelTime;
  90. LARGE_INTEGER UserTime;
  91. LARGE_INTEGER IdleTime;
  92. LARGE_INTEGER DpcTime;
  93. LARGE_INTEGER InterruptTime;
  94. ULONG InterruptCount;
  95. } CPU_VALUE,*PCPU_VALUE;
  96. BOOL
  97. UpdatePerfInfo(
  98. PULONG DataPointer,
  99. ULONG NewDataValue,
  100. PULONG OldMaxValue
  101. );
  102. VOID
  103. InitListData(
  104. PDISPLAY_ITEM PerfListItem,
  105. ULONG NumberOfItems
  106. );
  107. #endif /* _CALCPERFH_INCLUDED */