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.

166 lines
3.0 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 8
  14. #define DATA_LIST_LENGTH 100
  15. #define DELAY_SECONDS 2
  16. //
  17. // Hi-Tech macro to figure out how much a field has changed by.
  18. //
  19. #define delta(FLD) (PerfInfo.FLD - PreviousPerfInfo.FLD)
  20. //
  21. // display const
  22. //
  23. #define IX_PUSHF 0
  24. #define IX_POPF 1
  25. #define IX_IRET 2
  26. #define IX_HLT 3
  27. #define IX_CLI 4
  28. #define IX_STI 5
  29. #define IX_BOP 6
  30. #define IX_SEGNOTP 7
  31. #define IX_VDMOPCODEF 8
  32. #define IX_INTNN 9
  33. #define IX_INTO 10
  34. #define IX_INB 11
  35. #define IX_INW 12
  36. #define IX_OUTB 13
  37. #define IX_OUTW 14
  38. #define IX_INSB 15
  39. #define IX_INSW 16
  40. #define IX_OUTSB 17
  41. #define IX_OUTSW 18
  42. #define SAVE_SUBJECTS 19
  43. #define BORDER_WIDTH 2
  44. #define INDENT_WIDTH 8
  45. #define GRAPH_WIDTH 130
  46. #define GRAPH_HEIGHT 40
  47. #define PERF_METER_CPU_CYCLE 10
  48. //
  49. // time constant for sampling performance
  50. //
  51. #define PERF_TIME_DELAY 1000
  52. //
  53. // types of display modes
  54. //
  55. #define DISPLAY_MODE_CPU_ONLY 0
  56. #define DISPLAY_MODE_CPU 10
  57. #define DISPLAY_MODE_VM 20
  58. #define DISPLAY_MODE_CACHE 30
  59. #define DISPLAY_MODE_POOL 40
  60. #define DISPLAY_MODE_IO 50
  61. #define DISPLAY_MODE_LPC 60
  62. #define DISPLAY_MODE_SVR 70
  63. //
  64. // structure to save screen statistics
  65. //
  66. typedef struct _CPU_DATA_LIST
  67. {
  68. PUCHAR KernelTime;
  69. PUCHAR UserTime;
  70. PUCHAR TotalTime;
  71. } CPU_DATA_LIST,*PCPU_DATA_LIST;
  72. typedef struct _PERF_DATA_LIST
  73. {
  74. PULONG PerfData;
  75. } PERF_DATA_LIST,*PPERF_DATA_LIST;
  76. //
  77. // This info packet is associated with each
  78. // performance item
  79. //
  80. typedef struct tagDISPLAYITEM
  81. {
  82. HDC MemoryDC;
  83. HBITMAP MemoryBitmap;
  84. ULONG Max;
  85. ULONG PositionX;
  86. ULONG PositionY;
  87. ULONG Width;
  88. ULONG Height;
  89. ULONG NumberOfElements;
  90. ULONG CurrentDrawingPos;
  91. RECT Border;
  92. RECT GraphBorder;
  93. RECT TextBorder;
  94. BOOL Display;
  95. BOOL ChangeScale;
  96. ULONG KernelTime[DATA_LIST_LENGTH];
  97. ULONG UserTime[DATA_LIST_LENGTH];
  98. ULONG TotalTime[DATA_LIST_LENGTH];
  99. } DISPLAY_ITEM,*PDISPLAY_ITEM;
  100. //
  101. // flag to activate each menu selection
  102. //
  103. #define DISPLAY_INACTIVE 0
  104. #define DISPLAY_ACTIVE 1
  105. //
  106. // Keep book-keeping info for all processors
  107. //
  108. typedef struct _CPU_VALUE
  109. {
  110. LARGE_INTEGER KernelTime;
  111. LARGE_INTEGER UserTime;
  112. LARGE_INTEGER IdleTime;
  113. ULONG InterruptCount;
  114. } CPU_VALUE,*PCPU_VALUE;
  115. BOOL
  116. UpdatePerfInfo(
  117. PULONG DataPointer,
  118. ULONG NewDataValue,
  119. PULONG OldMaxValue
  120. );
  121. VOID
  122. InitListData(
  123. PDISPLAY_ITEM PerfListItem,
  124. ULONG NumberOfItems
  125. );
  126. #endif /* _CALCPERFH_INCLUDED */
  127.