[project @ 2000-08-07 23:37:19 by qrczak]
[ghc-hetmet.git] / ghc / includes / StgTicky.h
1 /* ----------------------------------------------------------------------------
2  * $Id: StgTicky.h,v 1.10 2000/08/07 23:37:23 qrczak Exp $
3  *
4  * (c) The AQUA project, Glasgow University, 1994-1997
5  * (c) The GHC Team, 1998-1999
6  *
7  * Ticky-ticky profiling macros.
8  *
9  * -------------------------------------------------------------------------- */
10
11 #ifndef TICKY_H
12 #define TICKY_H
13
14 #ifdef TICKY_TICKY
15
16 /* -----------------------------------------------------------------------------
17    Allocations
18    -------------------------------------------------------------------------- */
19
20 /* How many times we do a heap check and move Hp; comparing this with
21  * the allocations gives an indication of how many things we get per trip
22  * to the well:
23  */
24 #define TICK_ALLOC_HEAP(n, f_ct)                \
25   {                                             \
26     f_ct.allocs += (n);                         \
27     ALLOC_HEAP_ctr++;                           \
28     ALLOC_HEAP_tot += (n);                      \
29   }
30
31 #define TICK_ALLOC_HEAP_NOCTR(n)                \
32   {                                             \
33     ALLOC_HEAP_ctr++;                           \
34     ALLOC_HEAP_tot += (n);                      \
35   }
36
37 /* We count things every time we allocate something in the dynamic heap.
38  * For each, we count the number of words of (1) ``admin'' (header),
39  * (2) good stuff (useful pointers and data), and (3) ``slop'' (extra
40  * space, to leave room for an old generation indirection for example).
41  * 
42  * The first five macros are inserted when the compiler generates code
43  * to allocate something; the categories correspond to the @ClosureClass@
44  * datatype (manifest functions, thunks, constructors, big tuples, and
45  * partial applications).
46  */
47
48 #define _HS  sizeofW(StgHeader)
49
50 #define TICK_ALLOC_FUN(g,s)                             \
51         ALLOC_FUN_ctr++;        ALLOC_FUN_adm += _HS;   \
52         ALLOC_FUN_gds += (g);   ALLOC_FUN_slp += (s);   \
53         TICK_ALLOC_HISTO(FUN,_HS,g,s)
54
55 #define TICK_ALLOC_UP_THK(g,s)                          \
56         ALLOC_UP_THK_ctr++;     ALLOC_THK_adm += _HS;   \
57         ALLOC_THK_gds += (g);   ALLOC_THK_slp += (s);   \
58         TICK_ALLOC_HISTO(THK,_HS,g,s)
59
60 #define TICK_ALLOC_SE_THK(g,s)                          \
61         ALLOC_SE_THK_ctr++;     ALLOC_THK_adm += _HS;   \
62         ALLOC_THK_gds += (g);   ALLOC_THK_slp += (s);   \
63         TICK_ALLOC_HISTO(THK,_HS,g,s)
64
65 #define TICK_ALLOC_CON(g,s)                             \
66         ALLOC_CON_ctr++;        ALLOC_CON_adm += _HS;   \
67         ALLOC_CON_gds += (g);   ALLOC_CON_slp += (s);   \
68         TICK_ALLOC_HISTO(CON,_HS,g,s)
69
70 #define TICK_ALLOC_TUP(g,s)                             \
71         ALLOC_TUP_ctr++;        ALLOC_TUP_adm += _HS;   \
72         ALLOC_TUP_gds += (g);   ALLOC_TUP_slp += (s);   \
73         TICK_ALLOC_HISTO(TUP,_HS,g,s)
74
75 #define TICK_ALLOC_BH(g,s)                              \
76         ALLOC_BH_ctr++;         ALLOC_BH_adm += _HS;    \
77         ALLOC_BH_gds += (g);    ALLOC_BH_slp += (s);    \
78         TICK_ALLOC_HISTO(BH,_HS,g,s)
79
80 #define TICK_ALLOC_UPD_PAP(g,s)                                 \
81         ALLOC_UPD_PAP_ctr++;    ALLOC_UPD_PAP_adm += sizeofW(StgPAP)-1; \
82         ALLOC_UPD_PAP_gds += (g); ALLOC_UPD_PAP_slp += (s);     \
83         TICK_ALLOC_HISTO(UPD_PAP,sizeofW(StgPAP)-1,g,s)
84
85 #define TICK_ALLOC_TSO(g,s)                                             \
86         ALLOC_TSO_ctr++;        ALLOC_TSO_adm += sizeofW(StgTSO);       \
87         ALLOC_TSO_gds += (g);   ALLOC_TSO_slp += (s);                   \
88         TICK_ALLOC_HISTO(TSO,sizeofW(StgTSO),g,s)
89      
90 #ifdef PAR
91 #define TICK_ALLOC_FMBQ(a,g,s)                          \
92         ALLOC_FMBQ_ctr++;       ALLOC_FMBQ_adm += (a);  \
93         ALLOC_FMBQ_gds += (g);  ALLOC_FMBQ_slp += (s);  \
94         TICK_ALLOC_HISTO(FMBQ,a,g,s)
95
96 #define TICK_ALLOC_FME(a,g,s)                           \
97         ALLOC_FME_ctr++;        ALLOC_FME_adm += (a);   \
98         ALLOC_FME_gds += (g);   ALLOC_FME_slp += (s);   \
99         TICK_ALLOC_HISTO(FME,a,g,s)
100
101 #define TICK_ALLOC_BF(a,g,s)                            \
102         ALLOC_BF_ctr++; ALLOC_BF_adm += (a);            \
103         ALLOC_BF_gds += (g);    ALLOC_BF_slp += (s);    \
104         TICK_ALLOC_HISTO(BF,a,g,s)
105 #endif
106      
107 /* The histogrammy bit is fairly straightforward; the -2 is: one for
108  * 0-origin C arrays; the other one because we do no one-word
109  * allocations, so we would never inc that histogram slot; so we shift
110  * everything over by one.
111  */
112 #define TICK_ALLOC_HISTO(categ,a,g,s)                           \
113         { I_ __idx;                                             \
114           __idx = (a) + (g) + (s) - 2;                          \
115          ALLOC_##categ##_hst[((__idx > 4) ? 4 : __idx)] += 1;} 
116
117 /* Some hard-to-account-for words are allocated by/for primitives,
118  * includes Integer support.  ALLOC_PRIM2 tells us about these.  We
119  * count everything as ``goods'', which is not strictly correct.
120  * (ALLOC_PRIM is the same sort of stuff, but we know the
121  * admin/goods/slop breakdown.)
122  */
123 #define TICK_ALLOC_PRIM(a,g,s)                          \
124         ALLOC_PRIM_ctr++;       ALLOC_PRIM_adm += (a);  \
125         ALLOC_PRIM_gds += (g);  ALLOC_PRIM_slp += (s);  \
126         TICK_ALLOC_HISTO(PRIM,a,g,s)
127
128 #define TICK_ALLOC_PRIM2(w) ALLOC_PRIM_ctr++; ALLOC_PRIM_gds +=(w); \
129                        TICK_ALLOC_HISTO(PRIM,0,w,0)
130
131
132 /* -----------------------------------------------------------------------------
133    Enters
134    -------------------------------------------------------------------------- */
135
136 #define TICK_ENT_VIA_NODE()     ENT_VIA_NODE_ctr++
137
138 #define TICK_ENT_THK()          ENT_THK_ctr++         /* thunk */
139
140 typedef struct _StgEntCounter {
141     unsigned    registeredp:16, /* 0 == no, 1 == yes */
142                 arity:16,       /* arity (static info) */
143                 stk_args:16;    /* # of args off stack */
144                                 /* (rest of args are in registers) */
145     char        *str;           /* name of the thing */
146     char        *arg_kinds;     /* info about the args types */
147     I_          entry_count;      /* Trips to fast entry code */
148     I_          slow_entry_count; /* Trips to slow entry code */
149     I_          allocs;         /* number of allocations by this fun */
150     struct _StgEntCounter *link;/* link to chain them all together */
151 } StgEntCounter;
152
153 #define TICK_CTR(f_ct, str, arity, args, arg_kinds)     \
154    static StgEntCounter f_ct                    \
155         = { 0, arity, args,                     \
156             str, arg_kinds,                     \
157             0, 0, 0, NULL };
158
159 /* The slow entry point for a function always goes to
160    the fast entry point, which will register the stats block,
161    so no need to do so here */
162 #define TICK_ENT_FUN_STD(f_ct)                                  \
163         f_ct.slow_entry_count++;                                \
164         ENT_FUN_STD_ctr++     /* The total one */
165
166 #define TICK_ENT_FUN_DIRECT(f_ct)                               \
167         {                                                       \
168           if ( ! f_ct.registeredp ) {                           \
169             /* hook this one onto the front of the list */      \
170             f_ct.link = ticky_entry_ctrs;                       \
171             ticky_entry_ctrs = & (f_ct);                        \
172             /* mark it as "registered" */                       \
173             f_ct.registeredp = 1;                               \
174           }                                                     \
175           f_ct.entry_count += 1;                                \
176         }                                                       \
177         ENT_FUN_DIRECT_ctr++ /* The total one */
178
179 extern StgEntCounter top_ct;
180 extern StgEntCounter *ticky_entry_ctrs;
181
182 #define TICK_ENT_CON(n)         ENT_CON_ctr++         /* enter constructor */
183 #define TICK_ENT_IND(n)         ENT_IND_ctr++         /* enter indirection */
184 #define TICK_ENT_PERM_IND(n)    ENT_PERM_IND_ctr++    /* enter permanent indirection */
185 #define TICK_ENT_PAP(n)         ENT_PAP_ctr++         /* enter PAP */
186 #define TICK_ENT_AP_UPD(n)      ENT_AP_UPD_ctr++      /* enter AP_UPD */
187 #define TICK_ENT_BH()           ENT_BH_ctr++          /* enter BLACKHOLE */
188
189
190 /* -----------------------------------------------------------------------------
191    Returns
192    -------------------------------------------------------------------------- */
193
194 /* Whenever a ``return'' occurs, it is returning the constituent parts of
195  * a data constructor.  The parts can be returned either in registers, or
196  * by allocating some heap to put it in (the TICK_ALLOC_* macros account for
197  * the allocation).  The constructor can either be an existing one
198  * *OLD* or we could have {\em just} figured out this stuff
199  * *NEW*.
200  */
201
202 #define TICK_RET_HISTO(categ,n)                                 \
203         { I_ __idx;                                             \
204           __idx = (n);                                          \
205          RET_##categ##_hst[((__idx > 8) ? 8 : __idx)] += 1;} 
206
207 #define TICK_RET_NEW(n) RET_NEW_ctr++; \
208                         TICK_RET_HISTO(NEW,n)
209
210 #define TICK_RET_OLD(n) RET_OLD_ctr++; \
211                         TICK_RET_HISTO(OLD,n)
212
213 #define TICK_RET_UNBOXED_TUP(n)  RET_UNBOXED_TUP_ctr++; \
214                          TICK_RET_HISTO(UNBOXED_TUP,n)
215
216 #define TICK_RET_SEMI(n) RET_SEMI_IN_HEAP_ctr++; \
217                          TICK_RET_HISTO(SEMI_IN_HEAP,n)
218
219 #define TICK_RET_SEMI_BY_DEFAULT()/*???*/ RET_SEMI_BY_DEFAULT_ctr++
220
221 #define TICK_RET_SEMI_FAILED(tag)       do {                            \
222                                 if ((tag) == INFO_IND_TAG)              \
223                                     RET_SEMI_FAILED_IND_ctr++;          \
224                                 else                                    \
225                                     RET_SEMI_FAILED_UNEVAL_ctr++;       \
226                                 } while (0)
227
228 #define TICK_VEC_RETURN(n)      VEC_RETURN_ctr++;           \
229                                 TICK_RET_HISTO(VEC_RETURN,n)
230
231 /* -----------------------------------------------------------------------------
232    Stack Frames
233
234    Macro                           Counts
235    ------------------              -------------------------------------------
236    TICK_UPDF_PUSHED                Update frame pushed
237    TICK_SEQF_PUSHED                Seq frame pushed
238    TICK_CATCHF_PUSHED              Catch frame pushed
239    TICK_UPDF_OMITTED               A thunk decided not to push an update frame
240    TICK_UPDF_RCC_PUSHED            Cost Centre restore frame pushed
241    TICK_UPDF_RCC_OMITTED           Cost Centres not required -- not pushed
242
243    -------------------------------------------------------------------------- */
244
245 #define TICK_UPDF_OMITTED()     UPDF_OMITTED_ctr++
246 #define TICK_UPDF_PUSHED(tgt,inf)       UPDF_PUSHED_ctr++ \
247 /*                              ; fprintf(stderr,"UPDF_PUSHED:%p:%p\n",tgt,inf) */
248 #define TICK_SEQF_PUSHED()      SEQF_PUSHED_ctr++
249 #define TICK_CATCHF_PUSHED()    CATCHF_PUSHED_ctr++
250 #define TICK_UPDF_RCC_PUSHED()  UPDF_RCC_PUSHED_ctr++
251 #define TICK_UPDF_RCC_OMITTED() UPDF_RCC_OMITTED_ctr++
252
253 /* -----------------------------------------------------------------------------
254    Updates
255
256    These macros record information when we do an update.  We always
257    update either with a data constructor (CON) or a partial application
258    (PAP).
259    
260    
261    Macro                                Where
262    -----------------------      --------------------------------------------
263    TICK_UPD_SQUEEZED            Same as UPD_EXISTING but because
264                                 of stack-squeezing
265    TICK_UPD_CON_IN_NEW          Allocating a new CON
266    TICK_UPD_CON_IN_PLACE        Updating with a PAP in place
267    TICK_UPD_PAP_IN_NEW          Allocating a new PAP
268    TICK_UPD_PAP_IN_PLACE        Updating with a PAP in place
269
270    -------------------------------------------------------------------------- */
271
272 #define TICK_UPD_HISTO(categ,n) \
273         { I_ __idx;                                              \
274           __idx = (n);                                           \
275          UPD_##categ##_hst[((__idx > 8) ? 8 : __idx)] += 1;} 
276
277 #define TICK_UPD_SQUEEZED()             UPD_SQUEEZED_ctr++
278
279 #define TICK_UPD_CON_IN_NEW(n)          UPD_CON_IN_NEW_ctr++ ; \
280                                         TICK_UPD_HISTO(CON_IN_NEW,n)
281
282 #define TICK_UPD_CON_IN_PLACE(n)        UPD_CON_IN_PLACE_ctr++; \
283                                         TICK_UPD_HISTO(CON_IN_PLACE,n)
284
285 #define TICK_UPD_PAP_IN_NEW(n)          UPD_PAP_IN_NEW_ctr++ ; \
286                                         TICK_UPD_HISTO(PAP_IN_NEW,n)
287
288 #define TICK_UPD_PAP_IN_PLACE()         UPD_PAP_IN_PLACE_ctr++
289
290 /* For the generational collector: 
291  */
292 #define TICK_UPD_NEW_IND()              UPD_NEW_IND_ctr++
293 #define TICK_UPD_NEW_PERM_IND(tgt)      UPD_NEW_PERM_IND_ctr++ \
294 /*                                      ; fprintf(stderr,"UPD_NEW_PERM:%p\n",tgt) */
295 #define TICK_UPD_OLD_IND()              UPD_OLD_IND_ctr++                       
296 #define TICK_UPD_OLD_PERM_IND()         UPD_OLD_PERM_IND_ctr++                  
297
298 /* Count blackholes:
299  */
300 #define TICK_UPD_BH_UPDATABLE()         UPD_BH_UPDATABLE_ctr++
301 #define TICK_UPD_BH_SINGLE_ENTRY()      UPD_BH_SINGLE_ENTRY_ctr++
302 #define TICK_UPD_CAF_BH_UPDATABLE(s)                          \
303      UPD_CAF_BH_UPDATABLE_ctr++                               \
304 /*   ; fprintf(stderr,"TICK_UPD_CAF_BH_UPDATABLE(%s)\n",s) */
305 #define TICK_UPD_CAF_BH_SINGLE_ENTRY(s)                       \
306      UPD_CAF_BH_SINGLE_ENTRY_ctr++                            \
307 /*   ; fprintf(stderr,"TICK_UPD_CAF_BH_SINGLE_ENTRY(%s)\n",s) */
308
309
310 /* -----------------------------------------------------------------------------
311    Garbage collection counters
312    -------------------------------------------------------------------------- */
313
314 /* Selectors:
315  *
316  * GC_SEL_ABANDONED: we could've done the selection, but we gave up
317  * (e.g., to avoid overflowing the C stack); GC_SEL_MINOR: did a
318  * selection in a minor GC; GC_SEL_MAJOR: ditto, but major GC.
319  */
320 #define TICK_GC_SEL_ABANDONED()         GC_SEL_ABANDONED_ctr++
321 #define TICK_GC_SEL_MINOR()             GC_SEL_MINOR_ctr++
322 #define TICK_GC_SEL_MAJOR()             GC_SEL_MAJOR_ctr++
323
324 /* Failed promotion: we wanted to promote an object early, but
325  * it had already been evacuated to (or resided in) a younger
326  * generation.
327  */
328 #define TICK_GC_FAILED_PROMOTION()      GC_FAILED_PROMOTION_ctr++
329
330 /* Bytes copied: this is a fairly good measure of GC cost and depends
331  * on all sorts of things like number of generations, aging, eager
332  * promotion, generation sizing policy etc.
333  */
334 #define TICK_GC_WORDS_COPIED(n)         GC_WORDS_COPIED_ctr+=(n)
335
336 /* -----------------------------------------------------------------------------
337    The accumulators (extern decls)
338    -------------------------------------------------------------------------- */
339
340 #ifdef TICKY_C
341 #define INIT(ializer) = ializer
342 #define EXTERN
343 #else
344 #define INIT(ializer)
345 #define EXTERN extern
346 #endif
347
348 EXTERN unsigned long ALLOC_HEAP_ctr INIT(0);
349 EXTERN unsigned long ALLOC_HEAP_tot INIT(0);
350
351 EXTERN unsigned long ALLOC_FUN_ctr INIT(0);
352 EXTERN unsigned long ALLOC_FUN_adm INIT(0);
353 EXTERN unsigned long ALLOC_FUN_gds INIT(0);
354 EXTERN unsigned long ALLOC_FUN_slp INIT(0);
355 EXTERN unsigned long ALLOC_FUN_hst[5] 
356 #ifdef TICKY_C
357    = {0,0,0,0,0}  /* urk, can't use INIT macro 'cause of the commas */
358 #endif
359 ;
360
361 EXTERN unsigned long ALLOC_UP_THK_ctr INIT(0);
362 EXTERN unsigned long ALLOC_SE_THK_ctr INIT(0);
363 EXTERN unsigned long ALLOC_THK_adm INIT(0);
364 EXTERN unsigned long ALLOC_THK_gds INIT(0);
365 EXTERN unsigned long ALLOC_THK_slp INIT(0);
366 EXTERN unsigned long ALLOC_THK_hst[5]
367 #ifdef TICKY_C
368    = {0,0,0,0,0}
369 #endif
370 ;
371
372 EXTERN unsigned long ALLOC_CON_ctr INIT(0);
373 EXTERN unsigned long ALLOC_CON_adm INIT(0);
374 EXTERN unsigned long ALLOC_CON_gds INIT(0);
375 EXTERN unsigned long ALLOC_CON_slp INIT(0);
376 EXTERN unsigned long ALLOC_CON_hst[5]
377 #ifdef TICKY_C
378    = {0,0,0,0,0}
379 #endif
380 ;
381
382 EXTERN unsigned long ALLOC_TUP_ctr INIT(0);
383 EXTERN unsigned long ALLOC_TUP_adm INIT(0);
384 EXTERN unsigned long ALLOC_TUP_gds INIT(0);
385 EXTERN unsigned long ALLOC_TUP_slp INIT(0);
386 EXTERN unsigned long ALLOC_TUP_hst[5]
387 #ifdef TICKY_C
388    = {0,0,0,0,0}
389 #endif
390 ;
391
392 EXTERN unsigned long ALLOC_BH_ctr INIT(0);
393 EXTERN unsigned long ALLOC_BH_adm INIT(0);
394 EXTERN unsigned long ALLOC_BH_gds INIT(0);
395 EXTERN unsigned long ALLOC_BH_slp INIT(0);
396 EXTERN unsigned long ALLOC_BH_hst[5]
397 #ifdef TICKY_C
398    = {0,0,0,0,0}
399 #endif
400 ;
401
402 EXTERN unsigned long ALLOC_PRIM_ctr INIT(0);
403 EXTERN unsigned long ALLOC_PRIM_adm INIT(0);
404 EXTERN unsigned long ALLOC_PRIM_gds INIT(0);
405 EXTERN unsigned long ALLOC_PRIM_slp INIT(0);
406 EXTERN unsigned long ALLOC_PRIM_hst[5]
407 #ifdef TICKY_C
408    = {0,0,0,0,0}
409 #endif
410 ;
411
412 EXTERN unsigned long ALLOC_UPD_PAP_ctr INIT(0);
413 EXTERN unsigned long ALLOC_UPD_PAP_adm INIT(0);
414 EXTERN unsigned long ALLOC_UPD_PAP_gds INIT(0);
415 EXTERN unsigned long ALLOC_UPD_PAP_slp INIT(0);
416 EXTERN unsigned long ALLOC_UPD_PAP_hst[5]
417 #ifdef TICKY_C
418    = {0,0,0,0,0}
419 #endif
420 ;
421
422 EXTERN unsigned long ALLOC_TSO_ctr INIT(0);
423 EXTERN unsigned long ALLOC_TSO_adm INIT(0);
424 EXTERN unsigned long ALLOC_TSO_gds INIT(0);
425 EXTERN unsigned long ALLOC_TSO_slp INIT(0);
426 EXTERN unsigned long ALLOC_TSO_hst[5]
427 #ifdef TICKY_C
428    = {0,0,0,0,0}
429 #endif
430 ;
431
432 # ifdef PAR
433 EXTERN unsigned long ALLOC_FMBQ_ctr INIT(0);
434 EXTERN unsigned long ALLOC_FMBQ_adm INIT(0);
435 EXTERN unsigned long ALLOC_FMBQ_gds INIT(0);
436 EXTERN unsigned long ALLOC_FMBQ_slp INIT(0);
437 EXTERN unsigned long ALLOC_FMBQ_hst[5]
438 #ifdef TICKY_C
439    = {0,0,0,0,0}
440 #endif
441 ;
442
443 EXTERN unsigned long ALLOC_FME_ctr INIT(0);
444 EXTERN unsigned long ALLOC_FME_adm INIT(0);
445 EXTERN unsigned long ALLOC_FME_gds INIT(0);
446 EXTERN unsigned long ALLOC_FME_slp INIT(0);
447 EXTERN unsigned long ALLOC_FME_hst[5]
448 #ifdef TICKY_C
449    = {0,0,0,0,0}
450 #endif
451 ;
452
453 EXTERN unsigned long ALLOC_BF_ctr INIT(0);
454 EXTERN unsigned long ALLOC_BF_adm INIT(0);
455 EXTERN unsigned long ALLOC_BF_gds INIT(0);
456 EXTERN unsigned long ALLOC_BF_slp INIT(0);
457 EXTERN unsigned long ALLOC_BF_hst[5]
458 #ifdef TICKY_C
459    = {0,0,0,0,0}
460 #endif
461 ;
462 #endif
463
464 EXTERN unsigned long ENT_VIA_NODE_ctr INIT(0);
465 EXTERN unsigned long ENT_THK_ctr INIT(0);
466 EXTERN unsigned long ENT_FUN_STD_ctr INIT(0);
467 EXTERN unsigned long ENT_FUN_DIRECT_ctr INIT(0);
468 EXTERN unsigned long ENT_CON_ctr INIT(0);
469 EXTERN unsigned long ENT_IND_ctr INIT(0);
470 EXTERN unsigned long ENT_PERM_IND_ctr INIT(0);
471 EXTERN unsigned long ENT_PAP_ctr INIT(0);
472 EXTERN unsigned long ENT_AP_UPD_ctr INIT(0);
473 EXTERN unsigned long ENT_BH_ctr INIT(0);
474
475 EXTERN unsigned long RET_NEW_ctr INIT(0);
476 EXTERN unsigned long RET_OLD_ctr INIT(0);
477 EXTERN unsigned long RET_UNBOXED_TUP_ctr INIT(0);
478 EXTERN unsigned long RET_SEMI_BY_DEFAULT_ctr INIT(0);
479 EXTERN unsigned long RET_SEMI_IN_HEAP_ctr INIT(0);
480 EXTERN unsigned long RET_SEMI_FAILED_IND_ctr INIT(0);
481 EXTERN unsigned long RET_SEMI_FAILED_UNEVAL_ctr INIT(0);
482
483 EXTERN unsigned long VEC_RETURN_ctr INIT(0);
484
485 EXTERN unsigned long RET_NEW_hst[9]
486 #ifdef TICKY_C
487    = {0,0,0,0,0,0,0,0,0}
488 #endif
489 ;
490 EXTERN unsigned long RET_OLD_hst[9]
491 #ifdef TICKY_C
492    = {0,0,0,0,0,0,0,0,0}
493 #endif
494 ;
495 EXTERN unsigned long RET_UNBOXED_TUP_hst[9]
496 #ifdef TICKY_C
497    = {0,0,0,0,0,0,0,0,0}
498 #endif
499 ;
500 EXTERN unsigned long RET_SEMI_IN_HEAP_hst[9]
501 #ifdef TICKY_C
502    = {0,0,0,0,0,0,0,0,0}
503 #endif
504 ;
505 EXTERN unsigned long RET_VEC_RETURN_hst[9]
506 #ifdef TICKY_C
507    = {0,0,0,0,0,0,0,0,0}
508 #endif
509 ;
510
511 EXTERN unsigned long RET_SEMI_loads_avoided INIT(0);
512
513 EXTERN unsigned long UPDF_OMITTED_ctr INIT(0);
514 EXTERN unsigned long UPDF_PUSHED_ctr INIT(0);
515 EXTERN unsigned long SEQF_PUSHED_ctr INIT(0);
516 EXTERN unsigned long CATCHF_PUSHED_ctr INIT(0);
517 EXTERN unsigned long UPDF_RCC_PUSHED_ctr INIT(0);
518 EXTERN unsigned long UPDF_RCC_OMITTED_ctr INIT(0);
519
520 EXTERN unsigned long UPD_SQUEEZED_ctr INIT(0);
521 EXTERN unsigned long UPD_CON_IN_NEW_ctr INIT(0);
522 EXTERN unsigned long UPD_CON_IN_PLACE_ctr INIT(0);
523 EXTERN unsigned long UPD_PAP_IN_NEW_ctr INIT(0);
524 EXTERN unsigned long UPD_PAP_IN_PLACE_ctr INIT(0);
525
526 EXTERN unsigned long UPD_CON_IN_NEW_hst[9]
527 #ifdef TICKY_C
528    = {0,0,0,0,0,0,0,0,0}
529 #endif
530 ;
531 EXTERN unsigned long UPD_CON_IN_PLACE_hst[9]
532 #ifdef TICKY_C
533    = {0,0,0,0,0,0,0,0,0}
534 #endif
535 ;
536 EXTERN unsigned long UPD_PAP_IN_NEW_hst[9]
537 #ifdef TICKY_C
538    = {0,0,0,0,0,0,0,0,0}
539 #endif
540 ;
541
542 EXTERN unsigned long UPD_NEW_IND_ctr INIT(0);
543 EXTERN unsigned long UPD_NEW_PERM_IND_ctr INIT(0);
544 EXTERN unsigned long UPD_OLD_IND_ctr INIT(0);
545 EXTERN unsigned long UPD_OLD_PERM_IND_ctr INIT(0);
546
547 EXTERN unsigned long UPD_BH_UPDATABLE_ctr INIT(0);
548 EXTERN unsigned long UPD_BH_SINGLE_ENTRY_ctr INIT(0);
549 EXTERN unsigned long UPD_CAF_BH_UPDATABLE_ctr INIT(0);
550 EXTERN unsigned long UPD_CAF_BH_SINGLE_ENTRY_ctr INIT(0);
551
552 EXTERN unsigned long GC_SEL_ABANDONED_ctr INIT(0);
553 EXTERN unsigned long GC_SEL_MINOR_ctr INIT(0);
554 EXTERN unsigned long GC_SEL_MAJOR_ctr INIT(0);
555
556 EXTERN unsigned long GC_FAILED_PROMOTION_ctr INIT(0);
557
558 EXTERN unsigned long GC_WORDS_COPIED_ctr INIT(0);
559
560 #undef INIT
561 #undef EXTERN
562
563 /* -----------------------------------------------------------------------------
564    Just stubs if no ticky-ticky profiling
565    -------------------------------------------------------------------------- */
566
567 #else /* !TICKY_TICKY */
568
569 #define TICK_ALLOC_HEAP(words, f_ct)
570 #define TICK_ALLOC_HEAP_NOCTR(words)
571
572 #define TICK_ALLOC_FUN(g,s)
573 #define TICK_ALLOC_UP_THK(g,s)
574 #define TICK_ALLOC_SE_THK(g,s)
575 #define TICK_ALLOC_CON(g,s)
576 #define TICK_ALLOC_TUP(g,s)
577 #define TICK_ALLOC_BH(g,s)
578 #define TICK_ALLOC_UPD_PAP(g,s)
579 #define TICK_ALLOC_TSO(g,s)
580 #define TICK_ALLOC_FMBQ(a,g,s)
581 #define TICK_ALLOC_FME(a,g,s)
582 #define TICK_ALLOC_BF(a,g,s)
583 #define TICK_ALLOC_PRIM(a,g,s)
584 #define TICK_ALLOC_PRIM2(w)
585
586 #define TICK_ENT_VIA_NODE()     
587                                 
588 #define TICK_ENT_THK()
589 #define TICK_ENT_FUN_STD(n)
590 #define TICK_ENT_FUN_DIRECT(n)
591                                 
592 #define TICK_ENT_CON(n)
593 #define TICK_ENT_IND(n)
594 #define TICK_ENT_PERM_IND(n)
595 #define TICK_ENT_PAP(n)
596 #define TICK_ENT_AP_UPD(n)
597 #define TICK_ENT_BH()
598
599 #define TICK_RET_NEW(n)
600 #define TICK_RET_OLD(n)
601 #define TICK_RET_UNBOXED_TUP(n)
602 #define TICK_RET_SEMI(n)
603 #define TICK_RET_SEMI_BY_DEFAULT()
604 #define TICK_RET_SEMI_FAILED(tag)
605 #define TICK_VEC_RETURN(n)
606
607 #define TICK_UPDF_OMITTED()
608 #define TICK_UPDF_PUSHED(tgt,inf)
609 #define TICK_SEQF_PUSHED()
610 #define TICK_CATCHF_PUSHED()
611 #define TICK_UPDF_RCC_PUSHED()
612 #define TICK_UPDF_RCC_OMITTED()
613
614 #define TICK_UPD_SQUEEZED()
615 #define TICK_UPD_CON_IN_NEW(n)
616 #define TICK_UPD_CON_IN_PLACE(n)
617 #define TICK_UPD_PAP_IN_NEW(n)
618 #define TICK_UPD_PAP_IN_PLACE()
619
620 #define TICK_UPD_NEW_IND()
621 #define TICK_UPD_NEW_PERM_IND(tgt)
622 #define TICK_UPD_OLD_IND()
623 #define TICK_UPD_OLD_PERM_IND()
624
625 #define TICK_UPD_BH_UPDATABLE()
626 #define TICK_UPD_BH_SINGLE_ENTRY()
627 #define TICK_UPD_CAF_BH_UPDATABLE()
628 #define TICK_UPD_CAF_BH_SINGLE_ENTRY()
629
630 #define TICK_GC_SEL_ABANDONED()
631 #define TICK_GC_SEL_MINOR()
632 #define TICK_GC_SEL_MAJOR()
633
634 #define TICK_GC_FAILED_PROMOTION()
635 #define TICK_GC_WORDS_COPIED(n)
636
637 #endif /* !TICKY_TICKY */
638
639 #endif /* TICKY_H */