1 #ifndef __NVC0_QUERY_HW_SM_H__
2 #define __NVC0_QUERY_HW_SM_H__
3
4 #include "nvc0_query_hw.h"
5
6 struct nvc0_hw_sm_query {
7 struct nvc0_hw_query base;
8 uint8_t ctr[8];
9 };
10
11 static inline struct nvc0_hw_sm_query *
nvc0_hw_sm_query(struct nvc0_hw_query * hq)12 nvc0_hw_sm_query(struct nvc0_hw_query *hq)
13 {
14 return (struct nvc0_hw_sm_query *)hq;
15 }
16
17 /*
18 * Performance counter queries:
19 */
20 #define NVC0_HW_SM_QUERY(i) (PIPE_QUERY_DRIVER_SPECIFIC + (i))
21 #define NVC0_HW_SM_QUERY_LAST NVC0_HW_SM_QUERY(NVC0_HW_SM_QUERY_COUNT - 1)
22 enum nvc0_hw_sm_queries
23 {
24 NVC0_HW_SM_QUERY_ACTIVE_CTAS = 0,
25 NVC0_HW_SM_QUERY_ACTIVE_CYCLES,
26 NVC0_HW_SM_QUERY_ACTIVE_WARPS,
27 NVC0_HW_SM_QUERY_ATOM_CAS_COUNT,
28 NVC0_HW_SM_QUERY_ATOM_COUNT,
29 NVC0_HW_SM_QUERY_BRANCH,
30 NVC0_HW_SM_QUERY_DIVERGENT_BRANCH,
31 NVC0_HW_SM_QUERY_GLD_REQUEST,
32 NVC0_HW_SM_QUERY_GLD_MEM_DIV_REPLAY,
33 NVC0_HW_SM_QUERY_GLOBAL_ATOM_CAS,
34 NVC0_HW_SM_QUERY_GLOBAL_LD,
35 NVC0_HW_SM_QUERY_GLOBAL_ST,
36 NVC0_HW_SM_QUERY_GST_TRANSACTIONS,
37 NVC0_HW_SM_QUERY_GST_MEM_DIV_REPLAY,
38 NVC0_HW_SM_QUERY_GRED_COUNT,
39 NVC0_HW_SM_QUERY_GST_REQUEST,
40 NVC0_HW_SM_QUERY_INST_EXECUTED,
41 NVC0_HW_SM_QUERY_INST_ISSUED,
42 NVC0_HW_SM_QUERY_INST_ISSUED0,
43 NVC0_HW_SM_QUERY_INST_ISSUED1,
44 NVC0_HW_SM_QUERY_INST_ISSUED2,
45 NVC0_HW_SM_QUERY_INST_ISSUED1_0,
46 NVC0_HW_SM_QUERY_INST_ISSUED1_1,
47 NVC0_HW_SM_QUERY_INST_ISSUED2_0,
48 NVC0_HW_SM_QUERY_INST_ISSUED2_1,
49 NVC0_HW_SM_QUERY_L1_GLD_HIT,
50 NVC0_HW_SM_QUERY_L1_GLD_MISS,
51 NVC0_HW_SM_QUERY_L1_GLD_TRANSACTIONS,
52 NVC0_HW_SM_QUERY_L1_GST_TRANSACTIONS,
53 NVC0_HW_SM_QUERY_L1_LOCAL_LD_HIT,
54 NVC0_HW_SM_QUERY_L1_LOCAL_LD_MISS,
55 NVC0_HW_SM_QUERY_L1_LOCAL_ST_HIT,
56 NVC0_HW_SM_QUERY_L1_LOCAL_ST_MISS,
57 NVC0_HW_SM_QUERY_L1_SHARED_LD_TRANSACTIONS,
58 NVC0_HW_SM_QUERY_L1_SHARED_ST_TRANSACTIONS,
59 NVC0_HW_SM_QUERY_LOCAL_LD,
60 NVC0_HW_SM_QUERY_LOCAL_LD_TRANSACTIONS,
61 NVC0_HW_SM_QUERY_LOCAL_ST,
62 NVC0_HW_SM_QUERY_LOCAL_ST_TRANSACTIONS,
63 NVC0_HW_SM_QUERY_NOT_PRED_OFF_INST_EXECUTED,
64 NVC0_HW_SM_QUERY_PROF_TRIGGER_0,
65 NVC0_HW_SM_QUERY_PROF_TRIGGER_1,
66 NVC0_HW_SM_QUERY_PROF_TRIGGER_2,
67 NVC0_HW_SM_QUERY_PROF_TRIGGER_3,
68 NVC0_HW_SM_QUERY_PROF_TRIGGER_4,
69 NVC0_HW_SM_QUERY_PROF_TRIGGER_5,
70 NVC0_HW_SM_QUERY_PROF_TRIGGER_6,
71 NVC0_HW_SM_QUERY_PROF_TRIGGER_7,
72 NVC0_HW_SM_QUERY_SHARED_ATOM,
73 NVC0_HW_SM_QUERY_SHARED_ATOM_CAS,
74 NVC0_HW_SM_QUERY_SHARED_LD,
75 NVC0_HW_SM_QUERY_SHARED_LD_BANK_CONFLICT,
76 NVC0_HW_SM_QUERY_SHARED_LD_REPLAY,
77 NVC0_HW_SM_QUERY_SHARED_LD_TRANSACTIONS,
78 NVC0_HW_SM_QUERY_SHARED_ST,
79 NVC0_HW_SM_QUERY_SHARED_ST_BANK_CONFLICT,
80 NVC0_HW_SM_QUERY_SHARED_ST_REPLAY,
81 NVC0_HW_SM_QUERY_SHARED_ST_TRANSACTIONS,
82 NVC0_HW_SM_QUERY_SM_CTA_LAUNCHED,
83 NVC0_HW_SM_QUERY_THREADS_LAUNCHED,
84 NVC0_HW_SM_QUERY_TH_INST_EXECUTED,
85 NVC0_HW_SM_QUERY_TH_INST_EXECUTED_0,
86 NVC0_HW_SM_QUERY_TH_INST_EXECUTED_1,
87 NVC0_HW_SM_QUERY_TH_INST_EXECUTED_2,
88 NVC0_HW_SM_QUERY_TH_INST_EXECUTED_3,
89 NVC0_HW_SM_QUERY_UNCACHED_GLD_TRANSACTIONS,
90 NVC0_HW_SM_QUERY_WARPS_LAUNCHED,
91 NVC0_HW_SM_QUERY_COUNT
92 };
93
94 struct nvc0_hw_query *
95 nvc0_hw_sm_create_query(struct nvc0_context *, unsigned);
96 int
97 nvc0_hw_sm_get_driver_query_info(struct nvc0_screen *, unsigned,
98 struct pipe_driver_query_info *);
99 unsigned
100 nvc0_hw_sm_get_num_queries(struct nvc0_screen *);
101
102 #endif
103