1 /* ----------------------------------------------------------------------------
3 * (c) The AQUA project, Glasgow University, 1994-1997
4 * (c) The GHC Team, 1998-1999
6 * Ticky-ticky profiling macros.
8 * -------------------------------------------------------------------------- */
13 /* -----------------------------------------------------------------------------
14 The StgEntCounter type - needed regardless of TICKY_TICKY
15 -------------------------------------------------------------------------- */
17 typedef struct _StgEntCounter {
18 StgWord16 registeredp; /* 0 == no, 1 == yes */
19 StgWord16 arity; /* arity (static info) */
20 StgWord16 stk_args; /* # of args off stack */
21 /* (rest of args are in registers) */
22 char *str; /* name of the thing */
23 char *arg_kinds; /* info about the args types */
24 StgInt entry_count; /* Trips to fast entry code */
25 StgInt allocs; /* number of allocations by this fun */
26 struct _StgEntCounter *link;/* link to chain them all together */
32 /* -----------------------------------------------------------------------------
34 -------------------------------------------------------------------------- */
36 /* How many times we do a heap check and move Hp; comparing this with
37 * the allocations gives an indication of how many things we get per trip
40 #define TICK_ALLOC_HEAP(n, f_ct) \
44 ALLOC_HEAP_tot += (n); \
47 #define TICK_ALLOC_HEAP_NOCTR(n) \
50 ALLOC_HEAP_tot += (n); \
53 /* We count things every time we allocate something in the dynamic heap.
54 * For each, we count the number of words of (1) ``admin'' (header),
55 * (2) good stuff (useful pointers and data), and (3) ``slop'' (extra
56 * space, to leave room for an old generation indirection for example).
58 * The first five macros are inserted when the compiler generates code
59 * to allocate something; the categories correspond to the @ClosureClass@
60 * datatype (manifest functions, thunks, constructors, big tuples, and
61 * partial applications).
64 #define _HS sizeofW(StgHeader)
66 #define TICK_ALLOC_FUN(g,s) \
67 ALLOC_FUN_ctr++; ALLOC_FUN_adm += _HS; \
68 ALLOC_FUN_gds += (g); ALLOC_FUN_slp += (s); \
69 TICK_ALLOC_HISTO(FUN,_HS,g,s)
71 #define TICK_ALLOC_UP_THK(g,s) \
72 ALLOC_UP_THK_ctr++; ALLOC_THK_adm += _HS; \
73 ALLOC_THK_gds += (g); ALLOC_THK_slp += (s); \
74 TICK_ALLOC_HISTO(THK,_HS,g,s)
76 #define TICK_ALLOC_SE_THK(g,s) \
77 ALLOC_SE_THK_ctr++; ALLOC_THK_adm += _HS; \
78 ALLOC_THK_gds += (g); ALLOC_THK_slp += (s); \
79 TICK_ALLOC_HISTO(THK,_HS,g,s)
81 #define TICK_ALLOC_CON(g,s) \
82 ALLOC_CON_ctr++; ALLOC_CON_adm += _HS; \
83 ALLOC_CON_gds += (g); ALLOC_CON_slp += (s); \
84 TICK_ALLOC_HISTO(CON,_HS,g,s)
86 #define TICK_ALLOC_TUP(g,s) \
87 ALLOC_TUP_ctr++; ALLOC_TUP_adm += _HS; \
88 ALLOC_TUP_gds += (g); ALLOC_TUP_slp += (s); \
89 TICK_ALLOC_HISTO(TUP,_HS,g,s)
91 #define TICK_ALLOC_BH(g,s) \
92 ALLOC_BH_ctr++; ALLOC_BH_adm += _HS; \
93 ALLOC_BH_gds += (g); ALLOC_BH_slp += (s); \
94 TICK_ALLOC_HISTO(BH,_HS,g,s)
97 * admin size doesn't take into account the FUN, that is accounted for
100 #define TICK_ALLOC_PAP(g,s) \
101 ALLOC_PAP_ctr++; ALLOC_PAP_adm += sizeofW(StgPAP)-1; \
102 ALLOC_PAP_gds += (g); ALLOC_PAP_slp += (s); \
103 TICK_ALLOC_HISTO(PAP,sizeofW(StgPAP)-1,g,s)
105 #define TICK_ALLOC_TSO(g,s) \
106 ALLOC_TSO_ctr++; ALLOC_TSO_adm += sizeofW(StgTSO); \
107 ALLOC_TSO_gds += (g); ALLOC_TSO_slp += (s); \
108 TICK_ALLOC_HISTO(TSO,sizeofW(StgTSO),g,s)
111 #define TICK_ALLOC_FMBQ(a,g,s) \
112 ALLOC_FMBQ_ctr++; ALLOC_FMBQ_adm += (a); \
113 ALLOC_FMBQ_gds += (g); ALLOC_FMBQ_slp += (s); \
114 TICK_ALLOC_HISTO(FMBQ,a,g,s)
116 #define TICK_ALLOC_FME(a,g,s) \
117 ALLOC_FME_ctr++; ALLOC_FME_adm += (a); \
118 ALLOC_FME_gds += (g); ALLOC_FME_slp += (s); \
119 TICK_ALLOC_HISTO(FME,a,g,s)
121 #define TICK_ALLOC_BF(a,g,s) \
122 ALLOC_BF_ctr++; ALLOC_BF_adm += (a); \
123 ALLOC_BF_gds += (g); ALLOC_BF_slp += (s); \
124 TICK_ALLOC_HISTO(BF,a,g,s)
127 /* The histogrammy bit is fairly straightforward; the -2 is: one for
128 * 0-origin C arrays; the other one because we do no one-word
129 * allocations, so we would never inc that histogram slot; so we shift
130 * everything over by one.
132 #define TICK_ALLOC_HISTO(categ,a,g,s) \
134 __idx = (a) + (g) + (s) - 2; \
135 ALLOC_##categ##_hst[((__idx > 4) ? 4 : __idx)] += 1;}
137 /* Some hard-to-account-for words are allocated by/for primitives,
138 * includes Integer support. ALLOC_PRIM2 tells us about these. We
139 * count everything as ``goods'', which is not strictly correct.
140 * (ALLOC_PRIM is the same sort of stuff, but we know the
141 * admin/goods/slop breakdown.)
143 #define TICK_ALLOC_PRIM(a,g,s) \
144 ALLOC_PRIM_ctr++; ALLOC_PRIM_adm += (a); \
145 ALLOC_PRIM_gds += (g); ALLOC_PRIM_slp += (s); \
146 TICK_ALLOC_HISTO(PRIM,a,g,s)
148 #define TICK_ALLOC_PRIM2(w) ALLOC_PRIM_ctr++; ALLOC_PRIM_gds +=(w); \
149 TICK_ALLOC_HISTO(PRIM,0,w,0)
152 /* -----------------------------------------------------------------------------
154 -------------------------------------------------------------------------- */
156 #define TICK_ENT_VIA_NODE() ENT_VIA_NODE_ctr++
158 #define TICK_ENT_STATIC_THK() ENT_STATIC_THK_ctr++
159 #define TICK_ENT_DYN_THK() ENT_DYN_THK_ctr++
161 #define TICK_CTR(f_ct, str, arity, args, arg_kinds) \
162 static StgEntCounter f_ct \
163 = { 0, arity, args, \
167 #define TICK_ENT_FUN_DIRECT_BODY(f_ct) \
169 if ( ! f_ct.registeredp ) { \
170 /* hook this one onto the front of the list */ \
171 f_ct.link = ticky_entry_ctrs; \
172 ticky_entry_ctrs = & (f_ct); \
173 /* mark it as "registered" */ \
174 f_ct.registeredp = 1; \
176 f_ct.entry_count += 1; \
179 #define TICK_ENT_STATIC_FUN_DIRECT(f_ct) \
180 TICK_ENT_FUN_DIRECT_BODY(f_ct) \
181 ENT_STATIC_FUN_DIRECT_ctr++ /* The static total one */
183 #define TICK_ENT_DYN_FUN_DIRECT(f_ct) \
184 TICK_ENT_FUN_DIRECT_BODY(f_ct) \
185 ENT_DYN_FUN_DIRECT_ctr++ /* The dynamic total one */
187 extern StgEntCounter top_ct;
188 extern StgEntCounter *ticky_entry_ctrs;
190 #define TICK_ENT_STATIC_CON(n) ENT_STATIC_CON_ctr++ /* enter static constructor */
191 #define TICK_ENT_DYN_CON(n) ENT_DYN_CON_ctr++ /* enter dynamic constructor */
192 #define TICK_ENT_STATIC_IND(n) ENT_STATIC_IND_ctr++ /* enter static indirection */
193 #define TICK_ENT_DYN_IND(n) ENT_DYN_IND_ctr++ /* enter dynamic indirection */
194 #define TICK_ENT_PERM_IND(n) ENT_PERM_IND_ctr++ /* enter permanent indirection */
195 #define TICK_ENT_PAP(n) ENT_PAP_ctr++ /* enter PAP */
196 #define TICK_ENT_AP(n) ENT_AP_ctr++ /* enter AP_UPD */
197 #define TICK_ENT_AP_STACK(n) ENT_AP_STACK_ctr++ /* enter AP_STACK_UPD */
198 #define TICK_ENT_BH() ENT_BH_ctr++ /* enter BLACKHOLE */
201 #define TICK_SLOW_HISTO(n) \
204 SLOW_CALL_hst[((__idx > 8) ? 8 : __idx)] += 1; \
207 #define UNDO_TICK_SLOW_HISTO(n) \
210 SLOW_CALL_hst[((__idx > 8) ? 8 : __idx)] -= 1; \
214 * A slow call with n arguments. In the unevald case, this call has
215 * already been counted once, so don't count it again.
217 #define TICK_SLOW_CALL(n) \
222 * This slow call was found to be to an unevaluated function; undo the
223 * ticks we did in TICK_SLOW_CALL.
225 #define TICK_SLOW_CALL_UNEVALD(n) \
226 SLOW_CALL_UNEVALD_ctr++; \
228 UNDO_TICK_SLOW_HISTO(n)
230 #define TICK_MULTI_CHUNK_SLOW_CALL(pattern, chunks) \
231 fprintf(stderr, "Multi-chunk slow call: %s\n", pattern); \
232 MULTI_CHUNK_SLOW_CALL_ctr++; \
233 MULTI_CHUNK_SLOW_CALL_CHUNKS_ctr += chunks;
235 /* A completely unknown tail-call */
236 #define TICK_UNKNOWN_CALL() UNKNOWN_CALL_ctr++
239 * slow call patterns (includes "extra" args to known calls,
240 * so the total of these will be greater than UNKNOWN_CALL_ctr).
242 #define TICK_SLOW_CALL_v() SLOW_CALL_v_ctr++
243 #define TICK_SLOW_CALL_f() SLOW_CALL_f_ctr++
244 #define TICK_SLOW_CALL_d() SLOW_CALL_d_ctr++
245 #define TICK_SLOW_CALL_l() SLOW_CALL_l_ctr++
246 #define TICK_SLOW_CALL_n() SLOW_CALL_n_ctr++
247 #define TICK_SLOW_CALL_p() SLOW_CALL_p_ctr++
248 #define TICK_SLOW_CALL_pv() SLOW_CALL_pv_ctr++
249 #define TICK_SLOW_CALL_pp() SLOW_CALL_pp_ctr++
250 #define TICK_SLOW_CALL_ppv() SLOW_CALL_ppv_ctr++
251 #define TICK_SLOW_CALL_ppp() SLOW_CALL_ppp_ctr++
252 #define TICK_SLOW_CALL_pppv() SLOW_CALL_pppv_ctr++
253 #define TICK_SLOW_CALL_pppp() SLOW_CALL_pppp_ctr++
254 #define TICK_SLOW_CALL_ppppp() SLOW_CALL_ppppp_ctr++
255 #define TICK_SLOW_CALL_pppppp() SLOW_CALL_pppppp_ctr++
256 #define TICK_SLOW_CALL_OTHER(pattern) \
257 fprintf(stderr,"slow call: %s\n", pattern); \
258 SLOW_CALL_OTHER_ctr++
260 #define TICK_KNOWN_CALL() KNOWN_CALL_ctr++
261 #define TICK_KNOWN_CALL_TOO_FEW_ARGS() KNOWN_CALL_TOO_FEW_ARGS_ctr++
262 #define TICK_KNOWN_CALL_EXTRA_ARGS() KNOWN_CALL_EXTRA_ARGS_ctr++
264 /* A slow call to a FUN found insufficient arguments, and built a PAP */
265 #define TICK_SLOW_CALL_FUN_TOO_FEW() SLOW_CALL_FUN_TOO_FEW_ctr++
266 #define TICK_SLOW_CALL_FUN_CORRECT() SLOW_CALL_FUN_CORRECT_ctr++
267 #define TICK_SLOW_CALL_FUN_TOO_MANY() SLOW_CALL_FUN_TOO_MANY_ctr++
268 #define TICK_SLOW_CALL_PAP_TOO_FEW() SLOW_CALL_PAP_TOO_FEW_ctr++
269 #define TICK_SLOW_CALL_PAP_CORRECT() SLOW_CALL_PAP_CORRECT_ctr++
270 #define TICK_SLOW_CALL_PAP_TOO_MANY() SLOW_CALL_PAP_TOO_MANY_ctr++
272 /* -----------------------------------------------------------------------------
274 -------------------------------------------------------------------------- */
276 #define TICK_RET_HISTO(categ,n) \
279 RET_##categ##_hst[((__idx > 8) ? 8 : __idx)] += 1;}
281 #define TICK_RET_NEW(n) RET_NEW_ctr++; \
282 TICK_RET_HISTO(NEW,n)
284 #define TICK_RET_OLD(n) RET_OLD_ctr++; \
285 TICK_RET_HISTO(OLD,n)
287 #define TICK_RET_UNBOXED_TUP(n) RET_UNBOXED_TUP_ctr++; \
288 TICK_RET_HISTO(UNBOXED_TUP,n)
290 #define TICK_VEC_RETURN(n) VEC_RETURN_ctr++; \
291 TICK_RET_HISTO(VEC_RETURN,n)
293 /* -----------------------------------------------------------------------------
297 ------------------ -------------------------------------------
298 TICK_UPDF_PUSHED Update frame pushed
299 TICK_CATCHF_PUSHED Catch frame pushed
300 TICK_UPDF_OMITTED A thunk decided not to push an update frame
301 TICK_UPDF_RCC_PUSHED Cost Centre restore frame pushed
302 TICK_UPDF_RCC_OMITTED Cost Centres not required -- not pushed
304 -------------------------------------------------------------------------- */
306 #define TICK_UPDF_OMITTED() UPDF_OMITTED_ctr++
307 #define TICK_UPDF_PUSHED(tgt,inf) UPDF_PUSHED_ctr++ \
308 /* ; fprintf(stderr,"UPDF_PUSHED:%p:%p\n",tgt,inf) */
309 #define TICK_CATCHF_PUSHED() CATCHF_PUSHED_ctr++
310 #define TICK_UPDF_RCC_PUSHED() UPDF_RCC_PUSHED_ctr++
311 #define TICK_UPDF_RCC_OMITTED() UPDF_RCC_OMITTED_ctr++
313 /* -----------------------------------------------------------------------------
316 These macros record information when we do an update. We always
317 update either with a data constructor (CON) or a partial application
322 ----------------------- --------------------------------------------
323 TICK_UPD_SQUEEZED Same as UPD_EXISTING but because
326 TICK_UPD_CON_IN_NEW Allocating a new CON
327 TICK_UPD_CON_IN_PLACE Updating with a PAP in place
328 TICK_UPD_PAP_IN_NEW Allocating a new PAP
329 TICK_UPD_PAP_IN_PLACE Updating with a PAP in place
331 ToDo: the IN_PLACE versions are not relevant any more.
332 -------------------------------------------------------------------------- */
334 #define TICK_UPD_HISTO(categ,n) \
337 UPD_##categ##_hst[((__idx > 8) ? 8 : __idx)] += 1;}
339 #define TICK_UPD_SQUEEZED() UPD_SQUEEZED_ctr++
341 #define TICK_UPD_CON_IN_NEW(n) UPD_CON_IN_NEW_ctr++ ; \
342 TICK_UPD_HISTO(CON_IN_NEW,n)
344 #define TICK_UPD_CON_IN_PLACE(n) UPD_CON_IN_PLACE_ctr++; \
345 TICK_UPD_HISTO(CON_IN_PLACE,n)
347 #define TICK_UPD_PAP_IN_NEW(n) UPD_PAP_IN_NEW_ctr++ ; \
348 TICK_UPD_HISTO(PAP_IN_NEW,n)
350 #define TICK_UPD_PAP_IN_PLACE() UPD_PAP_IN_PLACE_ctr++
352 /* For the generational collector:
354 #define TICK_UPD_NEW_IND() UPD_NEW_IND_ctr++
355 #define TICK_UPD_NEW_PERM_IND(tgt) UPD_NEW_PERM_IND_ctr++ \
356 /* ; fprintf(stderr,"UPD_NEW_PERM:%p\n",tgt) */
357 #define TICK_UPD_OLD_IND() UPD_OLD_IND_ctr++
358 #define TICK_UPD_OLD_PERM_IND() UPD_OLD_PERM_IND_ctr++
362 #define TICK_UPD_BH_UPDATABLE() UPD_BH_UPDATABLE_ctr++
363 #define TICK_UPD_BH_SINGLE_ENTRY() UPD_BH_SINGLE_ENTRY_ctr++
364 #define TICK_UPD_CAF_BH_UPDATABLE(s) \
365 UPD_CAF_BH_UPDATABLE_ctr++ \
366 /* ; fprintf(stderr,"TICK_UPD_CAF_BH_UPDATABLE(%s)\n",s) */
367 #define TICK_UPD_CAF_BH_SINGLE_ENTRY(s) \
368 UPD_CAF_BH_SINGLE_ENTRY_ctr++ \
369 /* ; fprintf(stderr,"TICK_UPD_CAF_BH_SINGLE_ENTRY(%s)\n",s) */
372 /* -----------------------------------------------------------------------------
373 Garbage collection counters
374 -------------------------------------------------------------------------- */
378 * GC_SEL_ABANDONED: we could've done the selection, but we gave up
379 * (e.g., to avoid overflowing the C stack); GC_SEL_MINOR: did a
380 * selection in a minor GC; GC_SEL_MAJOR: ditto, but major GC.
382 #define TICK_GC_SEL_ABANDONED() GC_SEL_ABANDONED_ctr++
383 #define TICK_GC_SEL_MINOR() GC_SEL_MINOR_ctr++
384 #define TICK_GC_SEL_MAJOR() GC_SEL_MAJOR_ctr++
386 /* Failed promotion: we wanted to promote an object early, but
387 * it had already been evacuated to (or resided in) a younger
390 #define TICK_GC_FAILED_PROMOTION() GC_FAILED_PROMOTION_ctr++
392 /* Bytes copied: this is a fairly good measure of GC cost and depends
393 * on all sorts of things like number of generations, aging, eager
394 * promotion, generation sizing policy etc.
396 #define TICK_GC_WORDS_COPIED(n) GC_WORDS_COPIED_ctr+=(n)
398 /* -----------------------------------------------------------------------------
399 The accumulators (extern decls)
400 -------------------------------------------------------------------------- */
403 #define INIT(ializer) = ializer
406 #define INIT(ializer)
407 #define EXTERN extern
410 EXTERN unsigned long ALLOC_HEAP_ctr INIT(0);
411 EXTERN unsigned long ALLOC_HEAP_tot INIT(0);
413 EXTERN unsigned long ALLOC_FUN_ctr INIT(0);
414 EXTERN unsigned long ALLOC_FUN_adm INIT(0);
415 EXTERN unsigned long ALLOC_FUN_gds INIT(0);
416 EXTERN unsigned long ALLOC_FUN_slp INIT(0);
417 EXTERN unsigned long ALLOC_FUN_hst[5]
419 = {0,0,0,0,0} /* urk, can't use INIT macro 'cause of the commas */
423 EXTERN unsigned long ALLOC_UP_THK_ctr INIT(0);
424 EXTERN unsigned long ALLOC_SE_THK_ctr INIT(0);
425 EXTERN unsigned long ALLOC_THK_adm INIT(0);
426 EXTERN unsigned long ALLOC_THK_gds INIT(0);
427 EXTERN unsigned long ALLOC_THK_slp INIT(0);
428 EXTERN unsigned long ALLOC_THK_hst[5]
434 EXTERN unsigned long ALLOC_CON_ctr INIT(0);
435 EXTERN unsigned long ALLOC_CON_adm INIT(0);
436 EXTERN unsigned long ALLOC_CON_gds INIT(0);
437 EXTERN unsigned long ALLOC_CON_slp INIT(0);
438 EXTERN unsigned long ALLOC_CON_hst[5]
444 EXTERN unsigned long ALLOC_TUP_ctr INIT(0);
445 EXTERN unsigned long ALLOC_TUP_adm INIT(0);
446 EXTERN unsigned long ALLOC_TUP_gds INIT(0);
447 EXTERN unsigned long ALLOC_TUP_slp INIT(0);
448 EXTERN unsigned long ALLOC_TUP_hst[5]
454 EXTERN unsigned long ALLOC_BH_ctr INIT(0);
455 EXTERN unsigned long ALLOC_BH_adm INIT(0);
456 EXTERN unsigned long ALLOC_BH_gds INIT(0);
457 EXTERN unsigned long ALLOC_BH_slp INIT(0);
458 EXTERN unsigned long ALLOC_BH_hst[5]
464 EXTERN unsigned long ALLOC_PRIM_ctr INIT(0);
465 EXTERN unsigned long ALLOC_PRIM_adm INIT(0);
466 EXTERN unsigned long ALLOC_PRIM_gds INIT(0);
467 EXTERN unsigned long ALLOC_PRIM_slp INIT(0);
468 EXTERN unsigned long ALLOC_PRIM_hst[5]
474 EXTERN unsigned long ALLOC_PAP_ctr INIT(0);
475 EXTERN unsigned long ALLOC_PAP_adm INIT(0);
476 EXTERN unsigned long ALLOC_PAP_gds INIT(0);
477 EXTERN unsigned long ALLOC_PAP_slp INIT(0);
478 EXTERN unsigned long ALLOC_PAP_hst[5]
484 EXTERN unsigned long ALLOC_TSO_ctr INIT(0);
485 EXTERN unsigned long ALLOC_TSO_adm INIT(0);
486 EXTERN unsigned long ALLOC_TSO_gds INIT(0);
487 EXTERN unsigned long ALLOC_TSO_slp INIT(0);
488 EXTERN unsigned long ALLOC_TSO_hst[5]
495 EXTERN unsigned long ALLOC_FMBQ_ctr INIT(0);
496 EXTERN unsigned long ALLOC_FMBQ_adm INIT(0);
497 EXTERN unsigned long ALLOC_FMBQ_gds INIT(0);
498 EXTERN unsigned long ALLOC_FMBQ_slp INIT(0);
499 EXTERN unsigned long ALLOC_FMBQ_hst[5]
505 EXTERN unsigned long ALLOC_FME_ctr INIT(0);
506 EXTERN unsigned long ALLOC_FME_adm INIT(0);
507 EXTERN unsigned long ALLOC_FME_gds INIT(0);
508 EXTERN unsigned long ALLOC_FME_slp INIT(0);
509 EXTERN unsigned long ALLOC_FME_hst[5]
515 EXTERN unsigned long ALLOC_BF_ctr INIT(0);
516 EXTERN unsigned long ALLOC_BF_adm INIT(0);
517 EXTERN unsigned long ALLOC_BF_gds INIT(0);
518 EXTERN unsigned long ALLOC_BF_slp INIT(0);
519 EXTERN unsigned long ALLOC_BF_hst[5]
526 EXTERN unsigned long ENT_VIA_NODE_ctr INIT(0);
527 EXTERN unsigned long ENT_STATIC_THK_ctr INIT(0);
528 EXTERN unsigned long ENT_DYN_THK_ctr INIT(0);
529 EXTERN unsigned long ENT_STATIC_FUN_DIRECT_ctr INIT(0);
530 EXTERN unsigned long ENT_DYN_FUN_DIRECT_ctr INIT(0);
531 EXTERN unsigned long ENT_STATIC_CON_ctr INIT(0);
532 EXTERN unsigned long ENT_DYN_CON_ctr INIT(0);
533 EXTERN unsigned long ENT_STATIC_IND_ctr INIT(0);
534 EXTERN unsigned long ENT_DYN_IND_ctr INIT(0);
535 EXTERN unsigned long ENT_PERM_IND_ctr INIT(0);
536 EXTERN unsigned long ENT_PAP_ctr INIT(0);
537 EXTERN unsigned long ENT_AP_ctr INIT(0);
538 EXTERN unsigned long ENT_AP_STACK_ctr INIT(0);
539 EXTERN unsigned long ENT_BH_ctr INIT(0);
541 EXTERN unsigned long UNKNOWN_CALL_ctr INIT(0);
543 EXTERN unsigned long SLOW_CALL_v_ctr INIT(0);
544 EXTERN unsigned long SLOW_CALL_f_ctr INIT(0);
545 EXTERN unsigned long SLOW_CALL_d_ctr INIT(0);
546 EXTERN unsigned long SLOW_CALL_l_ctr INIT(0);
547 EXTERN unsigned long SLOW_CALL_n_ctr INIT(0);
548 EXTERN unsigned long SLOW_CALL_p_ctr INIT(0);
549 EXTERN unsigned long SLOW_CALL_pv_ctr INIT(0);
550 EXTERN unsigned long SLOW_CALL_pp_ctr INIT(0);
551 EXTERN unsigned long SLOW_CALL_ppv_ctr INIT(0);
552 EXTERN unsigned long SLOW_CALL_ppp_ctr INIT(0);
553 EXTERN unsigned long SLOW_CALL_pppv_ctr INIT(0);
554 EXTERN unsigned long SLOW_CALL_pppp_ctr INIT(0);
555 EXTERN unsigned long SLOW_CALL_ppppp_ctr INIT(0);
556 EXTERN unsigned long SLOW_CALL_pppppp_ctr INIT(0);
557 EXTERN unsigned long SLOW_CALL_OTHER_ctr INIT(0);
559 EXTERN unsigned long ticky_slow_call_unevald INIT(0);
560 EXTERN unsigned long SLOW_CALL_ctr INIT(0);
561 EXTERN unsigned long MULTI_CHUNK_SLOW_CALL_ctr INIT(0);
562 EXTERN unsigned long MULTI_CHUNK_SLOW_CALL_CHUNKS_ctr INIT(0);
563 EXTERN unsigned long KNOWN_CALL_ctr INIT(0);
564 EXTERN unsigned long KNOWN_CALL_TOO_FEW_ARGS_ctr INIT(0);
565 EXTERN unsigned long KNOWN_CALL_EXTRA_ARGS_ctr INIT(0);
566 EXTERN unsigned long SLOW_CALL_FUN_TOO_FEW_ctr INIT(0);
567 EXTERN unsigned long SLOW_CALL_FUN_CORRECT_ctr INIT(0);
568 EXTERN unsigned long SLOW_CALL_FUN_TOO_MANY_ctr INIT(0);
569 EXTERN unsigned long SLOW_CALL_PAP_TOO_FEW_ctr INIT(0);
570 EXTERN unsigned long SLOW_CALL_PAP_CORRECT_ctr INIT(0);
571 EXTERN unsigned long SLOW_CALL_PAP_TOO_MANY_ctr INIT(0);
572 EXTERN unsigned long SLOW_CALL_UNEVALD_ctr INIT(0);
574 EXTERN unsigned long SLOW_CALL_hst[8]
580 EXTERN unsigned long RET_NEW_ctr INIT(0);
581 EXTERN unsigned long RET_OLD_ctr INIT(0);
582 EXTERN unsigned long RET_UNBOXED_TUP_ctr INIT(0);
584 EXTERN unsigned long VEC_RETURN_ctr INIT(0);
586 EXTERN unsigned long RET_NEW_hst[9]
588 = {0,0,0,0,0,0,0,0,0}
591 EXTERN unsigned long RET_OLD_hst[9]
593 = {0,0,0,0,0,0,0,0,0}
596 EXTERN unsigned long RET_UNBOXED_TUP_hst[9]
598 = {0,0,0,0,0,0,0,0,0}
601 EXTERN unsigned long RET_SEMI_IN_HEAP_hst[9]
603 = {0,0,0,0,0,0,0,0,0}
606 EXTERN unsigned long RET_VEC_RETURN_hst[9]
608 = {0,0,0,0,0,0,0,0,0}
612 EXTERN unsigned long RET_SEMI_loads_avoided INIT(0);
614 EXTERN unsigned long UPDF_OMITTED_ctr INIT(0);
615 EXTERN unsigned long UPDF_PUSHED_ctr INIT(0);
616 EXTERN unsigned long CATCHF_PUSHED_ctr INIT(0);
617 EXTERN unsigned long UPDF_RCC_PUSHED_ctr INIT(0);
618 EXTERN unsigned long UPDF_RCC_OMITTED_ctr INIT(0);
620 EXTERN unsigned long UPD_SQUEEZED_ctr INIT(0);
621 EXTERN unsigned long UPD_CON_IN_NEW_ctr INIT(0);
622 EXTERN unsigned long UPD_CON_IN_PLACE_ctr INIT(0);
623 EXTERN unsigned long UPD_PAP_IN_NEW_ctr INIT(0);
624 EXTERN unsigned long UPD_PAP_IN_PLACE_ctr INIT(0);
626 EXTERN unsigned long UPD_CON_IN_NEW_hst[9]
628 = {0,0,0,0,0,0,0,0,0}
631 EXTERN unsigned long UPD_CON_IN_PLACE_hst[9]
633 = {0,0,0,0,0,0,0,0,0}
636 EXTERN unsigned long UPD_PAP_IN_NEW_hst[9]
638 = {0,0,0,0,0,0,0,0,0}
642 EXTERN unsigned long UPD_NEW_IND_ctr INIT(0);
643 EXTERN unsigned long UPD_NEW_PERM_IND_ctr INIT(0);
644 EXTERN unsigned long UPD_OLD_IND_ctr INIT(0);
645 EXTERN unsigned long UPD_OLD_PERM_IND_ctr INIT(0);
647 EXTERN unsigned long UPD_BH_UPDATABLE_ctr INIT(0);
648 EXTERN unsigned long UPD_BH_SINGLE_ENTRY_ctr INIT(0);
649 EXTERN unsigned long UPD_CAF_BH_UPDATABLE_ctr INIT(0);
650 EXTERN unsigned long UPD_CAF_BH_SINGLE_ENTRY_ctr INIT(0);
652 EXTERN unsigned long GC_SEL_ABANDONED_ctr INIT(0);
653 EXTERN unsigned long GC_SEL_MINOR_ctr INIT(0);
654 EXTERN unsigned long GC_SEL_MAJOR_ctr INIT(0);
656 EXTERN unsigned long GC_FAILED_PROMOTION_ctr INIT(0);
658 EXTERN unsigned long GC_WORDS_COPIED_ctr INIT(0);
663 /* -----------------------------------------------------------------------------
664 Just stubs if no ticky-ticky profiling
665 -------------------------------------------------------------------------- */
667 #else /* !TICKY_TICKY */
669 #define TICK_ALLOC_HEAP(words, f_ct)
670 #define TICK_ALLOC_HEAP_NOCTR(words)
672 #define TICK_ALLOC_FUN(g,s)
673 #define TICK_ALLOC_UP_THK(g,s)
674 #define TICK_ALLOC_SE_THK(g,s)
675 #define TICK_ALLOC_CON(g,s)
676 #define TICK_ALLOC_TUP(g,s)
677 #define TICK_ALLOC_BH(g,s)
678 #define TICK_ALLOC_PAP(g,s)
679 #define TICK_ALLOC_TSO(g,s)
680 #define TICK_ALLOC_FMBQ(a,g,s)
681 #define TICK_ALLOC_FME(a,g,s)
682 #define TICK_ALLOC_BF(a,g,s)
683 #define TICK_ALLOC_PRIM(a,g,s)
684 #define TICK_ALLOC_PRIM2(w)
686 #define TICK_ENT_VIA_NODE()
688 #define TICK_ENT_STATIC_THK()
689 #define TICK_ENT_DYN_THK()
690 #define TICK_ENT_STATIC_FUN_DIRECT(n)
691 #define TICK_ENT_DYN_FUN_DIRECT(n)
692 #define TICK_ENT_STATIC_CON(n)
693 #define TICK_ENT_DYN_CON(n)
694 #define TICK_ENT_STATIC_IND(n)
695 #define TICK_ENT_DYN_IND(n)
696 #define TICK_ENT_PERM_IND(n)
697 #define TICK_ENT_PAP(n)
698 #define TICK_ENT_AP(n)
699 #define TICK_ENT_AP_STACK(n)
700 #define TICK_ENT_BH()
702 #define TICK_SLOW_CALL(n)
703 #define TICK_SLOW_CALL_UNEVALD(n)
704 #define TICK_SLOW_CALL_FUN_TOO_FEW()
705 #define TICK_SLOW_CALL_FUN_CORRECT()
706 #define TICK_SLOW_CALL_FUN_TOO_MANY()
707 #define TICK_SLOW_CALL_PAP_TOO_FEW()
708 #define TICK_SLOW_CALL_PAP_CORRECT()
709 #define TICK_SLOW_CALL_PAP_TOO_MANY()
711 #define TICK_SLOW_CALL_v()
712 #define TICK_SLOW_CALL_f()
713 #define TICK_SLOW_CALL_d()
714 #define TICK_SLOW_CALL_l()
715 #define TICK_SLOW_CALL_n()
716 #define TICK_SLOW_CALL_p()
717 #define TICK_SLOW_CALL_pv()
718 #define TICK_SLOW_CALL_pp()
719 #define TICK_SLOW_CALL_ppv()
720 #define TICK_SLOW_CALL_ppp()
721 #define TICK_SLOW_CALL_pppv()
722 #define TICK_SLOW_CALL_pppp()
723 #define TICK_SLOW_CALL_ppppp()
724 #define TICK_SLOW_CALL_pppppp()
725 #define TICK_SLOW_CALL_OTHER(pattern)
727 #define TICK_KNOWN_CALL()
728 #define TICK_KNOWN_CALL_TOO_FEW_ARGS()
729 #define TICK_KNOWN_CALL_EXTRA_ARGS()
730 #define TICK_UNKNOWN_CALL()
732 #define TICK_RET_NEW(n)
733 #define TICK_RET_OLD(n)
734 #define TICK_RET_UNBOXED_TUP(n)
735 #define TICK_RET_SEMI(n)
736 #define TICK_RET_SEMI_BY_DEFAULT()
737 #define TICK_RET_SEMI_FAILED(tag)
738 #define TICK_VEC_RETURN(n)
740 #define TICK_UPDF_OMITTED()
741 #define TICK_UPDF_PUSHED(tgt,inf)
742 #define TICK_CATCHF_PUSHED()
743 #define TICK_UPDF_RCC_PUSHED()
744 #define TICK_UPDF_RCC_OMITTED()
746 #define TICK_UPD_SQUEEZED()
747 #define TICK_UPD_CON_IN_NEW(n)
748 #define TICK_UPD_CON_IN_PLACE(n)
749 #define TICK_UPD_PAP_IN_NEW(n)
750 #define TICK_UPD_PAP_IN_PLACE()
752 #define TICK_UPD_NEW_IND()
753 #define TICK_UPD_NEW_PERM_IND(tgt)
754 #define TICK_UPD_OLD_IND()
755 #define TICK_UPD_OLD_PERM_IND()
757 #define TICK_UPD_BH_UPDATABLE()
758 #define TICK_UPD_BH_SINGLE_ENTRY()
759 #define TICK_UPD_CAF_BH_UPDATABLE()
760 #define TICK_UPD_CAF_BH_SINGLE_ENTRY()
762 #define TICK_GC_SEL_ABANDONED()
763 #define TICK_GC_SEL_MINOR()
764 #define TICK_GC_SEL_MAJOR()
766 #define TICK_GC_FAILED_PROMOTION()
767 #define TICK_GC_WORDS_COPIED(n)
769 #endif /* !TICKY_TICKY */