Counter Strike : Global Offensive Source Code
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.

225 lines
11 KiB

  1. //========= Copyright � 1996-2005, Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. // $NoKeywords: $
  6. //
  7. //=============================================================================//
  8. #ifndef P5P6PERFORMANCECOUNTERS_H
  9. #define P5P6PERFORMANCECOUNTERS_H
  10. // defined for < Pentium 4
  11. //---------------------------------------------------------------------------
  12. // Format of the performance event IDs within this header file in case you
  13. // wish to add any additional events that may not be present here.
  14. //
  15. // BITS 0-8 Unit Mask, Unsed on P5 processors
  16. // BIT 9 Set if event can be set on counter 0
  17. // BIT 10 Set if event can be set on counter 1
  18. // BITS 11-15 Unused Set to zero
  19. // BITS 16-23 Event Select ID, Only bits 16-21 used on P5 Family
  20. // BITS 24-27 Unused set to zero
  21. // BITS 28-32 Process family that the event belong to, as returned by
  22. // the CPUID instruction.
  23. //---------------------------------------------------------------------------
  24. //---------------------------------------------------------------------------
  25. // PENTIUM PERFORMANCE COUNTERS.
  26. //---------------------------------------------------------------------------
  27. #define P5_DTCRD 0x50000300 //Data Cache Reads
  28. #define P5_DWRIT 0x50010300 //Data Cache Writes
  29. #define P5_DTTLB 0x50020300 //Data TLB Miss
  30. #define P5_DTRMS 0x50030300 //Data Read Misses
  31. #define P5_DWRMS 0x50040300 //Data Write Miss
  32. #define P5_WHLCL 0x50050300 //Write (Hit) to M- or E-state line
  33. #define P5_DCLWB 0x50060300 //Data Cache Lines Written Back
  34. #define P5_DCSNP 0x50070300 //External Snoops
  35. #define P5_DCSHT 0x50080300 //Data Cache Snoop Hits
  36. #define P5_MAIBP 0x50090300 //Memory Access in Both Pipes
  37. #define P5_BANKS 0x500A0300 //Bank Conflicts
  38. #define P5_MISAL 0x500B0300 //Misaligned Data Memory Reference
  39. #define P5_COCRD 0x500C0300 //Code Cache Reads
  40. #define P5_COTLB 0x500D0300 //Code TLB Misses
  41. #define P5_COCMS 0x500E0300 //Code Cache Misses
  42. #define P5_ANYSG 0x500F0300 //Any Segment Register Loaded
  43. #define P5_BRANC 0x50120300 //Branches
  44. #define P5_BTBHT 0x50130300 //BTB Hits
  45. #define P5_TBRAN 0x50140300 //Taken Branch or BTB hit
  46. #define P5_PFLSH 0x50150300 //Pipeline flushes
  47. #define P5_INSTR 0x50160300 //Instructions Executed
  48. #define P5_INSTV 0x50170300 //Instructions Executed in the V-Pipe (Pairing)
  49. #define P5_CLOCL 0x50180300 //Bus active
  50. #define P5_PSDWR 0x50190300 //Full write buffers
  51. #define P5_PSWDR 0x501A0300 //Waiting for Data Memory Read
  52. #define P5_NCLSW 0x501B0300 //Clocks stalled writing an E or M state line
  53. #define P5_IORWC 0x501D0300 //I/O Read or Write Cycle
  54. #define P5_NOCMR 0x501E0300 //Non-Cacheable Memory Reads
  55. #define P5_PSLDA 0x501F0300 //Clocks stalled due to AGI
  56. #define P5_FLOPS 0x50220300 //Floating Point Operations
  57. #define P5_DBGR0 0x50230300 //Breakpoint match on DR0
  58. #define P5_DBGR1 0x50240300 //Breakpoint match on DR1
  59. #define P5_DBGR2 0x50250300 //Breakpoint match on DR2
  60. #define P5_DBGR3 0x50260300 //Breakpoint match on DR3
  61. #define P5_HWINT 0x50270300 //Hardware interrupts
  62. #define P5_DTRWR 0x50280300 //Data reads or writes
  63. #define P5_DTRWM 0x50290300 //Data read or write miss
  64. #define P5_BOLAT 0x502A0100 //Bus ownership latency
  65. #define P5_BOTFR 0x502A0200 //Bus ownership transfer
  66. #define P5_MMXA1 0x502B0100 //MMX Instruction Executed in U-pipe
  67. #define P5_MMXA2 0x502B0200 //MMX Instruction Executed in V-pipe
  68. #define P5_MMXMS 0x502C0100 //Cache M state line sharing
  69. #define P5_MMSLS 0x502C0200 //Cache line sharing
  70. #define P5_MMXB1 0x502D0100 //EMMS Instructions Executed
  71. #define P5_MMXB2 0x502D0200 //Transition from MMX to FP instructions
  72. #define P5_NOCMW 0x502E0200 //Non-Cacheable Memory Writes
  73. #define P5_MMXC1 0x502F0100 //Saturated MMX Instructions Executed
  74. #define P5_MMXC2 0x502F0200 //Saturations Performed
  75. #define P5_MMXHS 0x50300100 //Cycles Not in HALT State
  76. #define P5_MMXD2 0x50310100 //MMX Data Read
  77. #define P5_MMXFP 0x50320100 //Floating Point Stalls
  78. #define P5_MMXTB 0x50320200 //Taken Branches
  79. #define P5_MMXD0 0x50330100 //D1 Starvation and FIFO Empty
  80. #define P5_MMXD1 0x50330200 //D1 Starvation and one instruction in FIFO
  81. #define P5_MMXE1 0x50340100 //MMX Data Writes
  82. #define P5_MMXE2 0x50340200 //MMX Data Write Misses
  83. #define P5_MMXWB 0x50350100 //Pipeline flushes, wrong branch prediction
  84. #define P5_MMXWJ 0x50350200 //Pipeline flushes, branch prediction WB-stage
  85. #define P5_MMXF1 0x50360100 //Misaligned MMX Data Memory Reference
  86. #define P5_MMXF2 0x50360200 //Pipeline Stalled Waiting for MMX data read
  87. #define P5_MMXRI 0x50370100 //Returns Predicted Incorrectly
  88. #define P5_MMXRP 0x50370200 //Returns Predicted
  89. #define P5_MMXG1 0x50380100 //MMX Multiply Unit Interlock
  90. #define P5_MMXG2 0x50380200 //MOVD/MOVQ store stall, previous operation
  91. #define P5_MMXRT 0x50390100 //Returns
  92. #define P5_MMXRO 0x50390200 //RSB Overflows
  93. #define P5_MMXBF 0x503A0100 //BTB False entries
  94. #define P5_MMXBM 0x503A0200 //BTB misprediction on a Not-Taken Branch
  95. #define P5_PXDWR 0x503B0100 //stalled due MMX Full write buffers
  96. #define P5_PXZWR 0x503B0200 //stalled on MMX write to E or M state line
  97. #define P5_CLOCK 0x503F0300 //Special value to count clocks on P5
  98. //---------------------------------------------------------------------------
  99. // PENTIUM PRO / PENTIUM II PERFORMANCE COUNTERS.
  100. //---------------------------------------------------------------------------
  101. #define P6_STRBB 0x60030300 //Store Buffer Block
  102. #define P6_STBDC 0x60040300 //Store Buffer Drain Cycles
  103. #define P6_MISMM 0x60050300 //Misaligned Data Memory Reference
  104. #define P6_SEGLD 0x60060300 //Segment register loads
  105. #define P6_FPOPE 0x60100100 //FP Computational Op. (COUNTER 0 ONLY)
  106. #define P6_FPEOA 0x60110200 //FP Microcode Exceptions (COUNTER 1 ONLY)
  107. #define P6_FMULT 0x60120200 //Multiplies (COUNTER 1 ONLY)
  108. #define P6_FPDIV 0x60130200 //Divides (COUNTER 1 ONLY)
  109. #define P6_DBUSY 0x60140200 //Cycles Divider Busy (COUNTER 1 ONLY)
  110. #define P6_L2STR 0x60210300 //L2 address strobes => address bus utilization
  111. #define P6_L2BBS 0x60220300 //Cycles L2 Bus Busy
  112. #define P6_L2BBT 0x60230300 //Cycles L2 Bus Busy transferring data to CPU
  113. #define P6_L2ALO 0x60240300 //L2 Lines Allocated
  114. #define P6_L2MAL 0x60250300 //L2 M-state Lines Allocated
  115. #define P6_L2CEV 0x60260300 //L2 Lines Evicted
  116. #define P6_L2MEV 0x60270300 //L2 M-state Lines Evicted
  117. #define P6_L2MCF 0x60280301 //L2 Cache Instruction Fetch Misses
  118. #define P6_L2FET 0x6028030F //L2 Cache Instruction Fetches
  119. #define P6_L2DRM 0x60290301 //L2 Cache Read Misses
  120. #define P6_L2DMR 0x6029030F //L2 Cache Reads
  121. #define P6_L2DWM 0x602A0301 //L2 Cache Write Misses
  122. #define P6_L2DMW 0x602A030F //L2 Cache Writes
  123. #define P6_L2CMS 0x602E0301 //L2 Cache Request Misses
  124. #define P6_L2DCR 0x602E030F //L2 Cache Requests
  125. #define P6_DMREF 0x60430300 //Data Memory References
  126. #define P6_DCALO 0x6045030F //L1 Lines Allocated
  127. #define P6_DCMAL 0x60460300 //L1 M-state Data Cache Lines Allocated
  128. #define P6_DCMEV 0x60470300 //L1 M-state Data Cache Lines Evicted
  129. #define P6_DCOUT 0x60480300 //L1 Misses outstanding
  130. #define P6_TSMCD 0x60520300 //Time Self-Modifiying Code Detected
  131. #define P6_BRWRA 0x60600300 //External Bus Cycles While Receive Active
  132. #define P6_BRDCD 0x60600300 //External Bus Request Outstanding
  133. #define P6_BRBNR 0x60610300 //External Bus Cycles While BNR Asserted
  134. #define P6_BUSBS 0x60620300 //External Bus Cycles-DRDY Asserted (busy)
  135. #define P6_BLOCK 0x60630300 //External Bus Cycles-LOCK signal asserted
  136. #define P6_BBRCV 0x60640300 //External Bus Cycles-Processor receiving data
  137. #define P6_BURST 0x60650300 //External Bus Burst Read Operations
  138. #define P6_BRINV 0x60660300 //External Bus Read for Ownership Transaction
  139. #define P6_BMLEV 0x60670300 //External Bus Writeback M-state Evicted
  140. #define P6_BBIFT 0x60680300 //External Bus Burst Instruction Fetches
  141. #define P6_BINVL 0x60690300 //External Bus Invalidate Transactions
  142. #define P6_BPRBT 0x606A0300 //External Bus Partial Read Transactions
  143. #define P6_BPTMO 0x606B0300 //External Bus Partial Memory Transactions
  144. #define P6_BUSIO 0x606C0300 //External Bus I/O Bus Transactions
  145. #define P6_BUSDF 0x606D0300 //External Bus Deferred Transactions
  146. #define P6_BUSTB 0x606E0300 //External Bus Burst Transactions
  147. #define P6_BMALL 0x606F0300 //External Bus Memory Transactions
  148. #define P6_BSALL 0x60700300 //External Bus Transactions
  149. #define P6_CLOCK 0x60790300 //Clockticks
  150. #define P6_BRHIT 0x607A0300 //External Bus Cycles While HIT Asserted
  151. #define P6_BRHTM 0x607B0300 //External Bus Cycles While HITM Asserted
  152. #define P6_BRSST 0x607E0300 //External Bus Cycles While Snoop Stalled
  153. #define P6_CMREF 0x60800300 //Total Instruction Fetches
  154. #define P6_TOIFM 0x60810300 //Total Instruction Fetch Misses
  155. #define P6_INTLB 0x60850300 //Instructions TLB Misses
  156. #define P6_CSFET 0x60860300 //Cycles Instruction Fetch Stalled
  157. #define P6_FTSTL 0x60870300 //Cycles Instruction Fetch stalled
  158. #define P6_RSTAL 0x60A20300 //Resource Related Stalls
  159. #define P6_MMXIE 0x60B00300 //MMX Instructions Executed
  160. #define P6_SAISE 0x60B10300 //Saturated Arithmetic Instructions Executed
  161. #define P6_PORT0 0x60B20301 //MMX micro-ops executed on Port 0
  162. #define P6_PORT1 0x60B20302 //MMX micro-ops executed on Port 1
  163. #define P6_PORT2 0x60B20304 //MMX micro-ops executed on Port 2
  164. #define P6_PORT3 0x60B20308 //MMX micro-ops executed on Port 3
  165. #define P6_MMXPA 0x60B30300 //MMX Packed Arithmetic
  166. #define P6_MMXPM 0x60B30301 //MMX Packed Multiply
  167. #define P6_MMXPS 0x60B30302 //MMX Packed Shift
  168. #define P6_MMXPO 0x60B30304 //MMX Packed Operations
  169. #define P6_MMXUO 0x60B30308 //MMX Unpacked Operations
  170. #define P6_MMXPL 0x60B30310 //MMX Packed Logical
  171. #define P6_INSTR 0x60C00300 //Instructions Retired
  172. #define P6_FPOPS 0x60C10100 //FP operations retired (COUNTER 0 ONLY)
  173. #define P6_UOPSR 0x60C20300 //Micro-Ops Retired
  174. #define P6_BRRET 0x60C40300 //Branch Instructions Retired
  175. #define P6_BRMSR 0x60C50300 //Branch Mispredictions Retired
  176. #define P6_MASKD 0x60C60300 //Clocks while interrupts masked
  177. #define P6_MSKPN 0x60C70300 //Clocks while interrupt is pending
  178. #define P6_HWINT 0x60C80300 //Hardware Interrupts Received
  179. #define P6_BTAKR 0x60C90300 //Taken Branch Retired
  180. #define P6_BTAKM 0x60CA0300 //Taken Branch Mispredictions
  181. #define P6_FPMMX 0x60CC0301 //Transitions from Floating Point to MMX
  182. #define P6_MMXFP 0x60CC0300 //Transitions from MMX to Floating Point
  183. #define P6_SIMDA 0x60CD0300 //SIMD Assists (EMMS Instructions Executed)
  184. #define P6_MMXIR 0x60CE0300 //MMX Instructions Retired
  185. #define P6_SAISR 0x60CF0300 //Saturated Arithmetic Instructions Retired
  186. #define P6_INSTD 0x60D00300 //Instructions Decoded
  187. #define P6_NPRTL 0x60D20300 //Renaming Stalls
  188. #define P6_SRSES 0x60D40301 //Segment Rename Stalls - ES
  189. #define P6_SRSDS 0x60D40302 //Segment Rename Stalls - DS
  190. #define P6_SRSFS 0x60D40304 //Segment Rename Stalls - FS
  191. #define P6_SRSGS 0x60D40308 //Segment Rename Stalls - GS
  192. #define P6_SRSXS 0x60D4030F //Segment Rename Stalls - ES DS FS GS
  193. #define P6_SRNES 0x60D50301 //Segment Renames - ES
  194. #define P6_SRNDS 0x60D50302 //Segment Renames - DS
  195. #define P6_SRNFS 0x60D50304 //Segment Renames - FS
  196. #define P6_SRNGS 0x60D50308 //Segment Renames - GS
  197. #define P6_SRNXS 0x60D5030F //Segment Renames - ES DS FS GS
  198. #define P6_BRDEC 0x60E00300 //Branch Instructions Decoded
  199. #define P6_BTBMS 0x60E20301 //BTB Misses
  200. #define P6_RETDC 0x60E40300 //Bogus Branches
  201. #define P6_BACLR 0x60E60300 //BACLEARS Asserted (Testing)
  202. // INTEL
  203. #define PENTIUM_FAMILY 5 // define for pentium
  204. #define PENTIUMPRO_FAMILY 6 // define for pentium pro
  205. #define PENTIUM4_FAMILY 15 // define for pentium 4
  206. // AMD
  207. #define K6_FAMILY 5
  208. #define K8_FAMILY 6
  209. #define EXTENDED_FAMILY 15 // AMD 64 and AMD Opteron
  210. #endif // P5P6PERFORMANCECOUNTERS_H