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