[project @ 1999-03-05 12:43:26 by kw217]
[ghc-hetmet.git] / ghc / rts / Ticky.c
1 /* -----------------------------------------------------------------------------
2  * $Id: Ticky.c,v 1.5 1999/03/05 12:43:26 kw217 Exp $
3  *
4  * (c) The AQUA project, Glasgow University, 1992-1997
5  * (c) The GHC Team, 1998-1999
6  *
7  * Ticky-ticky profiling
8  *-------------------------------------------------------------------------- */
9
10 #if defined(TICKY_TICKY)
11
12 #define TICKY_C                 /* define those variables */
13 #include "Rts.h"
14 #include "RtsFlags.h"
15 #include "Ticky.h"
16
17 /* -----------------------------------------------------------------------------
18    Print out all the counters
19    -------------------------------------------------------------------------- */
20
21 static void printRegisteredCounterInfo (FILE *); /* fwd decl */
22
23 #define INTAVG(a,b) ((b == 0) ? 0.0 : ((double) (a) / (double) (b)))
24 #define PC(a)       (100.0 * a)
25
26 #define AVG(thing) \
27         StgDouble avg##thing  = INTAVG(tot##thing,ctr##thing)
28
29 void
30 PrintTickyInfo(void)
31 {
32   unsigned long i;
33   unsigned long tot_allocs = /* total number of things allocated */
34         ALLOC_FUN_ctr + ALLOC_THK_ctr + ALLOC_CON_ctr + ALLOC_TUP_ctr +
35         ALLOC_TSO_ctr +
36 #ifdef PAR
37         ALLOC_FMBQ_ctr + ALLOC_FME_ctr + ALLOC_BF_ctr +
38 #endif
39         ALLOC_BH_ctr  + ALLOC_UPD_PAP_ctr + ALLOC_PRIM_ctr;
40
41   unsigned long tot_adm_wds = /* total number of admin words allocated */
42         ALLOC_FUN_adm + ALLOC_THK_adm + ALLOC_CON_adm + ALLOC_TUP_adm +
43         ALLOC_TSO_adm +
44 #ifdef PAR
45         ALLOC_FMBQ_adm + ALLOC_FME_adm + ALLOC_BF_adm +
46 #endif
47         ALLOC_BH_adm  + ALLOC_UPD_PAP_adm + ALLOC_PRIM_adm;
48
49   unsigned long tot_gds_wds = /* total number of words of ``good stuff'' allocated */
50         ALLOC_FUN_gds + ALLOC_THK_gds + ALLOC_CON_gds + ALLOC_TUP_gds +
51         ALLOC_TSO_gds +
52 #ifdef PAR
53         ALLOC_FMBQ_gds + ALLOC_FME_gds + ALLOC_BF_gds +
54 #endif
55
56         ALLOC_BH_gds  + ALLOC_UPD_PAP_gds + ALLOC_PRIM_gds;
57
58   unsigned long tot_slp_wds = /* total number of ``slop'' words allocated */
59         ALLOC_FUN_slp + ALLOC_THK_slp + ALLOC_CON_slp + ALLOC_TUP_slp +
60         ALLOC_TSO_slp +
61 #ifdef PAR
62         ALLOC_FMBQ_slp + ALLOC_FME_slp + ALLOC_BF_slp +
63 #endif
64         ALLOC_BH_slp  + ALLOC_UPD_PAP_slp + ALLOC_PRIM_slp;
65
66   unsigned long tot_wds = /* total words */
67         tot_adm_wds + tot_gds_wds + tot_slp_wds;
68
69   unsigned long tot_enters =
70         ENT_CON_ctr + ENT_FUN_DIRECT_ctr +
71         ENT_IND_ctr + ENT_PAP_ctr + ENT_THK_ctr;
72   unsigned long jump_direct_enters =
73         tot_enters - ENT_VIA_NODE_ctr;
74   unsigned long bypass_enters =
75         ENT_FUN_DIRECT_ctr -
76         (ENT_FUN_STD_ctr - UPD_PAP_IN_NEW_ctr);
77
78   unsigned long tot_returns =
79         RET_NEW_ctr + RET_OLD_ctr + RET_UNBOXED_TUP_ctr +
80         RET_SEMI_IN_HEAP_ctr + RET_SEMI_BY_DEFAULT_ctr/*?*/;
81
82   unsigned long tot_returns_of_new = RET_NEW_ctr;
83
84   unsigned long pap_updates = UPD_PAP_IN_NEW_ctr + UPD_PAP_IN_PLACE_ctr;
85
86   unsigned long tot_updates = UPD_EXISTING_ctr + UPD_SQUEEZED_ctr + pap_updates;
87
88   unsigned long tot_new_updates   = UPD_NEW_IND_ctr;
89   unsigned long tot_old_updates   = UPD_OLD_IND_ctr;
90   unsigned long tot_gengc_updates = tot_new_updates + tot_old_updates;
91
92   FILE *tf = RtsFlags.TickyFlags.tickyFile;
93
94   fprintf(tf,"\n\nALLOCATIONS: %ld (%ld words total: %ld admin, %ld goods, %ld slop)\n",
95           tot_allocs, tot_wds, tot_adm_wds, tot_gds_wds, tot_slp_wds);
96   fprintf(tf,"\t\t\t\ttotal words:\t    2     3     4     5    6+\n");
97
98 #define ALLOC_HISTO_MAGIC(categ) \
99         (PC(INTAVG(ALLOC_##categ##_hst[0], ALLOC_##categ##_ctr))), \
100         (PC(INTAVG(ALLOC_##categ##_hst[1], ALLOC_##categ##_ctr))), \
101         (PC(INTAVG(ALLOC_##categ##_hst[2], ALLOC_##categ##_ctr))), \
102         (PC(INTAVG(ALLOC_##categ##_hst[3], ALLOC_##categ##_ctr))), \
103         (PC(INTAVG(ALLOC_##categ##_hst[4], ALLOC_##categ##_ctr)))
104
105   fprintf(tf,"%7ld (%5.1f%%) function values",
106         ALLOC_FUN_ctr,
107         PC(INTAVG(ALLOC_FUN_ctr, tot_allocs)));
108   if (ALLOC_FUN_ctr != 0)
109       fprintf(tf,"\t\t%5.1f %5.1f %5.1f %5.1f %5.1f", ALLOC_HISTO_MAGIC(FUN));
110
111   fprintf(tf,"\n%7ld (%5.1f%%) thunks",
112         ALLOC_THK_ctr,
113         PC(INTAVG(ALLOC_THK_ctr, tot_allocs)));
114   if (ALLOC_THK_ctr != 0)
115       fprintf(tf,"\t\t\t\t%5.1f %5.1f %5.1f %5.1f %5.1f", ALLOC_HISTO_MAGIC(THK));
116
117   fprintf(tf,"\n%7ld (%5.1f%%) data values",
118         ALLOC_CON_ctr,
119         PC(INTAVG(ALLOC_CON_ctr, tot_allocs)));
120   if (ALLOC_CON_ctr != 0)
121       fprintf(tf,"\t\t\t%5.1f %5.1f %5.1f %5.1f %5.1f", ALLOC_HISTO_MAGIC(CON));
122
123   fprintf(tf,"\n%7ld (%5.1f%%) big tuples",
124         ALLOC_TUP_ctr,
125         PC(INTAVG(ALLOC_TUP_ctr, tot_allocs)));
126   if (ALLOC_TUP_ctr != 0)
127       fprintf(tf,"\t\t\t%5.1f %5.1f %5.1f %5.1f %5.1f", ALLOC_HISTO_MAGIC(TUP));
128
129   fprintf(tf,"\n%7ld (%5.1f%%) black holes",
130         ALLOC_BH_ctr,
131         PC(INTAVG(ALLOC_BH_ctr, tot_allocs)));
132   if (ALLOC_BH_ctr != 0)
133       fprintf(tf,"\t\t\t%5.1f %5.1f %5.1f %5.1f %5.1f", ALLOC_HISTO_MAGIC(BH));
134
135   fprintf(tf,"\n%7ld (%5.1f%%) prim things",
136         ALLOC_PRIM_ctr,
137         PC(INTAVG(ALLOC_PRIM_ctr, tot_allocs)));
138   if (ALLOC_PRIM_ctr != 0)
139       fprintf(tf,"\t\t\t%5.1f %5.1f %5.1f %5.1f %5.1f", ALLOC_HISTO_MAGIC(PRIM));
140
141   fprintf(tf,"\n%7ld (%5.1f%%) partial applications",
142         ALLOC_UPD_PAP_ctr,
143         PC(INTAVG(ALLOC_UPD_PAP_ctr, tot_allocs)));
144   if (ALLOC_UPD_PAP_ctr != 0)
145       fprintf(tf,"\t\t%5.1f %5.1f %5.1f %5.1f %5.1f", ALLOC_HISTO_MAGIC(UPD_PAP));
146
147   fprintf(tf,"\n%7ld (%5.1f%%) thread state objects",
148         ALLOC_TSO_ctr,
149         PC(INTAVG(ALLOC_TSO_ctr, tot_allocs)));
150   if (ALLOC_TSO_ctr != 0)
151       fprintf(tf,"\t\t%5.1f %5.1f %5.1f %5.1f %5.1f", ALLOC_HISTO_MAGIC(TSO));
152 #ifdef PAR
153   fprintf(tf,"\n%7ld (%5.1f%%) thread state objects",
154         ALLOC_FMBQ_ctr,
155         PC(INTAVG(ALLOC_FMBQ_ctr, tot_allocs)));
156   if (ALLOC_FMBQ_ctr != 0)
157       fprintf(tf,"\t\t%5.1f %5.1f %5.1f %5.1f %5.1f", ALLOC_HISTO_MAGIC(FMBQ));
158   fprintf(tf,"\n%7ld (%5.1f%%) thread state objects",
159         ALLOC_FME_ctr,
160         PC(INTAVG(ALLOC_FME_ctr, tot_allocs)));
161   if (ALLOC_FME_ctr != 0)
162       fprintf(tf,"\t\t%5.1f %5.1f %5.1f %5.1f %5.1f", ALLOC_HISTO_MAGIC(FME));
163   fprintf(tf,"\n%7ld (%5.1f%%) thread state objects",
164         ALLOC_BF_ctr,
165         PC(INTAVG(ALLOC_BF_ctr, tot_allocs)));
166   if (ALLOC_BF_ctr != 0)
167       fprintf(tf,"\t\t%5.1f %5.1f %5.1f %5.1f %5.1f", ALLOC_HISTO_MAGIC(BF));
168 #endif
169   fprintf(tf,"\n");
170
171   fprintf(tf,"\nTotal storage-manager allocations: %ld (%ld words)\n\t[%ld words lost to speculative heap-checks]\n", ALLOC_HEAP_ctr, ALLOC_HEAP_tot, ALLOC_HEAP_tot - tot_wds);
172
173   fprintf(tf,"\nSTACK USAGE:\n"); /* NB: some bits are direction sensitive */
174
175   fprintf(tf,"\nENTERS: %ld  of which %ld (%.1f%%) direct to the entry code\n\t\t  [the rest indirected via Node's info ptr]\n",
176         tot_enters,
177         jump_direct_enters,
178         PC(INTAVG(jump_direct_enters,tot_enters)));
179   fprintf(tf,"%7ld (%5.1f%%) thunks\n",
180         ENT_THK_ctr,
181         PC(INTAVG(ENT_THK_ctr,tot_enters)));
182   fprintf(tf,"%7ld (%5.1f%%) data values\n",
183         ENT_CON_ctr,
184         PC(INTAVG(ENT_CON_ctr,tot_enters)));
185   fprintf(tf,"%7ld (%5.1f%%) function values\n\t\t  [of which %ld (%.1f%%) bypassed arg-satisfaction chk]\n",
186         ENT_FUN_DIRECT_ctr,
187         PC(INTAVG(ENT_FUN_DIRECT_ctr,tot_enters)),
188         bypass_enters,
189         PC(INTAVG(bypass_enters,ENT_FUN_DIRECT_ctr)));
190   fprintf(tf,"%7ld (%5.1f%%) partial applications\n",
191         ENT_PAP_ctr,
192         PC(INTAVG(ENT_PAP_ctr,tot_enters)));
193   fprintf(tf,"%7ld (%5.1f%%) indirections\n",
194         ENT_IND_ctr,
195         PC(INTAVG(ENT_IND_ctr,tot_enters)));
196
197   fprintf(tf,"\nRETURNS: %ld\n", tot_returns);
198   fprintf(tf,"%7ld (%5.1f%%) from entering a new constructor\n\t\t  [the rest from entering an existing constructor]\n",
199         tot_returns_of_new,
200         PC(INTAVG(tot_returns_of_new,tot_returns)));
201   fprintf(tf,"%7ld (%5.1f%%) vectored [the rest unvectored]\n",
202         VEC_RETURN_ctr,
203         PC(INTAVG(VEC_RETURN_ctr,tot_returns)));
204
205   fprintf(tf, "\nRET_NEW:         %7ld: ", RET_NEW_ctr);
206   for (i = 0; i < 9; i++) { fprintf(tf, "%5.1f%%",
207                                 PC(INTAVG(RET_NEW_hst[i],RET_NEW_ctr))); }
208   fprintf(tf, "\n");
209   fprintf(tf, "RET_OLD:         %7ld: ", RET_OLD_ctr);
210   for (i = 0; i < 9; i++) { fprintf(tf, "%5.1f%%",
211                                 PC(INTAVG(RET_OLD_hst[i],RET_OLD_ctr))); }
212   fprintf(tf, "\n");
213   fprintf(tf, "RET_UNBOXED_TUP: %7ld: ", RET_UNBOXED_TUP_ctr);
214   for (i = 0; i < 9; i++) { fprintf(tf, "%5.1f%%",
215                                     PC(INTAVG(RET_UNBOXED_TUP_hst[i],
216                                               RET_UNBOXED_TUP_ctr))); }
217   fprintf(tf, "\n");
218   fprintf(tf, "\nRET_VEC_RETURN : %7ld: ", VEC_RETURN_ctr);
219   for (i = 0; i < 9; i++) { fprintf(tf, "%5.1f%%",
220                                 PC(INTAVG(RET_VEC_RETURN_hst[i],VEC_RETURN_ctr))); }
221   fprintf(tf, "\n");
222
223   fprintf(tf,"\nUPDATE FRAMES: %ld (%ld omitted from thunks)",
224         UPDF_PUSHED_ctr,
225         UPDF_OMITTED_ctr);
226
227   fprintf(tf,"\nSEQ FRAMES:    %ld", SEQF_PUSHED_ctr);
228
229   fprintf(tf,"\nCATCH FRAMES:  %ld", CATCHF_PUSHED_ctr);
230
231   if (UPDF_RCC_PUSHED_ctr != 0)
232      fprintf(tf,"%7ld restore cost centre frames (%ld omitted)\n",
233         UPDF_RCC_PUSHED_ctr,
234         UPDF_RCC_OMITTED_ctr);
235
236   fprintf(tf,"\nUPDATES: %ld\n", tot_updates);
237   fprintf(tf,"%7ld (%5.1f%%) data values\n",
238         UPD_CON_IN_NEW_ctr,
239         PC(INTAVG(UPD_CON_IN_NEW_ctr,tot_updates)));
240   fprintf(tf,"%7ld (%5.1f%%) partial applications\n\t\t  [%ld in place, %ld allocated new space]\n",
241         pap_updates,
242         PC(INTAVG(pap_updates,tot_updates)),
243         UPD_PAP_IN_PLACE_ctr, UPD_PAP_IN_NEW_ctr);
244   fprintf(tf,"%7ld (%5.1f%%) updates to existing heap objects (%ld by squeezing)\n",
245         UPD_EXISTING_ctr + UPD_SQUEEZED_ctr,
246         PC(INTAVG(UPD_EXISTING_ctr + UPD_SQUEEZED_ctr, tot_updates)),
247         UPD_SQUEEZED_ctr);
248
249   fprintf(tf, "UPD_CON_IN_NEW:   %7ld: ", UPD_CON_IN_NEW_ctr);
250   for (i = 0; i < 9; i++) { fprintf(tf, "%7ld", UPD_CON_IN_NEW_hst[i]); }
251   fprintf(tf, "\n");
252   fprintf(tf, "UPD_PAP_IN_NEW:   %7ld: ", UPD_PAP_IN_NEW_ctr);
253   for (i = 0; i < 9; i++) { fprintf(tf, "%7ld", UPD_PAP_IN_NEW_hst[i]); }
254   fprintf(tf, "\n");
255
256   if (tot_gengc_updates != 0) {
257       fprintf(tf,"\nNEW GEN UPDATES: %ld (%5.1f%%)\n",
258               tot_new_updates,
259               PC(INTAVG(tot_new_updates,tot_gengc_updates)));
260       fprintf(tf,"\nOLD GEN UPDATES: %ld (%5.1f%%)\n",
261               tot_old_updates,
262               PC(INTAVG(tot_old_updates,tot_gengc_updates)));
263   }
264
265   fprintf(tf,"\nTotal bytes copied during GC: %ld\n",
266           GC_WORDS_COPIED_ctr * sizeof(W_));
267
268 #if 0
269   printRegisteredCounterInfo(tf);
270 #endif
271
272   fprintf(tf,"\n**************************************************\n");
273
274   /* here, we print out all the raw numbers; these are really
275     more useful when we want to snag them for subsequent
276     rdb-etc processing. WDP 95/11
277   */
278
279 #define PR_CTR(ctr) \
280   do { fprintf(tf,"%7ld " #ctr "\n", ctr); } while(0)
281 #define PR_HST(hst,i) \
282   do { fprintf(tf,"%7ld " #hst "_" #i "\n", hst[i]); } while(0)
283
284   PR_CTR(ALLOC_HEAP_ctr);
285   PR_CTR(ALLOC_HEAP_tot);
286
287   PR_CTR(ALLOC_FUN_ctr);
288   PR_CTR(ALLOC_FUN_adm);
289   PR_CTR(ALLOC_FUN_gds);
290   PR_CTR(ALLOC_FUN_slp);
291   PR_HST(ALLOC_FUN_hst,0);
292   PR_HST(ALLOC_FUN_hst,1);
293   PR_HST(ALLOC_FUN_hst,2);
294   PR_HST(ALLOC_FUN_hst,3);
295   PR_HST(ALLOC_FUN_hst,4);
296   PR_CTR(ALLOC_THK_ctr);
297   PR_CTR(ALLOC_THK_adm);
298   PR_CTR(ALLOC_THK_gds);
299   PR_CTR(ALLOC_THK_slp);
300   PR_HST(ALLOC_THK_hst,0);
301   PR_HST(ALLOC_THK_hst,1);
302   PR_HST(ALLOC_THK_hst,2);
303   PR_HST(ALLOC_THK_hst,3);
304   PR_HST(ALLOC_THK_hst,4);
305   PR_CTR(ALLOC_CON_ctr);
306   PR_CTR(ALLOC_CON_adm);
307   PR_CTR(ALLOC_CON_gds);
308   PR_CTR(ALLOC_CON_slp);
309   PR_HST(ALLOC_CON_hst,0);
310   PR_HST(ALLOC_CON_hst,1);
311   PR_HST(ALLOC_CON_hst,2);
312   PR_HST(ALLOC_CON_hst,3);
313   PR_HST(ALLOC_CON_hst,4);
314   PR_CTR(ALLOC_TUP_ctr);
315   PR_CTR(ALLOC_TUP_adm);
316   PR_CTR(ALLOC_TUP_gds);
317   PR_CTR(ALLOC_TUP_slp);
318   PR_HST(ALLOC_TUP_hst,0);
319   PR_HST(ALLOC_TUP_hst,1);
320   PR_HST(ALLOC_TUP_hst,2);
321   PR_HST(ALLOC_TUP_hst,3);
322   PR_HST(ALLOC_TUP_hst,4);
323   PR_CTR(ALLOC_BH_ctr);
324   PR_CTR(ALLOC_BH_adm);
325   PR_CTR(ALLOC_BH_gds);
326   PR_CTR(ALLOC_BH_slp);
327   PR_HST(ALLOC_BH_hst,0);
328   PR_HST(ALLOC_BH_hst,1);
329   PR_HST(ALLOC_BH_hst,2);
330   PR_HST(ALLOC_BH_hst,3);
331   PR_HST(ALLOC_BH_hst,4);
332   PR_CTR(ALLOC_PRIM_ctr);
333   PR_CTR(ALLOC_PRIM_adm);
334   PR_CTR(ALLOC_PRIM_gds);
335   PR_CTR(ALLOC_PRIM_slp);
336   PR_HST(ALLOC_PRIM_hst,0);
337   PR_HST(ALLOC_PRIM_hst,1);
338   PR_HST(ALLOC_PRIM_hst,2);
339   PR_HST(ALLOC_PRIM_hst,3);
340   PR_HST(ALLOC_PRIM_hst,4);
341   PR_CTR(ALLOC_UPD_PAP_ctr);
342   PR_CTR(ALLOC_UPD_PAP_adm);
343   PR_CTR(ALLOC_UPD_PAP_gds);
344   PR_CTR(ALLOC_UPD_PAP_slp);
345   PR_HST(ALLOC_UPD_PAP_hst,0);
346   PR_HST(ALLOC_UPD_PAP_hst,1);
347   PR_HST(ALLOC_UPD_PAP_hst,2);
348   PR_HST(ALLOC_UPD_PAP_hst,3);
349   PR_HST(ALLOC_UPD_PAP_hst,4);
350
351   PR_CTR(ALLOC_TSO_ctr);
352   PR_CTR(ALLOC_TSO_adm);
353   PR_CTR(ALLOC_TSO_gds);
354   PR_CTR(ALLOC_TSO_slp);
355   PR_HST(ALLOC_TSO_hst,0);
356   PR_HST(ALLOC_TSO_hst,1);
357   PR_HST(ALLOC_TSO_hst,2);
358   PR_HST(ALLOC_TSO_hst,3);
359   PR_HST(ALLOC_TSO_hst,4);
360
361 #ifdef PAR
362   PR_CTR(ALLOC_FMBQ_ctr);
363   PR_CTR(ALLOC_FMBQ_adm);
364   PR_CTR(ALLOC_FMBQ_gds);
365   PR_CTR(ALLOC_FMBQ_slp);
366   PR_HST(ALLOC_FMBQ_hst,0);
367   PR_HST(ALLOC_FMBQ_hst,1);
368   PR_HST(ALLOC_FMBQ_hst,2);
369   PR_HST(ALLOC_FMBQ_hst,3);
370   PR_HST(ALLOC_FMBQ_hst,4);
371   PR_CTR(ALLOC_FME_ctr);
372   PR_CTR(ALLOC_FME_adm);
373   PR_CTR(ALLOC_FME_gds);
374   PR_CTR(ALLOC_FME_slp);
375   PR_HST(ALLOC_FME_hst,0);
376   PR_HST(ALLOC_FME_hst,1);
377   PR_HST(ALLOC_FME_hst,2);
378   PR_HST(ALLOC_FME_hst,3);
379   PR_HST(ALLOC_FME_hst,4);
380   PR_CTR(ALLOC_BF_ctr);
381   PR_CTR(ALLOC_BF_adm);
382   PR_CTR(ALLOC_BF_gds);
383   PR_CTR(ALLOC_BF_slp);
384   PR_HST(ALLOC_BF_hst,0);
385   PR_HST(ALLOC_BF_hst,1);
386   PR_HST(ALLOC_BF_hst,2);
387   PR_HST(ALLOC_BF_hst,3);
388   PR_HST(ALLOC_BF_hst,4);
389 #endif
390
391   PR_CTR(ENT_VIA_NODE_ctr);
392   PR_CTR(ENT_CON_ctr);
393   PR_CTR(ENT_FUN_STD_ctr);
394   PR_CTR(ENT_FUN_DIRECT_ctr);
395   PR_CTR(ENT_IND_ctr);
396   PR_CTR(ENT_PAP_ctr);
397   PR_CTR(ENT_AP_UPD_ctr);
398   PR_CTR(ENT_BH_ctr);
399   PR_CTR(ENT_THK_ctr);
400
401   PR_CTR(RET_NEW_ctr);
402   PR_CTR(RET_OLD_ctr);
403   PR_CTR(RET_UNBOXED_TUP_ctr);
404   PR_CTR(RET_SEMI_BY_DEFAULT_ctr);
405   PR_CTR(RET_SEMI_IN_HEAP_ctr);
406   PR_CTR(RET_SEMI_FAILED_IND_ctr);
407   PR_CTR(RET_SEMI_FAILED_UNEVAL_ctr);
408   PR_CTR(VEC_RETURN_ctr);
409
410   PR_HST(RET_NEW_hst,0);
411   PR_HST(RET_NEW_hst,1);
412   PR_HST(RET_NEW_hst,2);
413   PR_HST(RET_NEW_hst,3);
414   PR_HST(RET_NEW_hst,4);
415   PR_HST(RET_NEW_hst,5);
416   PR_HST(RET_NEW_hst,6);
417   PR_HST(RET_NEW_hst,7);
418   PR_HST(RET_NEW_hst,8);
419   PR_HST(RET_OLD_hst,0);
420   PR_HST(RET_OLD_hst,1);
421   PR_HST(RET_OLD_hst,2);
422   PR_HST(RET_OLD_hst,3);
423   PR_HST(RET_OLD_hst,4);
424   PR_HST(RET_OLD_hst,5);
425   PR_HST(RET_OLD_hst,6);
426   PR_HST(RET_OLD_hst,7);
427   PR_HST(RET_OLD_hst,8);
428   PR_HST(RET_UNBOXED_TUP_hst,0);
429   PR_HST(RET_UNBOXED_TUP_hst,1);
430   PR_HST(RET_UNBOXED_TUP_hst,2);
431   PR_HST(RET_UNBOXED_TUP_hst,3);
432   PR_HST(RET_UNBOXED_TUP_hst,4);
433   PR_HST(RET_UNBOXED_TUP_hst,5);
434   PR_HST(RET_UNBOXED_TUP_hst,6);
435   PR_HST(RET_UNBOXED_TUP_hst,7);
436   PR_HST(RET_UNBOXED_TUP_hst,8);
437   PR_HST(RET_SEMI_IN_HEAP_hst,0);
438   PR_HST(RET_SEMI_IN_HEAP_hst,1);
439   PR_HST(RET_SEMI_IN_HEAP_hst,2);
440   PR_HST(RET_SEMI_IN_HEAP_hst,3);
441   PR_HST(RET_SEMI_IN_HEAP_hst,4);
442   PR_HST(RET_SEMI_IN_HEAP_hst,5);
443   PR_HST(RET_SEMI_IN_HEAP_hst,6);
444   PR_HST(RET_SEMI_IN_HEAP_hst,7);
445   PR_HST(RET_SEMI_IN_HEAP_hst,8);
446   PR_HST(RET_VEC_RETURN_hst,0);
447   PR_HST(RET_VEC_RETURN_hst,1);
448   PR_HST(RET_VEC_RETURN_hst,2);
449   PR_HST(RET_VEC_RETURN_hst,3);
450   PR_HST(RET_VEC_RETURN_hst,4);
451   PR_HST(RET_VEC_RETURN_hst,5);
452   PR_HST(RET_VEC_RETURN_hst,6);
453   PR_HST(RET_VEC_RETURN_hst,7);
454   PR_HST(RET_VEC_RETURN_hst,8);
455
456   PR_CTR(RET_SEMI_loads_avoided);
457
458   PR_CTR(UPDF_OMITTED_ctr);
459   PR_CTR(UPDF_PUSHED_ctr);
460   PR_CTR(SEQF_PUSHED_ctr);
461   PR_CTR(CATCHF_PUSHED_ctr);
462
463   PR_CTR(UPDF_RCC_PUSHED_ctr);
464   PR_CTR(UPDF_RCC_OMITTED_ctr);
465
466   PR_CTR(UPD_EXISTING_ctr);
467   PR_CTR(UPD_SQUEEZED_ctr);
468   PR_CTR(UPD_CON_IN_NEW_ctr);
469   PR_CTR(UPD_PAP_IN_NEW_ctr);
470   PR_CTR(UPD_PAP_IN_PLACE_ctr);
471
472   PR_HST(UPD_CON_IN_NEW_hst,0);
473   PR_HST(UPD_CON_IN_NEW_hst,1);
474   PR_HST(UPD_CON_IN_NEW_hst,2);
475   PR_HST(UPD_CON_IN_NEW_hst,3);
476   PR_HST(UPD_CON_IN_NEW_hst,4);
477   PR_HST(UPD_CON_IN_NEW_hst,5);
478   PR_HST(UPD_CON_IN_NEW_hst,6);
479   PR_HST(UPD_CON_IN_NEW_hst,7);
480   PR_HST(UPD_CON_IN_NEW_hst,8);
481   PR_HST(UPD_PAP_IN_NEW_hst,0);
482   PR_HST(UPD_PAP_IN_NEW_hst,1);
483   PR_HST(UPD_PAP_IN_NEW_hst,2);
484   PR_HST(UPD_PAP_IN_NEW_hst,3);
485   PR_HST(UPD_PAP_IN_NEW_hst,4);
486   PR_HST(UPD_PAP_IN_NEW_hst,5);
487   PR_HST(UPD_PAP_IN_NEW_hst,6);
488   PR_HST(UPD_PAP_IN_NEW_hst,7);
489   PR_HST(UPD_PAP_IN_NEW_hst,8);
490
491   PR_CTR(UPD_NEW_IND_ctr);
492   PR_CTR(UPD_OLD_IND_ctr);
493
494   PR_CTR(GC_SEL_ABANDONED_ctr);
495   PR_CTR(GC_SEL_MINOR_ctr);
496   PR_CTR(GC_SEL_MAJOR_ctr);
497   PR_CTR(GC_FAILED_PROMOTION_ctr);
498   PR_CTR(GC_WORDS_COPIED_ctr);
499 }
500
501 #if 0
502 /* Data structure used in ``registering'' one of these counters. */
503
504 struct ent_counter *ListOfEntryCtrs = NULL; /* root of list of them */
505
506 /* To print out all the registered-counter info: */
507
508 static void
509 printRegisteredCounterInfo (FILE *tf)
510 {
511     struct ent_counter *p;
512
513     if ( ListOfEntryCtrs != NULL ) {
514         fprintf(tf,"\n**************************************************\n");
515     }
516
517     for (p = ListOfEntryCtrs; p != NULL; p = p->link) {
518         /* common stuff first; then the wrapper info if avail */
519         fprintf(tf, "%-40s%u\t%u\t%u\t%-16s%ld",
520                 p->f_str,
521                 p->arity,
522                 p->Astk_args,
523                 p->Bstk_args,
524                 p->f_arg_kinds,
525                 p->ctr);
526
527         if ( p->wrap_str == NULL ) {
528             fprintf(tf, "\n");
529
530         } else {
531             fprintf(tf, "\t%s\t%s\n",
532                 p->wrap_str,
533                 p->wrap_arg_kinds);
534         }
535     }
536 }
537 #endif
538
539 #endif /* TICKY_TICKY */