replace sparc-specific Int64 code with calls to platform-independent macros
[ghc-hetmet.git] / includes / stg / Ticky.h
1 /* -----------------------------------------------------------------------------
2  *
3  * (c) The GHC Team, 2007
4  *
5  * Declarations for counters used by ticky-ticky profiling.
6  *
7  * -------------------------------------------------------------------------- */
8
9
10 #ifndef TICKYCOUNTERS_H
11 #define TICKYCOUNTERS_H
12
13 /* These should probably be automatically generated in order to
14    keep them consistent with the macros that use them (which are
15    defined in Cmm.h. */
16
17 #ifdef TICKY_TICKY
18 /* same trick as in the former StgTicky.h: recycle the same declarations
19    for both extern decls (which are included everywhere)
20    and initializations (which only happen once) */
21 #ifdef TICKY_C
22 #define INIT(ializer) = ializer
23 #define EXTERN
24 #else
25 #define INIT(ializer)
26 #define EXTERN extern
27 #endif
28
29 /* Here are all the counter declarations: */
30
31 EXTERN StgInt ENT_VIA_NODE_ctr INIT(0);
32 EXTERN StgInt ENT_STATIC_THK_ctr INIT(0);
33 EXTERN StgInt ENT_DYN_THK_ctr INIT(0);
34 EXTERN StgInt ENT_STATIC_FUN_DIRECT_ctr INIT(0);
35 EXTERN StgInt ENT_DYN_FUN_DIRECT_ctr INIT(0);
36 EXTERN StgInt ENT_STATIC_CON_ctr INIT(0);
37 EXTERN StgInt ENT_DYN_CON_ctr INIT(0);
38 EXTERN StgInt ENT_STATIC_IND_ctr INIT(0);
39 EXTERN StgInt ENT_DYN_IND_ctr INIT(0);
40 EXTERN StgInt ENT_PERM_IND_ctr INIT(0);
41 EXTERN StgInt ENT_PAP_ctr INIT(0);
42 EXTERN StgInt ENT_AP_ctr INIT(0);
43 EXTERN StgInt ENT_AP_STACK_ctr INIT(0);
44 EXTERN StgInt ENT_BH_ctr INIT(0);
45
46 EXTERN StgInt UNKNOWN_CALL_ctr INIT(0);
47
48 EXTERN StgInt SLOW_CALL_v_ctr INIT(0);
49 EXTERN StgInt SLOW_CALL_f_ctr INIT(0);
50 EXTERN StgInt SLOW_CALL_d_ctr INIT(0);
51 EXTERN StgInt SLOW_CALL_l_ctr INIT(0);
52 EXTERN StgInt SLOW_CALL_n_ctr INIT(0);
53 EXTERN StgInt SLOW_CALL_p_ctr INIT(0);
54 EXTERN StgInt SLOW_CALL_pv_ctr INIT(0);
55 EXTERN StgInt SLOW_CALL_pp_ctr INIT(0);
56 EXTERN StgInt SLOW_CALL_ppv_ctr INIT(0);
57 EXTERN StgInt SLOW_CALL_ppp_ctr INIT(0);
58 EXTERN StgInt SLOW_CALL_pppv_ctr INIT(0);
59 EXTERN StgInt SLOW_CALL_pppp_ctr INIT(0);
60 EXTERN StgInt SLOW_CALL_ppppp_ctr INIT(0);
61 EXTERN StgInt SLOW_CALL_pppppp_ctr INIT(0);
62 EXTERN StgInt SLOW_CALL_OTHER_ctr INIT(0);
63
64 EXTERN StgInt ticky_slow_call_unevald;
65 EXTERN StgInt SLOW_CALL_ctr INIT(0);
66 EXTERN StgInt MULTI_CHUNK_SLOW_CALL_ctr INIT(0);
67 EXTERN StgInt MULTI_CHUNK_SLOW_CALL_CHUNKS_ctr INIT(0);
68 EXTERN StgInt KNOWN_CALL_ctr INIT(0);
69 EXTERN StgInt KNOWN_CALL_TOO_FEW_ARGS_ctr INIT(0);
70 EXTERN StgInt KNOWN_CALL_EXTRA_ARGS_ctr INIT(0);
71 EXTERN StgInt SLOW_CALL_FUN_TOO_FEW_ctr INIT(0);
72 EXTERN StgInt SLOW_CALL_FUN_CORRECT_ctr INIT(0);
73 EXTERN StgInt SLOW_CALL_FUN_TOO_MANY_ctr INIT(0);
74 EXTERN StgInt SLOW_CALL_PAP_TOO_FEW_ctr INIT(0);
75 EXTERN StgInt SLOW_CALL_PAP_CORRECT_ctr INIT(0);
76 EXTERN StgInt SLOW_CALL_PAP_TOO_MANY_ctr INIT(0);
77 EXTERN StgInt SLOW_CALL_UNEVALD_ctr INIT(0);
78
79
80 EXTERN StgInt UPDF_OMITTED_ctr INIT(0);
81 EXTERN StgInt UPDF_PUSHED_ctr INIT(0);
82 EXTERN StgInt CATCHF_PUSHED_ctr INIT(0);
83 EXTERN StgInt UPDF_RCC_PUSHED_ctr INIT(0);
84 EXTERN StgInt UPDF_RCC_OMITTED_ctr INIT(0);
85
86 EXTERN StgInt UPD_SQUEEZED_ctr INIT(0);
87 EXTERN StgInt UPD_CON_IN_NEW_ctr INIT(0);
88 EXTERN StgInt UPD_CON_IN_PLACE_ctr INIT(0);
89 EXTERN StgInt UPD_PAP_IN_NEW_ctr INIT(0);
90 EXTERN StgInt UPD_PAP_IN_PLACE_ctr INIT(0);
91
92 EXTERN StgInt ALLOC_HEAP_ctr INIT(0);
93 EXTERN StgInt ALLOC_HEAP_tot;
94
95 EXTERN StgInt ALLOC_FUN_ctr INIT(0);
96 EXTERN StgInt ALLOC_FUN_adm;
97 EXTERN StgInt ALLOC_FUN_gds;
98 EXTERN StgInt ALLOC_FUN_slp;
99
100 EXTERN StgInt UPD_NEW_IND_ctr INIT(0);
101 EXTERN StgInt UPD_NEW_PERM_IND_ctr INIT(0);
102 EXTERN StgInt UPD_OLD_IND_ctr INIT(0);
103 EXTERN StgInt UPD_OLD_PERM_IND_ctr INIT(0);
104
105 EXTERN StgInt UPD_BH_UPDATABLE_ctr INIT(0);
106 EXTERN StgInt UPD_BH_SINGLE_ENTRY_ctr INIT(0);
107 EXTERN StgInt UPD_CAF_BH_UPDATABLE_ctr INIT(0);
108 EXTERN StgInt UPD_CAF_BH_SINGLE_ENTRY_ctr INIT(0);
109
110 EXTERN StgInt GC_SEL_ABANDONED_ctr INIT(0);
111 EXTERN StgInt GC_SEL_MINOR_ctr INIT(0);
112 EXTERN StgInt GC_SEL_MAJOR_ctr INIT(0);
113
114 EXTERN StgInt GC_FAILED_PROMOTION_ctr INIT(0);
115
116 EXTERN StgInt GC_WORDS_COPIED_ctr INIT(0);
117
118 EXTERN StgInt ALLOC_UP_THK_ctr INIT(0);
119 EXTERN StgInt ALLOC_SE_THK_ctr INIT(0);
120 EXTERN StgInt ALLOC_THK_adm INIT(0);
121 EXTERN StgInt ALLOC_THK_gds INIT(0);
122 EXTERN StgInt ALLOC_THK_slp INIT(0);
123
124 EXTERN StgInt ALLOC_CON_ctr INIT(0);
125 EXTERN StgInt ALLOC_CON_adm INIT(0);
126 EXTERN StgInt ALLOC_CON_gds INIT(0);
127 EXTERN StgInt ALLOC_CON_slp INIT(0);
128
129 EXTERN StgInt ALLOC_TUP_ctr INIT(0);
130 EXTERN StgInt ALLOC_TUP_adm INIT(0);
131 EXTERN StgInt ALLOC_TUP_gds INIT(0);
132 EXTERN StgInt ALLOC_TUP_slp INIT(0);
133
134 EXTERN StgInt ALLOC_BH_ctr INIT(0);
135 EXTERN StgInt ALLOC_BH_adm INIT(0);
136 EXTERN StgInt ALLOC_BH_gds INIT(0);
137 EXTERN StgInt ALLOC_BH_slp INIT(0);
138
139 EXTERN StgInt ALLOC_PRIM_ctr INIT(0);
140 EXTERN StgInt ALLOC_PRIM_adm INIT(0);
141 EXTERN StgInt ALLOC_PRIM_gds INIT(0);
142 EXTERN StgInt ALLOC_PRIM_slp INIT(0);
143
144 EXTERN StgInt ALLOC_PAP_ctr INIT(0);
145 EXTERN StgInt ALLOC_PAP_adm INIT(0);
146 EXTERN StgInt ALLOC_PAP_gds INIT(0);
147 EXTERN StgInt ALLOC_PAP_slp INIT(0);
148
149 EXTERN StgInt ALLOC_TSO_ctr INIT(0);
150 EXTERN StgInt ALLOC_TSO_adm INIT(0);
151 EXTERN StgInt ALLOC_TSO_gds INIT(0);
152 EXTERN StgInt ALLOC_TSO_slp INIT(0);
153
154 EXTERN StgInt RET_NEW_ctr INIT(0);
155 EXTERN StgInt RET_OLD_ctr INIT(0);
156 EXTERN StgInt RET_UNBOXED_TUP_ctr INIT(0);
157
158 EXTERN StgInt RET_SEMI_loads_avoided INIT(0);
159
160 /* End of counter declarations. */
161
162 #endif /* TICKY_TICKY */
163
164 /* This is ugly, but the story is:
165    We got rid of StgTicky.h, which was previously
166    defining these macros for the benefit of C code
167    so, we define them here instead (to be no-ops).
168    (since those macros are only defined in Cmm.h) 
169
170    Note that these macros must be defined whether
171    TICKY_TICKY is defined or not. */
172   
173 #ifndef CMINUSMINUS
174 #define TICK_ALLOC_PRIM(x,y,z)
175 #define TICK_UPD_OLD_IND()
176 #define TICK_UPD_NEW_IND()
177 #define TICK_UPD_SQUEEZED()
178 #define TICK_ALLOC_HEAP_NOCTR(x)
179 #define TICK_GC_WORDS_COPIED(x)
180 #define TICK_GC_FAILED_PROMOTION()
181 #define TICK_ALLOC_TSO(g,s)
182 #define TICK_ALLOC_UP_THK(g,s)
183 #define TICK_ALLOC_SE_THK(g,s)
184
185 #endif
186
187
188 #endif /* TICKYCOUNTERS_H */