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.

1787 lines
31 KiB

  1. //========= Copyright � 1996-2005, Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. // $NoKeywords: $
  6. //
  7. //=============================================================================//
  8. #ifndef EVENTMODES_H
  9. #define EVENTMODES_H
  10. #pragma once
  11. /*
  12. Event Modes to choose from:
  13. P4Event_TC_deliver_mode
  14. P4Event_BPU_fetch_request
  15. P4Event_ITLB_reference
  16. P4Event_memory_cancel
  17. P4Event_memory_complete
  18. P4Event_load_port_replay
  19. P4Event_store_port_replay
  20. P4Event_MOB_load_replay
  21. P4Event_page_walk_type
  22. P4Event_BSQ_cache_reference
  23. P4Event_IOQ_allocation
  24. P4Event_IOQ_active_entries
  25. P4Event_FSB_data_activity
  26. P4Event_BSQ_allocation
  27. P4Event_BSQ_active_entries
  28. P4Event_SSE_input_assist
  29. P4Event_packed_SP_uop
  30. P4Event_packed_DP_uop
  31. P4Event_scalar_SP_uop
  32. P4Event_scalar_DP_uop
  33. P4Event_64bit_MMX_uop
  34. P4Event_128bit_MMX_uop
  35. P4Event_x87_FP_uop
  36. P4Event_x87_SIMD_moves_uop
  37. P4Event_TC_misc
  38. P4Event_global_power_events
  39. P4Event_tc_ms_xfer
  40. P4Event_uop_queue_writes
  41. P4Event_retired_mispred_branch_type
  42. P4Event_retired_branch_type
  43. P4Event_resource_stall
  44. P4Event_WC_Buffer
  45. P4Event_b2b_cycles
  46. P4Event_bnr
  47. P4Event_snoop
  48. P4Event_response
  49. P4Event_front_end_event
  50. P4Event_execution_event
  51. P4Event_replay_event
  52. P4Event_instr_retired
  53. P4Event_uops_retired
  54. P4Event_uop_type
  55. P4Event_branch_retired
  56. P4Event_mispred_branch_retired
  57. P4Event_x87_assist
  58. P4Event_machine_clear
  59. */
  60. class P4P4Event_TC_deliver_mode: public P4BaseEvent
  61. {
  62. public:
  63. EVENT_MASK(TC_deliver_mode) * eventMask;
  64. P4P4Event_TC_deliver_mode()
  65. {
  66. eventMask = (EVENT_MASK(TC_deliver_mode) *)&m_eventMask;
  67. escr.ESCREventSelect = 0x01;
  68. cccr.CCCRSelect = 0x01;
  69. //// eventType = EVENT_TYPE(TC_deliver_mode);
  70. description = _T("TC_deliver_mode");
  71. UseCounter4();
  72. }
  73. void UseCounter4()
  74. {
  75. SetCounter(4);;
  76. }
  77. void UseCounter5()
  78. {
  79. SetCounter(5);
  80. }
  81. void UseCounter6()
  82. {
  83. SetCounter(6);
  84. }
  85. void UseCounter7()
  86. {
  87. SetCounter(7);
  88. }
  89. };
  90. class P4P4Event_BPU_fetch_request: public P4BaseEvent
  91. {
  92. public:
  93. EVENT_MASK(BPU_fetch_request)* eventMask;
  94. P4P4Event_BPU_fetch_request()
  95. {
  96. eventMask = (EVENT_MASK(BPU_fetch_request) *)&m_eventMask;
  97. escr.ESCREventSelect= 0x03;
  98. cccr.CCCRSelect= 0x00;
  99. // eventType = EVENT_TYPE(BPU_fetch_request);
  100. description=_T("BPU_fetch_request");
  101. UseCounter0();
  102. }
  103. void UseCounter0()
  104. {
  105. SetCounter(0);
  106. }
  107. void UseCounter1()
  108. {
  109. SetCounter(1);
  110. }
  111. void UseCounter2()
  112. {
  113. SetCounter(2);
  114. }
  115. void UseCounter3()
  116. {
  117. SetCounter(3);
  118. }
  119. };
  120. class P4P4Event_ITLB_reference: public P4BaseEvent
  121. {
  122. public:
  123. EVENT_MASK(ITLB_reference) * eventMask;
  124. P4P4Event_ITLB_reference()
  125. {
  126. eventMask = (EVENT_MASK(ITLB_reference) *)&m_eventMask;
  127. escr.ESCREventSelect= 0x18;
  128. cccr.CCCRSelect= 0x03;
  129. // eventType=EVENT_TYPE(ITLB_reference);
  130. description=_T("ITLB_reference");
  131. UseCounter0();
  132. }
  133. void UseCounter0()
  134. {
  135. SetCounter(0);
  136. }
  137. void UseCounter1()
  138. {
  139. SetCounter(1);
  140. }
  141. void UseCounter2()
  142. {
  143. SetCounter(2);
  144. }
  145. void UseCounter3()
  146. {
  147. SetCounter(3);
  148. }
  149. };
  150. class P4Event_memory_cancel: public P4BaseEvent
  151. {
  152. public:
  153. EVENT_MASK(memory_cancel) * eventMask;
  154. P4Event_memory_cancel()
  155. {
  156. eventMask = (EVENT_MASK(memory_cancel) *)&m_eventMask;
  157. escr.ESCREventSelect= 0x02;
  158. cccr.CCCRSelect= 0x05;
  159. // eventType=EVENT_TYPE(memory_cancel);
  160. description=_T("memory_cancel");
  161. UseCounter8();
  162. }
  163. void UseCounter8()
  164. {
  165. SetCounter(8);
  166. }
  167. void UseCounter9()
  168. {
  169. SetCounter(9);
  170. }
  171. void UseCounter10()
  172. {
  173. SetCounter(10);
  174. }
  175. void UseCounter11()
  176. {
  177. SetCounter(11);
  178. }
  179. };
  180. class P4Event_memory_complete: public P4BaseEvent
  181. {
  182. public:
  183. EVENT_MASK(memory_complete) * eventMask;
  184. P4Event_memory_complete()
  185. {
  186. eventMask = (EVENT_MASK(memory_complete) *)&m_eventMask;
  187. escr.ESCREventSelect= 0x08;
  188. cccr.CCCRSelect= 0x02;
  189. // eventType=EVENT_TYPE(memory_complete);
  190. description=_T("memory_complete");
  191. UseCounter8();
  192. }
  193. void UseCounter8()
  194. {
  195. SetCounter(8);
  196. }
  197. void UseCounter9()
  198. {
  199. SetCounter(9);
  200. }
  201. void UseCounter10()
  202. {
  203. SetCounter(10);
  204. }
  205. void UseCounter11()
  206. {
  207. SetCounter(11);
  208. }
  209. };
  210. class P4Event_load_port_replay: public P4BaseEvent
  211. {
  212. public:
  213. EVENT_MASK(load_port_replay) * eventMask;
  214. P4Event_load_port_replay()
  215. {
  216. eventMask = (EVENT_MASK(load_port_replay) *)&m_eventMask;
  217. escr.ESCREventSelect= 0x04;
  218. cccr.CCCRSelect= 0x02;
  219. // eventType=EVENT_TYPE(load_port_replay);
  220. description=_T("load_port_replay");
  221. UseCounter8();
  222. }
  223. void UseCounter8()
  224. {
  225. SetCounter(8);
  226. }
  227. void UseCounter9()
  228. {
  229. SetCounter(9);
  230. }
  231. void UseCounter10()
  232. {
  233. SetCounter(10);
  234. }
  235. void UseCounter11()
  236. {
  237. SetCounter(11);
  238. }
  239. };
  240. class P4Event_store_port_replay: public P4BaseEvent
  241. {
  242. public:
  243. EVENT_MASK(store_port_replay) * eventMask;
  244. P4Event_store_port_replay()
  245. {
  246. eventMask = (EVENT_MASK(store_port_replay) *)&m_eventMask;
  247. escr.ESCREventSelect= 0x05;
  248. cccr.CCCRSelect= 0x02;
  249. // eventType=EVENT_TYPE(store_port_replay);
  250. description=_T("store_port_replay");
  251. UseCounter8();
  252. }
  253. void UseCounter8()
  254. {
  255. SetCounter(8);
  256. }
  257. void UseCounter9()
  258. {
  259. SetCounter(9);
  260. }
  261. void UseCounter10()
  262. {
  263. SetCounter(10);
  264. }
  265. void UseCounter11()
  266. {
  267. SetCounter(11);
  268. }
  269. };
  270. class P4Event_MOB_load_replay: public P4BaseEvent
  271. {
  272. public:
  273. EVENT_MASK(MOB_load_replay) * eventMask;
  274. P4Event_MOB_load_replay()
  275. {
  276. eventMask = (EVENT_MASK(MOB_load_replay) *)&m_eventMask;
  277. escr.ESCREventSelect= 0x03;
  278. cccr.CCCRSelect= 0x02;
  279. // eventType=EVENT_TYPE(MOB_load_replay);
  280. description=_T("MOB_load_replay");
  281. UseCounter0();
  282. }
  283. void UseCounter0()
  284. {
  285. SetCounter(0);
  286. }
  287. void UseCounter1()
  288. {
  289. SetCounter(1);
  290. }
  291. void UseCounter2()
  292. {
  293. SetCounter(2);
  294. }
  295. void UseCounter3()
  296. {
  297. SetCounter(3);
  298. }
  299. };
  300. class P4Event_page_walk_type: public P4BaseEvent
  301. {
  302. public:
  303. EVENT_MASK(page_walk_type) * eventMask;
  304. P4Event_page_walk_type()
  305. {
  306. eventMask = (EVENT_MASK(page_walk_type) *)&m_eventMask;
  307. escr.ESCREventSelect= 0x01;
  308. cccr.CCCRSelect= 0x04;
  309. // eventType=EVENT_TYPE(page_walk_type);
  310. description=_T("page_walk_type");
  311. UseCounter0();
  312. }
  313. void UseCounter0()
  314. {
  315. SetCounter(0);
  316. }
  317. void UseCounter1()
  318. {
  319. SetCounter(1);
  320. }
  321. void UseCounter2()
  322. {
  323. SetCounter(2);
  324. }
  325. void UseCounter3()
  326. {
  327. SetCounter(3);
  328. }
  329. };
  330. class P4Event_BSQ_cache_reference: public P4BaseEvent
  331. {
  332. public:
  333. EVENT_MASK(BSQ_cache_reference) * eventMask;
  334. P4Event_BSQ_cache_reference()
  335. {
  336. eventMask = (EVENT_MASK(BSQ_cache_reference) *)&m_eventMask;
  337. escr.ESCREventSelect= 0x0C;
  338. cccr.CCCRSelect= 0x07;
  339. // eventType=EVENT_TYPE(BSQ_cache_reference);
  340. description=_T("BSQ_cache_reference");
  341. UseCounter0();
  342. }
  343. void UseCounter0()
  344. {
  345. SetCounter(0);
  346. }
  347. void UseCounter1()
  348. {
  349. SetCounter(1);
  350. }
  351. void UseCounter2()
  352. {
  353. SetCounter(2);
  354. }
  355. void UseCounter3()
  356. {
  357. SetCounter(3);
  358. }
  359. };
  360. class P4Event_IOQ_allocation: public P4BaseEvent
  361. {
  362. public:
  363. EVENT_MASK(IOQ) * eventMask;
  364. P4Event_IOQ_allocation()
  365. {
  366. eventMask = (EVENT_MASK(IOQ) *)&m_eventMask;
  367. escr.ESCREventSelect= 0x03;
  368. cccr.CCCRSelect= 0x06;
  369. // eventType=EVENT_TYPE(IOQ);
  370. description=_T("IOQ_allocation");
  371. UseCounter0();
  372. }
  373. void UseCounter0()
  374. {
  375. SetCounter(0);
  376. }
  377. void UseCounter1()
  378. {
  379. SetCounter(1);
  380. }
  381. void UseCounter2()
  382. {
  383. SetCounter(2);
  384. }
  385. void UseCounter3()
  386. {
  387. SetCounter(3);
  388. }
  389. };
  390. class P4Event_IOQ_active_entries: public P4BaseEvent
  391. {
  392. public:
  393. EVENT_MASK(IOQ) * eventMask;
  394. P4Event_IOQ_active_entries()
  395. {
  396. eventMask = (EVENT_MASK(IOQ) *)&m_eventMask;
  397. escr.ESCREventSelect= 0x1A;
  398. cccr.CCCRSelect= 0x06;
  399. // eventType=EVENT_TYPE(IOQ);
  400. description=_T("IOQ_active_entries");
  401. UseCounter2();
  402. }
  403. void UseCounter2()
  404. {
  405. SetCounter(2);
  406. }
  407. void UseCounter3()
  408. {
  409. SetCounter(3);
  410. }
  411. };
  412. class P4Event_FSB_data_activity: public P4BaseEvent
  413. {
  414. public:
  415. EVENT_MASK(FSB_data_activity) * eventMask;
  416. P4Event_FSB_data_activity()
  417. {
  418. eventMask = (EVENT_MASK(FSB_data_activity) *)&m_eventMask;
  419. escr.ESCREventSelect= 0x17;
  420. cccr.CCCRSelect= 0x06;
  421. // eventType=EVENT_TYPE(FSB_data_activity);
  422. description=_T("FSB_data_activity");
  423. UseCounter0();
  424. }
  425. void UseCounter0()
  426. {
  427. SetCounter(0);
  428. }
  429. void UseCounter1()
  430. {
  431. SetCounter(1);
  432. }
  433. void UseCounter2()
  434. {
  435. SetCounter(2);
  436. }
  437. void UseCounter3()
  438. {
  439. SetCounter(3);
  440. }
  441. };
  442. class P4Event_BSQ_allocation: public P4BaseEvent
  443. {
  444. public:
  445. EVENT_MASK(BSQ) * eventMask;
  446. P4Event_BSQ_allocation()
  447. {
  448. eventMask = (EVENT_MASK(BSQ) *)&m_eventMask;
  449. escr.ESCREventSelect= 0x05;
  450. cccr.CCCRSelect= 0x07;
  451. // eventType=EVENT_TYPE(BSQ);
  452. description=_T("BSQ_allocation");
  453. UseCounter0();
  454. }
  455. void UseCounter0()
  456. {
  457. SetCounter(0);
  458. }
  459. void UseCounter1()
  460. {
  461. SetCounter(1);
  462. }
  463. };
  464. class P4Event_BSQ_active_entries: public P4BaseEvent
  465. {
  466. public:
  467. EVENT_MASK(BSQ) * eventMask;
  468. P4Event_BSQ_active_entries()
  469. {
  470. eventMask = (EVENT_MASK(BSQ) *)&m_eventMask;
  471. escr.ESCREventSelect= 0x06;
  472. cccr.CCCRSelect= 0x07;
  473. // eventType=EVENT_TYPE(BSQ);
  474. description=_T("bsq_active_entries");
  475. UseCounter2();
  476. }
  477. void UseCounter2()
  478. {
  479. SetCounter(2);
  480. }
  481. void UseCounter3()
  482. {
  483. SetCounter(3);
  484. }
  485. };
  486. class P4Event_SSE_input_assist: public P4BaseEvent
  487. {
  488. public:
  489. EVENT_MASK(firm_uop) * eventMask;
  490. P4Event_SSE_input_assist()
  491. {
  492. eventMask = (EVENT_MASK(firm_uop) *)&m_eventMask;
  493. escr.ESCREventSelect= 0x34;
  494. cccr.CCCRSelect= 0x01;
  495. // eventType=EVENT_TYPE(firm_uop);
  496. description=_T("SSE_input_assist");
  497. UseCounter8();
  498. }
  499. void UseCounter8()
  500. {
  501. SetCounter(8);
  502. }
  503. void UseCounter9()
  504. {
  505. SetCounter(9);
  506. }
  507. void UseCounter10()
  508. {
  509. SetCounter(10);
  510. }
  511. void UseCounter11()
  512. {
  513. SetCounter(11);
  514. }
  515. };
  516. class P4Event_packed_SP_uop: public P4BaseEvent
  517. {
  518. public:
  519. EVENT_MASK(firm_uop) * eventMask;
  520. P4Event_packed_SP_uop()
  521. {
  522. eventMask = (EVENT_MASK(firm_uop) *)&m_eventMask;
  523. escr.ESCREventSelect= 0x08;
  524. cccr.CCCRSelect= 0x01;
  525. // eventType=EVENT_TYPE(firm_uop);
  526. description=_T("packed_SP_uop");
  527. UseCounter8();
  528. }
  529. void UseCounter8()
  530. {
  531. SetCounter(8);
  532. }
  533. void UseCounter9()
  534. {
  535. SetCounter(9);
  536. }
  537. void UseCounter10()
  538. {
  539. SetCounter(10);
  540. }
  541. void UseCounter11()
  542. {
  543. SetCounter(11);
  544. }
  545. };
  546. class P4Event_packed_DP_uop: public P4BaseEvent
  547. {
  548. public:
  549. EVENT_MASK(firm_uop) * eventMask;
  550. P4Event_packed_DP_uop()
  551. {
  552. eventMask = (EVENT_MASK(firm_uop) *)&m_eventMask;
  553. escr.ESCREventSelect= 0x0C;
  554. cccr.CCCRSelect= 0x01;
  555. // eventType=EVENT_TYPE(firm_uop);
  556. description=_T("packed_DP_uop");
  557. UseCounter8();
  558. }
  559. void UseCounter8()
  560. {
  561. SetCounter(8);
  562. }
  563. void UseCounter9()
  564. {
  565. SetCounter(9);
  566. }
  567. void UseCounter10()
  568. {
  569. SetCounter(10);
  570. }
  571. void UseCounter11()
  572. {
  573. SetCounter(11);
  574. }
  575. };
  576. class P4Event_scalar_SP_uop: public P4BaseEvent
  577. {
  578. public:
  579. EVENT_MASK(firm_uop) * eventMask;
  580. P4Event_scalar_SP_uop()
  581. {
  582. eventMask = (EVENT_MASK(firm_uop) *)&m_eventMask;
  583. escr.ESCREventSelect= 0x0A;
  584. cccr.CCCRSelect= 0x01;
  585. // eventType=EVENT_TYPE(firm_uop);
  586. description=_T("scalar_SP_uop");
  587. UseCounter8();
  588. }
  589. void UseCounter8()
  590. {
  591. SetCounter(8);
  592. }
  593. void UseCounter9()
  594. {
  595. SetCounter(9);
  596. }
  597. void UseCounter10()
  598. {
  599. SetCounter(10);
  600. }
  601. void UseCounter11()
  602. {
  603. SetCounter(11);
  604. }
  605. };
  606. class P4Event_scalar_DP_uop: public P4BaseEvent
  607. {
  608. public:
  609. EVENT_MASK(firm_uop) * eventMask;
  610. P4Event_scalar_DP_uop()
  611. {
  612. eventMask = (EVENT_MASK(firm_uop) *)&m_eventMask;
  613. escr.ESCREventSelect= 0x0E;
  614. cccr.CCCRSelect= 0x01;
  615. // eventType=EVENT_TYPE(firm_uop);
  616. description=_T("scalar_DP_uop");
  617. UseCounter8();
  618. }
  619. void UseCounter8()
  620. {
  621. SetCounter(8);
  622. }
  623. void UseCounter9()
  624. {
  625. SetCounter(9);
  626. }
  627. void UseCounter10()
  628. {
  629. SetCounter(10);
  630. }
  631. void UseCounter11()
  632. {
  633. SetCounter(11);
  634. }
  635. };
  636. class P4Event_64bit_MMX_uop: public P4BaseEvent
  637. {
  638. public:
  639. EVENT_MASK(firm_uop) * eventMask;
  640. P4Event_64bit_MMX_uop()
  641. {
  642. eventMask = (EVENT_MASK(firm_uop) *)&m_eventMask;
  643. escr.ESCREventSelect= 0x02;
  644. cccr.CCCRSelect= 0x01;
  645. // eventType=EVENT_TYPE(firm_uop);
  646. description=_T("64bit_MMX_uop");
  647. UseCounter8();
  648. }
  649. void UseCounter8()
  650. {
  651. SetCounter(8);
  652. }
  653. void UseCounter9()
  654. {
  655. SetCounter(9);
  656. }
  657. void UseCounter10()
  658. {
  659. SetCounter(10);
  660. }
  661. void UseCounter11()
  662. {
  663. SetCounter(11);
  664. }
  665. };
  666. class P4Event_128bit_MMX_uop: public P4BaseEvent
  667. {
  668. public:
  669. EVENT_MASK(firm_uop) * eventMask;
  670. P4Event_128bit_MMX_uop()
  671. {
  672. eventMask = (EVENT_MASK(firm_uop) *)&m_eventMask;
  673. escr.ESCREventSelect= 0x1A;
  674. cccr.CCCRSelect= 0x01;
  675. // eventType=EVENT_TYPE(firm_uop);
  676. description=_T("128bit_MMX_uop");
  677. UseCounter8();
  678. }
  679. void UseCounter8()
  680. {
  681. SetCounter(8);
  682. }
  683. void UseCounter9()
  684. {
  685. SetCounter(9);
  686. }
  687. void UseCounter10()
  688. {
  689. SetCounter(10);
  690. }
  691. void UseCounter11()
  692. {
  693. SetCounter(11);
  694. }
  695. };
  696. class P4Event_x87_FP_uop: public P4BaseEvent
  697. {
  698. public:
  699. EVENT_MASK(firm_uop) * eventMask;
  700. P4Event_x87_FP_uop()
  701. {
  702. eventMask = (EVENT_MASK(firm_uop) *)&m_eventMask;
  703. escr.ESCREventSelect= 0x04;
  704. cccr.CCCRSelect= 0x01;
  705. // eventType=EVENT_TYPE(firm_uop);
  706. description=_T("x87_FP_uop");
  707. UseCounter8();
  708. }
  709. void UseCounter8()
  710. {
  711. SetCounter(8);
  712. }
  713. void UseCounter9()
  714. {
  715. SetCounter(9);
  716. }
  717. void UseCounter10()
  718. {
  719. SetCounter(10);
  720. }
  721. void UseCounter11()
  722. {
  723. SetCounter(11);
  724. }
  725. };
  726. class P4Event_x87_SIMD_moves_uop: public P4BaseEvent
  727. {
  728. public:
  729. EVENT_MASK(x87_SIMD_moves_uop) * eventMask;
  730. P4Event_x87_SIMD_moves_uop()
  731. {
  732. eventMask = (EVENT_MASK(x87_SIMD_moves_uop) *)&m_eventMask;
  733. escr.ESCREventSelect= 0x2E;
  734. cccr.CCCRSelect= 0;
  735. // eventType=EVENT_TYPE(x87_SIMD_moves_uop);
  736. description=_T("x87_SIMD_moves_uop");
  737. UseCounter8();
  738. }
  739. void UseCounter8()
  740. {
  741. SetCounter(8);
  742. }
  743. void UseCounter9()
  744. {
  745. SetCounter(9);
  746. }
  747. void UseCounter10()
  748. {
  749. SetCounter(10);
  750. }
  751. void UseCounter11()
  752. {
  753. SetCounter(11);
  754. }
  755. };
  756. class P4Event_TC_misc: public P4BaseEvent
  757. {
  758. public:
  759. EVENT_MASK(TC_misc) * eventMask;
  760. P4Event_TC_misc()
  761. {
  762. eventMask = (EVENT_MASK(TC_misc) *)&m_eventMask;
  763. escr.ESCREventSelect= 0x06;
  764. cccr.CCCRSelect= 0x01;
  765. // eventType=EVENT_TYPE(TC_misc);
  766. description=_T("TC_misc");
  767. UseCounter4();
  768. }
  769. void UseCounter4()
  770. {
  771. SetCounter(4);;
  772. }
  773. void UseCounter5()
  774. {
  775. SetCounter(5);
  776. }
  777. void UseCounter6()
  778. {
  779. SetCounter(6);
  780. }
  781. void UseCounter7()
  782. {
  783. SetCounter(7);
  784. }
  785. };
  786. class P4Event_global_power_events: public P4BaseEvent
  787. {
  788. public:
  789. EVENT_MASK(global_power_events) * eventMask;
  790. P4Event_global_power_events()
  791. {
  792. eventMask = (EVENT_MASK(global_power_events) *)&m_eventMask;
  793. escr.ESCREventSelect= 0x13;
  794. cccr.CCCRSelect= 0x06;
  795. // eventType=EVENT_TYPE(global_power_events);
  796. description=_T("global_power_events");
  797. UseCounter0();
  798. }
  799. void UseCounter0()
  800. {
  801. SetCounter(0);
  802. }
  803. void UseCounter1()
  804. {
  805. SetCounter(1);
  806. }
  807. void UseCounter2()
  808. {
  809. SetCounter(2);
  810. }
  811. void UseCounter3()
  812. {
  813. SetCounter(3);
  814. }
  815. };
  816. class P4Event_tc_ms_xfer: public P4BaseEvent
  817. {
  818. public:
  819. EVENT_MASK(tc_ms_xfer) * eventMask;
  820. P4Event_tc_ms_xfer()
  821. {
  822. eventMask = (EVENT_MASK(tc_ms_xfer) *)&m_eventMask;
  823. escr.ESCREventSelect= 0x05;
  824. cccr.CCCRSelect= 0x00;
  825. // eventType=EVENT_TYPE(tc_ms_xfer);
  826. description=_T("tc_ms_xfer");
  827. UseCounter4();
  828. }
  829. void UseCounter4()
  830. {
  831. SetCounter(4);;
  832. }
  833. void UseCounter5()
  834. {
  835. SetCounter(5);
  836. }
  837. void UseCounter6()
  838. {
  839. SetCounter(6);
  840. }
  841. void UseCounter7()
  842. {
  843. SetCounter(7);
  844. }
  845. };
  846. class P4Event_uop_queue_writes: public P4BaseEvent
  847. {
  848. public:
  849. EVENT_MASK(uop_queue_writes) * eventMask;
  850. P4Event_uop_queue_writes()
  851. {
  852. eventMask = (EVENT_MASK(uop_queue_writes) *)&m_eventMask;
  853. escr.ESCREventSelect= 0x09;
  854. cccr.CCCRSelect= 0x00;
  855. // eventType=EVENT_TYPE(uop_queue_writes);
  856. description=_T("uop_queue_writes");
  857. UseCounter4();
  858. }
  859. void UseCounter4()
  860. {
  861. SetCounter(4);;
  862. }
  863. void UseCounter5()
  864. {
  865. SetCounter(5);
  866. }
  867. void UseCounter6()
  868. {
  869. SetCounter(6);
  870. }
  871. void UseCounter7()
  872. {
  873. SetCounter(7);
  874. }
  875. };
  876. class P4Event_retired_mispred_branch_type: public P4BaseEvent
  877. {
  878. public:
  879. EVENT_MASK(branch_type) * eventMask;
  880. P4Event_retired_mispred_branch_type()
  881. {
  882. eventMask = (EVENT_MASK(branch_type) *)&m_eventMask;
  883. escr.ESCREventSelect= 0x05;
  884. cccr.CCCRSelect= 0x02;
  885. // eventType=EVENT_TYPE(branch_type);
  886. description=_T("retired_mispred_branch_type");
  887. UseCounter4();
  888. }
  889. void UseCounter4()
  890. {
  891. SetCounter(4);;
  892. }
  893. void UseCounter5()
  894. {
  895. SetCounter(5);
  896. }
  897. void UseCounter6()
  898. {
  899. SetCounter(6);
  900. }
  901. void UseCounter7()
  902. {
  903. SetCounter(7);
  904. }
  905. };
  906. class P4Event_retired_branch_type: public P4BaseEvent
  907. {
  908. public:
  909. EVENT_MASK(branch_type) * eventMask;
  910. P4Event_retired_branch_type()
  911. {
  912. eventMask = (EVENT_MASK(branch_type) *)&m_eventMask;
  913. escr.ESCREventSelect= 0x04;
  914. cccr.CCCRSelect= 0x04;
  915. // eventType=EVENT_TYPE(branch_type);
  916. description=_T("retired_branch_type");
  917. UseCounter4();
  918. }
  919. void UseCounter4()
  920. {
  921. SetCounter(4);;
  922. }
  923. void UseCounter5()
  924. {
  925. SetCounter(5);
  926. }
  927. void UseCounter6()
  928. {
  929. SetCounter(6);
  930. }
  931. void UseCounter7()
  932. {
  933. SetCounter(7);
  934. }
  935. };
  936. class P4Event_resource_stall: public P4BaseEvent
  937. {
  938. public:
  939. EVENT_MASK(resource_stall) * eventMask;
  940. P4Event_resource_stall()
  941. {
  942. eventMask = (EVENT_MASK(resource_stall) *)&m_eventMask;
  943. escr.ESCREventSelect= 0x01;
  944. cccr.CCCRSelect= 0x02;
  945. // eventType=EVENT_TYPE(resource_stall);
  946. description=_T("resource_stall");
  947. UseCounter12();
  948. }
  949. void UseCounter12()
  950. {
  951. SetCounter(12);
  952. }
  953. void UseCounter13()
  954. {
  955. SetCounter(13);
  956. }
  957. void UseCounter14()
  958. {
  959. SetCounter(14);
  960. }
  961. void UseCounter15()
  962. {
  963. SetCounter(15);
  964. }
  965. void UseCounter16()
  966. {
  967. SetCounter(16);
  968. }
  969. void UseCounter17()
  970. {
  971. SetCounter(17);
  972. }
  973. };
  974. class P4Event_WC_Buffer: public P4BaseEvent
  975. {
  976. public:
  977. EVENT_MASK(WC_Buffer) * eventMask;
  978. P4Event_WC_Buffer()
  979. {
  980. eventMask = (EVENT_MASK(WC_Buffer) *)&m_eventMask;
  981. escr.ESCREventSelect= 0x05;
  982. cccr.CCCRSelect= 0x05;
  983. // eventType=EVENT_TYPE(WC_Buffer);
  984. description=_T("WC_Buffer");
  985. UseCounter8();
  986. }
  987. void UseCounter8()
  988. {
  989. SetCounter(8);
  990. }
  991. void UseCounter9()
  992. {
  993. SetCounter(9);
  994. }
  995. void UseCounter10()
  996. {
  997. SetCounter(10);
  998. }
  999. void UseCounter11()
  1000. {
  1001. SetCounter(11);
  1002. }
  1003. };
  1004. class P4Event_b2b_cycles: public P4BaseEvent
  1005. {
  1006. public:
  1007. EVENT_MASK(b2b_cycles) * eventMask;
  1008. P4Event_b2b_cycles()
  1009. {
  1010. eventMask = (EVENT_MASK(b2b_cycles) *)&m_eventMask;
  1011. escr.ESCREventSelect= 0x16;
  1012. cccr.CCCRSelect= 0x03;
  1013. // eventType=EVENT_TYPE(b2b_cycles);
  1014. description=_T("b2b_cycles");
  1015. UseCounter0();
  1016. }
  1017. void UseCounter0()
  1018. {
  1019. SetCounter(0);
  1020. }
  1021. void UseCounter1()
  1022. {
  1023. SetCounter(1);
  1024. }
  1025. void UseCounter2()
  1026. {
  1027. SetCounter(2);
  1028. }
  1029. void UseCounter3()
  1030. {
  1031. SetCounter(3);
  1032. }
  1033. };
  1034. class P4Event_bnr: public P4BaseEvent
  1035. {
  1036. public:
  1037. EVENT_MASK(bnr) * eventMask;
  1038. P4Event_bnr()
  1039. {
  1040. eventMask = (EVENT_MASK(bnr) *)&m_eventMask;
  1041. escr.ESCREventSelect= 0x08;
  1042. cccr.CCCRSelect= 0x03;
  1043. // eventType=EVENT_TYPE(bnr);
  1044. description=_T("bnr");
  1045. UseCounter0();
  1046. }
  1047. void UseCounter0()
  1048. {
  1049. SetCounter(0);
  1050. }
  1051. void UseCounter1()
  1052. {
  1053. SetCounter(1);
  1054. }
  1055. void UseCounter2()
  1056. {
  1057. SetCounter(2);
  1058. }
  1059. void UseCounter3()
  1060. {
  1061. SetCounter(3);
  1062. }
  1063. };
  1064. class P4Event_snoop: public P4BaseEvent
  1065. {
  1066. public:
  1067. EVENT_MASK(snoop) * eventMask;
  1068. P4Event_snoop()
  1069. {
  1070. eventMask = (EVENT_MASK(snoop) *)&m_eventMask;
  1071. escr.ESCREventSelect= 0x06;
  1072. cccr.CCCRSelect= 0x03;
  1073. // eventType=EVENT_TYPE(snoop);
  1074. description=_T("snoop");
  1075. UseCounter0();
  1076. }
  1077. void UseCounter0()
  1078. {
  1079. SetCounter(0);
  1080. }
  1081. void UseCounter1()
  1082. {
  1083. SetCounter(1);
  1084. }
  1085. void UseCounter2()
  1086. {
  1087. SetCounter(2);
  1088. }
  1089. void UseCounter3()
  1090. {
  1091. SetCounter(3);
  1092. }
  1093. };
  1094. class P4Event_response: public P4BaseEvent
  1095. {
  1096. public:
  1097. EVENT_MASK(response) * eventMask;
  1098. P4Event_response()
  1099. {
  1100. eventMask = (EVENT_MASK(response) *)&m_eventMask;
  1101. escr.ESCREventSelect= 0x04;
  1102. cccr.CCCRSelect= 0x03;
  1103. // eventType=EVENT_TYPE(response);
  1104. description=_T("response");
  1105. UseCounter0();
  1106. }
  1107. void UseCounter0()
  1108. {
  1109. SetCounter(0);
  1110. }
  1111. void UseCounter1()
  1112. {
  1113. SetCounter(1);
  1114. }
  1115. void UseCounter2()
  1116. {
  1117. SetCounter(2);
  1118. }
  1119. void UseCounter3()
  1120. {
  1121. SetCounter(3);
  1122. }
  1123. };
  1124. class P4Event_front_end_event: public P4BaseEvent
  1125. {
  1126. public:
  1127. EVENT_MASK(nbogus_bogus) * eventMask;
  1128. P4Event_front_end_event()
  1129. {
  1130. eventMask = (EVENT_MASK(nbogus_bogus) *)&m_eventMask;
  1131. escr.ESCREventSelect= 0x08;
  1132. cccr.CCCRSelect= 0x05;
  1133. // eventType=EVENT_TYPE(nbogus_bogus);
  1134. description=_T("front_end_event");
  1135. UseCounter12();
  1136. }
  1137. void UseCounter12()
  1138. {
  1139. SetCounter(12);
  1140. }
  1141. void UseCounter13()
  1142. {
  1143. SetCounter(13);
  1144. }
  1145. void UseCounter14()
  1146. {
  1147. SetCounter(14);
  1148. }
  1149. void UseCounter15()
  1150. {
  1151. SetCounter(15);
  1152. }
  1153. void UseCounter16()
  1154. {
  1155. SetCounter(16);
  1156. }
  1157. void UseCounter17()
  1158. {
  1159. SetCounter(17);
  1160. }
  1161. };
  1162. class P4Event_execution_event: public P4BaseEvent
  1163. {
  1164. public:
  1165. EVENT_MASK(execution_event) * eventMask;
  1166. P4Event_execution_event()
  1167. {
  1168. eventMask = (EVENT_MASK(execution_event) *)&m_eventMask;
  1169. escr.ESCREventSelect= 0x0C;
  1170. cccr.CCCRSelect= 0x05;
  1171. // eventType=EVENT_TYPE(execution_event);
  1172. description=_T("execution_event");
  1173. UseCounter12();
  1174. }
  1175. void UseCounter12()
  1176. {
  1177. SetCounter(12);
  1178. }
  1179. void UseCounter13()
  1180. {
  1181. SetCounter(13);
  1182. }
  1183. void UseCounter14()
  1184. {
  1185. SetCounter(14);
  1186. }
  1187. void UseCounter15()
  1188. {
  1189. SetCounter(15);
  1190. }
  1191. void UseCounter16()
  1192. {
  1193. SetCounter(16);
  1194. }
  1195. void UseCounter17()
  1196. {
  1197. SetCounter(17);
  1198. }
  1199. };
  1200. class P4Event_replay_event: public P4BaseEvent
  1201. {
  1202. public:
  1203. EVENT_MASK(nbogus_bogus) * eventMask;
  1204. P4Event_replay_event()
  1205. {
  1206. eventMask = (EVENT_MASK(nbogus_bogus) *)&m_eventMask;
  1207. escr.ESCREventSelect= 0x09;
  1208. cccr.CCCRSelect= 0x05;
  1209. // eventType=EVENT_TYPE(nbogus_bogus);
  1210. description=_T("replay_event");
  1211. UseCounter12();
  1212. }
  1213. void UseCounter12()
  1214. {
  1215. SetCounter(12);
  1216. }
  1217. void UseCounter13()
  1218. {
  1219. SetCounter(13);
  1220. }
  1221. void UseCounter14()
  1222. {
  1223. SetCounter(14);
  1224. }
  1225. void UseCounter15()
  1226. {
  1227. SetCounter(15);
  1228. }
  1229. void UseCounter16()
  1230. {
  1231. SetCounter(16);
  1232. }
  1233. void UseCounter17()
  1234. {
  1235. SetCounter(17);
  1236. }
  1237. };
  1238. class P4Event_instr_retired: public P4BaseEvent
  1239. {
  1240. public:
  1241. EVENT_MASK(instr_retired) * eventMask;
  1242. P4Event_instr_retired()
  1243. {
  1244. eventMask = (EVENT_MASK(instr_retired) *)&m_eventMask;
  1245. escr.ESCREventSelect= 0x02;
  1246. cccr.CCCRSelect= 0x04;
  1247. // eventType=EVENT_TYPE(instr_retired);
  1248. description=_T("instr_retired");
  1249. UseCounter12();
  1250. }
  1251. void UseCounter12()
  1252. {
  1253. SetCounter(12);
  1254. }
  1255. void UseCounter13()
  1256. {
  1257. SetCounter(13);
  1258. }
  1259. void UseCounter14()
  1260. {
  1261. SetCounter(14);
  1262. }
  1263. void UseCounter15()
  1264. {
  1265. SetCounter(15);
  1266. }
  1267. void UseCounter16()
  1268. {
  1269. SetCounter(16);
  1270. }
  1271. void UseCounter17()
  1272. {
  1273. SetCounter(17);
  1274. }
  1275. };
  1276. class P4Event_uops_retired: public P4BaseEvent
  1277. {
  1278. public:
  1279. EVENT_MASK(nbogus_bogus) * eventMask;
  1280. P4Event_uops_retired()
  1281. {
  1282. eventMask = (EVENT_MASK(nbogus_bogus) *)&m_eventMask;
  1283. escr.ESCREventSelect= 0x01;
  1284. cccr.CCCRSelect= 0x04;
  1285. // eventType=EVENT_TYPE(nbogus_bogus);
  1286. description=_T("uops_retired");
  1287. UseCounter12();
  1288. }
  1289. void UseCounter12()
  1290. {
  1291. SetCounter(12);
  1292. }
  1293. void UseCounter13()
  1294. {
  1295. SetCounter(13);
  1296. }
  1297. void UseCounter14()
  1298. {
  1299. SetCounter(14);
  1300. }
  1301. void UseCounter15()
  1302. {
  1303. SetCounter(15);
  1304. }
  1305. void UseCounter16()
  1306. {
  1307. SetCounter(16);
  1308. }
  1309. void UseCounter17()
  1310. {
  1311. SetCounter(17);
  1312. }
  1313. };
  1314. class P4Event_uop_type: public P4BaseEvent
  1315. {
  1316. public:
  1317. EVENT_MASK(uop_type) * eventMask;
  1318. P4Event_uop_type()
  1319. {
  1320. eventMask = (EVENT_MASK(uop_type) *)&m_eventMask;
  1321. escr.ESCREventSelect= 0x02;
  1322. cccr.CCCRSelect= 0x02;
  1323. // eventType=EVENT_TYPE(uop_type);
  1324. description=_T("uop_type");
  1325. UseCounter12();
  1326. }
  1327. void UseCounter12()
  1328. {
  1329. SetCounter(12);
  1330. }
  1331. void UseCounter13()
  1332. {
  1333. SetCounter(13);
  1334. }
  1335. void UseCounter14()
  1336. {
  1337. SetCounter(14);
  1338. }
  1339. void UseCounter15()
  1340. {
  1341. SetCounter(15);
  1342. }
  1343. void UseCounter16()
  1344. {
  1345. SetCounter(16);
  1346. }
  1347. void UseCounter17()
  1348. {
  1349. SetCounter(17);
  1350. }
  1351. };
  1352. class P4Event_branch_retired: public P4BaseEvent
  1353. {
  1354. public:
  1355. EVENT_MASK(branch_retired) * eventMask;
  1356. P4Event_branch_retired()
  1357. {
  1358. eventMask = (EVENT_MASK(branch_retired) *)&m_eventMask;
  1359. escr.ESCREventSelect= 0x06;
  1360. cccr.CCCRSelect= 0x05;
  1361. // eventType=EVENT_TYPE(branch_retired);
  1362. description=_T("branch_retired");
  1363. UseCounter12();
  1364. }
  1365. void UseCounter12()
  1366. {
  1367. SetCounter(12);
  1368. }
  1369. void UseCounter13()
  1370. {
  1371. SetCounter(13);
  1372. }
  1373. void UseCounter14()
  1374. {
  1375. SetCounter(14);
  1376. }
  1377. void UseCounter15()
  1378. {
  1379. SetCounter(15);
  1380. }
  1381. void UseCounter16()
  1382. {
  1383. SetCounter(16);
  1384. }
  1385. void UseCounter17()
  1386. {
  1387. SetCounter(17);
  1388. }
  1389. };
  1390. class P4Event_mispred_branch_retired: public P4BaseEvent
  1391. {
  1392. public:
  1393. EVENT_MASK(mispred_branch_retired) * eventMask;
  1394. P4Event_mispred_branch_retired()
  1395. {
  1396. eventMask = (EVENT_MASK(mispred_branch_retired) *)&m_eventMask;
  1397. escr.ESCREventSelect= 0x03;
  1398. cccr.CCCRSelect= 0x04;
  1399. // eventType=EVENT_TYPE(mispred_branch_retired);
  1400. description=_T("mispred_branch_retired");
  1401. UseCounter12();
  1402. }
  1403. void UseCounter12()
  1404. {
  1405. SetCounter(12);
  1406. }
  1407. void UseCounter13()
  1408. {
  1409. SetCounter(13);
  1410. }
  1411. void UseCounter14()
  1412. {
  1413. SetCounter(14);
  1414. }
  1415. void UseCounter15()
  1416. {
  1417. SetCounter(15);
  1418. }
  1419. void UseCounter16()
  1420. {
  1421. SetCounter(16);
  1422. }
  1423. void UseCounter17()
  1424. {
  1425. SetCounter(17);
  1426. }
  1427. };
  1428. class P4Event_x87_assist: public P4BaseEvent
  1429. {
  1430. public:
  1431. EVENT_MASK(x87_assist) * eventMask;
  1432. P4Event_x87_assist()
  1433. {
  1434. eventMask = (EVENT_MASK(x87_assist) *)&m_eventMask;
  1435. escr.ESCREventSelect= 0x03;
  1436. cccr.CCCRSelect= 0x05;
  1437. // eventType=EVENT_TYPE(x87_assist);
  1438. description=_T("x87_assist");
  1439. UseCounter12();
  1440. }
  1441. void UseCounter12()
  1442. {
  1443. SetCounter(12);
  1444. }
  1445. void UseCounter13()
  1446. {
  1447. SetCounter(13);
  1448. }
  1449. void UseCounter14()
  1450. {
  1451. SetCounter(14);
  1452. }
  1453. void UseCounter15()
  1454. {
  1455. SetCounter(15);
  1456. }
  1457. void UseCounter16()
  1458. {
  1459. SetCounter(16);
  1460. }
  1461. void UseCounter17()
  1462. {
  1463. SetCounter(17);
  1464. }
  1465. };
  1466. class P4Event_machine_clear: public P4BaseEvent
  1467. {
  1468. public:
  1469. EVENT_MASK(machine_clear) * eventMask;
  1470. P4Event_machine_clear()
  1471. {
  1472. eventMask = (EVENT_MASK(machine_clear) *)&m_eventMask;
  1473. escr.ESCREventSelect= 0x02;
  1474. cccr.CCCRSelect= 0x05;
  1475. // eventType=EVENT_TYPE(machine_clear);
  1476. description=_T("machine_clear");
  1477. UseCounter12();
  1478. }
  1479. void UseCounter12()
  1480. {
  1481. SetCounter(12);
  1482. }
  1483. void UseCounter13()
  1484. {
  1485. SetCounter(13);
  1486. }
  1487. void UseCounter14()
  1488. {
  1489. SetCounter(14);
  1490. }
  1491. void UseCounter15()
  1492. {
  1493. SetCounter(15);
  1494. }
  1495. void UseCounter16()
  1496. {
  1497. SetCounter(16);
  1498. }
  1499. void UseCounter17()
  1500. {
  1501. SetCounter(17);
  1502. }
  1503. };
  1504. #endif // EVENTMODES_H