2 % (c) The GRASP Project, Glasgow University, 1992-1993
4 %************************************************************************
6 \section[RednCounts.lc]{Stuff for ``ticky-ticky'' profiling}
8 %************************************************************************
10 Goes with \tr{imports/RednCounts.lh}; more documentation there.
12 %************************************************************************
14 \subsection[RednCounts-counters]{Declare all the counters}
16 %************************************************************************
19 #define NULL_REG_MAP /* Not threaded */
21 #include "../storage/SMinternal.h" /* Bad boy, Will (ToDo) */
23 #if defined(DO_REDN_COUNTING)
25 extern FILE *tickyfile;
27 I_ ALLOC_HEAP_ctr = 0;
28 I_ ALLOC_HEAP_tot = 0;
30 PP_ max_SpA; /* set in re_enterable_part_of_main */
34 I_ A_STK_REUSE_ctr = 0;
35 I_ B_STK_REUSE_ctr = 0;
37 I_ A_STK_STUB_ctr = 0;
43 I_ ALLOC_FUN_hst[5] = {0,0,0,0,0};
48 I_ ALLOC_THK_hst[5] = {0,0,0,0,0};
53 I_ ALLOC_CON_hst[5] = {0,0,0,0,0};
58 I_ ALLOC_TUP_hst[5] = {0,0,0,0,0};
63 I_ ALLOC_BH_hst[5] = {0,0,0,0,0};
69 I_ ALLOC_PAP_hst[5] = {0,0,0,0,0};
71 I_ ALLOC_PRIM_ctr = 0;
72 I_ ALLOC_PRIM_adm = 0;
73 I_ ALLOC_PRIM_gds = 0;
74 I_ ALLOC_PRIM_slp = 0;
75 I_ ALLOC_PRIM_hst[5] = {0,0,0,0,0};
77 I_ ALLOC_UPD_CON_ctr = 0;
78 I_ ALLOC_UPD_CON_adm = 0;
79 I_ ALLOC_UPD_CON_gds = 0;
80 I_ ALLOC_UPD_CON_slp = 0;
81 I_ ALLOC_UPD_CON_hst[5] = {0,0,0,0,0};
83 I_ ALLOC_UPD_PAP_ctr = 0;
84 I_ ALLOC_UPD_PAP_adm = 0;
85 I_ ALLOC_UPD_PAP_gds = 0;
86 I_ ALLOC_UPD_PAP_slp = 0;
87 I_ ALLOC_UPD_PAP_hst[5] = {0,0,0,0,0};
94 I_ ALLOC_STK_hst[5] = {0,0,0,0,0};
99 I_ ALLOC_TSO_hst[5] = {0,0,0,0,0};
102 I_ ALLOC_FMBQ_ctr = 0;
103 I_ ALLOC_FMBQ_adm = 0;
104 I_ ALLOC_FMBQ_gds = 0;
105 I_ ALLOC_FMBQ_slp = 0;
106 I_ ALLOC_FMBQ_hst[5] = {0,0,0,0,0};
107 I_ ALLOC_FME_ctr = 0;
108 I_ ALLOC_FME_adm = 0;
109 I_ ALLOC_FME_gds = 0;
110 I_ ALLOC_FME_slp = 0;
111 I_ ALLOC_FME_hst[5] = {0,0,0,0,0};
116 I_ ALLOC_BF_hst[5] = {0,0,0,0,0};
120 I_ ENT_VIA_NODE_ctr = 0;
122 I_ ENT_FUN_STD_ctr = 0;
123 I_ ENT_FUN_DIRECT_ctr = 0;
128 I_ RET_NEW_IN_HEAP_ctr = 0;
129 I_ RET_NEW_IN_REGS_ctr = 0;
130 I_ RET_OLD_IN_HEAP_ctr = 0;
131 I_ RET_OLD_IN_REGS_ctr = 0;
132 I_ RET_SEMI_BY_DEFAULT_ctr = 0;
133 I_ RET_SEMI_IN_HEAP_ctr = 0;
134 I_ RET_SEMI_IN_REGS_ctr = 0;
135 I_ VEC_RETURN_ctr = 0;
137 I_ ReturnInRegsNodeValid = 0; /* i.e., False */
139 I_ UPDF_OMITTED_ctr = 0;
140 I_ UPDF_STD_PUSHED_ctr = 0;
141 I_ UPDF_CON_PUSHED_ctr = 0;
142 I_ UPDF_HOLE_PUSHED_ctr = 0;
144 I_ UPDF_RCC_PUSHED_ctr = 0;
145 I_ UPDF_RCC_OMITTED_ctr = 0;
147 I_ UPD_EXISTING_ctr = 0;
148 I_ UPD_CON_W_NODE_ctr = 0;
149 I_ UPD_CON_IN_PLACE_ctr = 0;
150 I_ UPD_CON_IN_NEW_ctr = 0;
151 I_ UPD_PAP_IN_PLACE_ctr = 0;
152 I_ UPD_PAP_IN_NEW_ctr = 0;
154 I_ UPD_ENTERED_ctr = 0;
155 I_ UPD_ENTERED_AGAIN_ctr = 0;
157 I_ UPD_NEW_IND_ctr = 0;
158 I_ UPD_NEW_IN_PLACE_PTRS_ctr = 0;
159 I_ UPD_NEW_IN_PLACE_NOPTRS_ctr = 0;
160 I_ UPD_OLD_IND_ctr = 0;
161 I_ UPD_OLD_IN_PLACE_PTRS_ctr = 0;
162 I_ UPD_OLD_IN_PLACE_NOPTRS_ctr = 0;
164 I_ UPD_IN_PLACE_COPY_ctr = 0;
171 TICKY_PARANOIA(const char *file, I_ line)
173 I_ tot_adm_wds = /* total number of admin words allocated */
174 ALLOC_FUN_adm + ALLOC_THK_adm + ALLOC_CON_adm + ALLOC_TUP_adm +
175 ALLOC_BH_adm /*+ ALLOC_PAP_adm*/ /*+ ALLOC_UPD_CON_adm*/ + ALLOC_UPD_PAP_adm +
177 I_ tot_gds_wds = /* total number of words of ``good stuff'' allocated */
178 ALLOC_FUN_gds + ALLOC_THK_gds + ALLOC_CON_gds + ALLOC_TUP_gds +
179 ALLOC_BH_gds /*+ ALLOC_PAP_gds*/ /*+ ALLOC_UPD_CON_gds*/ + ALLOC_UPD_PAP_gds +
181 I_ tot_slp_wds = /* total number of ``slop'' words allocated */
182 ALLOC_FUN_slp + ALLOC_THK_slp + ALLOC_CON_slp + ALLOC_TUP_slp +
183 ALLOC_BH_slp /*+ ALLOC_PAP_slp*/ /*+ ALLOC_UPD_CON_slp*/ + ALLOC_UPD_PAP_slp +
185 I_ tot_wds = /* total words */
186 tot_adm_wds + tot_gds_wds + tot_slp_wds;
187 if (ALLOC_HEAP_tot != tot_wds) {
188 fprintf(stderr, "Eek! %ld != %ld, %s, %d\n",ALLOC_HEAP_tot, tot_wds, file, line);
190 fprintf(stderr, "OK. %ld != %ld, %s, %d\n",ALLOC_HEAP_tot, tot_wds, file, line);
196 %************************************************************************
198 \subsection[RednCounts-print]{Print out all the counters}
200 %************************************************************************
203 extern void printRegisteredCounterInfo (STG_NO_ARGS); /* fwd decl */
205 #define INTAVG(a,b) ((b == 0) ? 0.0 : ((StgDouble) (a) / (StgDouble) (b)))
206 #define PC(a) (100.0 * a)
209 StgDouble CAT2(avg,thing) = INTAVG(CAT2(tot,thing),CAT2(ctr,thing))
214 I_ tot_allocs = /* total number of things allocated */
215 ALLOC_FUN_ctr + ALLOC_THK_ctr + ALLOC_CON_ctr + ALLOC_TUP_ctr +
217 ALLOC_STK_ctr + ALLOC_TSO_ctr +
219 ALLOC_FMBQ_ctr + ALLOC_FME_ctr + ALLOC_BF_ctr +
222 ALLOC_BH_ctr /*+ ALLOC_PAP_ctr*/ /*+ ALLOC_UPD_CON_ctr*/ + ALLOC_UPD_PAP_ctr +
224 I_ tot_adm_wds = /* total number of admin words allocated */
225 ALLOC_FUN_adm + ALLOC_THK_adm + ALLOC_CON_adm + ALLOC_TUP_adm +
227 ALLOC_STK_adm + ALLOC_TSO_adm +
229 ALLOC_FMBQ_adm + ALLOC_FME_adm + ALLOC_BF_adm +
232 ALLOC_BH_adm /*+ ALLOC_PAP_adm*/ /*+ ALLOC_UPD_CON_adm*/ + ALLOC_UPD_PAP_adm +
234 I_ tot_gds_wds = /* total number of words of ``good stuff'' allocated */
235 ALLOC_FUN_gds + ALLOC_THK_gds + ALLOC_CON_gds + ALLOC_TUP_gds +
237 ALLOC_STK_gds + ALLOC_TSO_gds +
239 ALLOC_FMBQ_gds + ALLOC_FME_gds + ALLOC_BF_gds +
242 ALLOC_BH_gds /*+ ALLOC_PAP_gds*/ /*+ ALLOC_UPD_CON_gds*/ + ALLOC_UPD_PAP_gds +
244 I_ tot_slp_wds = /* total number of ``slop'' words allocated */
245 ALLOC_FUN_slp + ALLOC_THK_slp + ALLOC_CON_slp + ALLOC_TUP_slp +
247 ALLOC_STK_slp + ALLOC_TSO_slp +
249 ALLOC_FMBQ_slp + ALLOC_FME_slp + ALLOC_BF_slp +
252 ALLOC_BH_slp /*+ ALLOC_PAP_slp*/ /*+ ALLOC_UPD_CON_slp*/ + ALLOC_UPD_PAP_slp +
254 I_ tot_wds = /* total words */
255 tot_adm_wds + tot_gds_wds + tot_slp_wds;
258 ENT_CON_ctr + ENT_FUN_DIRECT_ctr +
259 ENT_IND_ctr + ENT_PAP_ctr + ENT_THK_ctr;
260 I_ jump_direct_enters =
261 tot_enters - ENT_VIA_NODE_ctr;
264 (ENT_FUN_STD_ctr - UPD_PAP_IN_PLACE_ctr - UPD_PAP_IN_NEW_ctr);
266 I_ tot_returns_in_regs =
267 RET_NEW_IN_REGS_ctr + RET_OLD_IN_REGS_ctr + RET_SEMI_IN_REGS_ctr;
268 I_ tot_returns_in_heap =
269 RET_NEW_IN_HEAP_ctr + RET_OLD_IN_HEAP_ctr + RET_SEMI_IN_HEAP_ctr + RET_SEMI_BY_DEFAULT_ctr/*???*/;
270 I_ tot_returns_of_new =
271 RET_NEW_IN_REGS_ctr + RET_NEW_IN_HEAP_ctr;
272 I_ tot_returns_of_old = /* NB: NOT USED ???! 94/05 WDP */
273 RET_OLD_IN_REGS_ctr + RET_OLD_IN_HEAP_ctr +
274 RET_SEMI_BY_DEFAULT_ctr + RET_SEMI_IN_HEAP_ctr + RET_SEMI_IN_REGS_ctr /*???*/;
277 tot_returns_in_regs + tot_returns_in_heap;
280 UPDF_STD_PUSHED_ctr + UPDF_CON_PUSHED_ctr; /*DBH*/
283 UPD_CON_W_NODE_ctr + UPD_CON_IN_PLACE_ctr + UPD_CON_IN_NEW_ctr;
285 UPD_PAP_IN_PLACE_ctr + UPD_PAP_IN_NEW_ctr;
287 UPD_EXISTING_ctr + con_updates + pap_updates;
288 I_ tot_in_place_updates =
289 UPD_CON_IN_PLACE_ctr + UPD_PAP_IN_PLACE_ctr;
292 UPD_NEW_IN_PLACE_NOPTRS_ctr + UPD_NEW_IN_PLACE_PTRS_ctr + UPD_NEW_IND_ctr;
294 UPD_OLD_IN_PLACE_NOPTRS_ctr + UPD_OLD_IN_PLACE_PTRS_ctr + UPD_OLD_IND_ctr;
295 I_ tot_gengc_updates =
296 tot_new_updates + tot_old_updates;
298 fprintf(tickyfile,"\n\nALLOCATIONS: %ld (%ld words total: %ld admin, %ld goods, %ld slop)\n",
299 tot_allocs, tot_wds, tot_adm_wds, tot_gds_wds, tot_slp_wds);
300 fprintf(tickyfile,"\t\t\t\ttotal words:\t 2 3 4 5 6+\n");
302 #define ALLOC_HISTO_MAGIC(categ) \
303 (PC(INTAVG(CAT3(ALLOC_,categ,_hst)[0], CAT3(ALLOC_,categ,_ctr)))), \
304 (PC(INTAVG(CAT3(ALLOC_,categ,_hst)[1], CAT3(ALLOC_,categ,_ctr)))), \
305 (PC(INTAVG(CAT3(ALLOC_,categ,_hst)[2], CAT3(ALLOC_,categ,_ctr)))), \
306 (PC(INTAVG(CAT3(ALLOC_,categ,_hst)[3], CAT3(ALLOC_,categ,_ctr)))), \
307 (PC(INTAVG(CAT3(ALLOC_,categ,_hst)[4], CAT3(ALLOC_,categ,_ctr))))
309 fprintf(tickyfile,"%7ld (%5.1f%%) function values",
311 PC(INTAVG(ALLOC_FUN_ctr, tot_allocs)));
312 if (ALLOC_FUN_ctr != 0)
313 fprintf(tickyfile,"\t\t%5.1f %5.1f %5.1f %5.1f %5.1f", ALLOC_HISTO_MAGIC(FUN));
315 fprintf(tickyfile,"\n%7ld (%5.1f%%) thunks",
317 PC(INTAVG(ALLOC_THK_ctr, tot_allocs)));
318 if (ALLOC_THK_ctr != 0)
319 fprintf(tickyfile,"\t\t\t\t%5.1f %5.1f %5.1f %5.1f %5.1f", ALLOC_HISTO_MAGIC(THK));
321 fprintf(tickyfile,"\n%7ld (%5.1f%%) data values",
323 PC(INTAVG(ALLOC_CON_ctr, tot_allocs)));
324 if (ALLOC_CON_ctr != 0)
325 fprintf(tickyfile,"\t\t\t%5.1f %5.1f %5.1f %5.1f %5.1f", ALLOC_HISTO_MAGIC(CON));
327 fprintf(tickyfile,"\n%7ld (%5.1f%%) big tuples",
329 PC(INTAVG(ALLOC_TUP_ctr, tot_allocs)));
330 if (ALLOC_TUP_ctr != 0)
331 fprintf(tickyfile,"\t\t\t%5.1f %5.1f %5.1f %5.1f %5.1f", ALLOC_HISTO_MAGIC(TUP));
333 fprintf(tickyfile,"\n%7ld (%5.1f%%) black holes",
335 PC(INTAVG(ALLOC_BH_ctr, tot_allocs)));
336 if (ALLOC_BH_ctr != 0)
337 fprintf(tickyfile,"\t\t\t%5.1f %5.1f %5.1f %5.1f %5.1f", ALLOC_HISTO_MAGIC(BH));
339 fprintf(tickyfile,"\n%7ld (%5.1f%%) prim things",
341 PC(INTAVG(ALLOC_PRIM_ctr, tot_allocs)));
342 if (ALLOC_PRIM_ctr != 0)
343 fprintf(tickyfile,"\t\t\t%5.1f %5.1f %5.1f %5.1f %5.1f", ALLOC_HISTO_MAGIC(PRIM));
346 fprintf(tickyfile,"\n%7ld (%5.1f%%) partial applications",
348 PC(INTAVG(ALLOC_PAP_ctr, tot_allocs)));
349 if (ALLOC_PAP_ctr != 0)
350 fprintf(tickyfile,"\t\t%5.1f %5.1f %5.1f %5.1f %5.1f", ALLOC_HISTO_MAGIC(PAP));
353 fprintf(tickyfile,"\n%7ld (%5.1f%%) partial applications",
355 PC(INTAVG(ALLOC_UPD_PAP_ctr, tot_allocs)));
356 if (ALLOC_UPD_PAP_ctr != 0)
357 fprintf(tickyfile,"\t\t%5.1f %5.1f %5.1f %5.1f %5.1f", ALLOC_HISTO_MAGIC(UPD_PAP));
360 fprintf(tickyfile,"\n%7ld (%5.1f%%) data-value updates",
362 PC(INTAVG(ALLOC_UPD_CON_ctr, tot_allocs)));
363 if (ALLOC_UPD_CON_ctr != 0)
364 fprintf(tickyfile,"\t\t%5.1f %5.1f %5.1f %5.1f %5.1f", ALLOC_HISTO_MAGIC(UPD_CON));
368 fprintf(tickyfile,"\n%7ld (%5.1f%%) stack objects",
370 PC(INTAVG(ALLOC_STK_ctr, tot_allocs)));
371 if (ALLOC_STK_ctr != 0)
372 fprintf(tickyfile,"\t\t\t%5.1f %5.1f %5.1f %5.1f %5.1f", ALLOC_HISTO_MAGIC(STK));
373 fprintf(tickyfile,"\n%7ld (%5.1f%%) thread state objects",
375 PC(INTAVG(ALLOC_TSO_ctr, tot_allocs)));
376 if (ALLOC_TSO_ctr != 0)
377 fprintf(tickyfile,"\t\t%5.1f %5.1f %5.1f %5.1f %5.1f", ALLOC_HISTO_MAGIC(TSO));
379 fprintf(tickyfile,"\n%7ld (%5.1f%%) thread state objects",
381 PC(INTAVG(ALLOC_FMBQ_ctr, tot_allocs)));
382 if (ALLOC_FMBQ_ctr != 0)
383 fprintf(tickyfile,"\t\t%5.1f %5.1f %5.1f %5.1f %5.1f", ALLOC_HISTO_MAGIC(FMBQ));
384 fprintf(tickyfile,"\n%7ld (%5.1f%%) thread state objects",
386 PC(INTAVG(ALLOC_FME_ctr, tot_allocs)));
387 if (ALLOC_FME_ctr != 0)
388 fprintf(tickyfile,"\t\t%5.1f %5.1f %5.1f %5.1f %5.1f", ALLOC_HISTO_MAGIC(FME));
389 fprintf(tickyfile,"\n%7ld (%5.1f%%) thread state objects",
391 PC(INTAVG(ALLOC_BF_ctr, tot_allocs)));
392 if (ALLOC_BF_ctr != 0)
393 fprintf(tickyfile,"\t\t%5.1f %5.1f %5.1f %5.1f %5.1f", ALLOC_HISTO_MAGIC(BF));
396 fprintf(tickyfile,"\n");
398 fprintf(tickyfile,"\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);
400 fprintf(tickyfile,"\nSTACK USAGE:\n"); /* NB: some bits are direction sensitive */
401 fprintf(tickyfile,"\tA stack slots stubbed: %ld\n", A_STK_STUB_ctr);
403 fprintf(tickyfile,"\tA stack slots re-used: %ld\n", A_STK_REUSE_ctr);
404 fprintf(tickyfile,"\tB stack slots re-used: %ld\n", B_STK_REUSE_ctr);
407 fprintf(tickyfile,"\tA stack max. depth: %ld words\n",
408 (I_) (stackInfo.botA - max_SpA));
409 fprintf(tickyfile,"\tB stack max. depth: %ld words\n",
410 (I_) (max_SpB - stackInfo.botB)); /* And cheating, too (ToDo) */
413 fprintf(tickyfile,"\nENTERS: %ld of which %ld (%.1f%%) direct to the entry code\n\t\t [the rest indirected via Node's info ptr]\n",
416 PC(INTAVG(jump_direct_enters,tot_enters)));
417 fprintf(tickyfile,"%7ld (%5.1f%%) thunks\n",
419 PC(INTAVG(ENT_THK_ctr,tot_enters)));
420 fprintf(tickyfile,"%7ld (%5.1f%%) data values\n",
422 PC(INTAVG(ENT_CON_ctr,tot_enters)));
423 fprintf(tickyfile,"%7ld (%5.1f%%) function values\n\t\t [of which %ld (%.1f%%) bypassed arg-satisfaction chk]\n",
425 PC(INTAVG(ENT_FUN_DIRECT_ctr,tot_enters)),
427 PC(INTAVG(bypass_enters,ENT_FUN_DIRECT_ctr)));
428 fprintf(tickyfile,"%7ld (%5.1f%%) partial applications\n",
430 PC(INTAVG(ENT_PAP_ctr,tot_enters)));
431 fprintf(tickyfile,"%7ld (%5.1f%%) indirections\n",
433 PC(INTAVG(ENT_IND_ctr,tot_enters)));
435 fprintf(tickyfile,"\nRETURNS: %ld\n", tot_returns);
436 fprintf(tickyfile,"%7ld (%5.1f%%) in registers [the rest in the heap]\n",
438 PC(INTAVG(tot_returns_in_regs,tot_returns)));
439 fprintf(tickyfile,"%7ld (%5.1f%%) from entering a new constructor\n\t\t [the rest from entering an existing constructor]\n",
441 PC(INTAVG(tot_returns_of_new,tot_returns)));
442 fprintf(tickyfile,"%7ld (%5.1f%%) vectored [the rest unvectored]\n",
444 PC(INTAVG(VEC_RETURN_ctr,tot_returns)));
446 fprintf(tickyfile,"\nUPDATE FRAMES: %ld (%ld omitted from thunks)\n",
449 fprintf(tickyfile,"%7ld (%5.1f%%) standard frames\n",
451 PC(INTAVG(UPDF_STD_PUSHED_ctr,tot_upd_frames)));
452 fprintf(tickyfile,"%7ld (%5.1f%%) constructor frames\n",
454 PC(INTAVG(UPDF_CON_PUSHED_ctr,tot_upd_frames)));
455 fprintf(tickyfile,"\t\t [of which %ld (%.1f%%) were for black-holes]\n",
456 UPDF_HOLE_PUSHED_ctr,
457 PC(INTAVG(UPDF_HOLE_PUSHED_ctr,UPDF_CON_PUSHED_ctr))); /*DBH*/
459 if (UPDF_RCC_PUSHED_ctr != 0)
460 fprintf(tickyfile,"%7ld restore cost centre frames (%ld omitted)\n",
462 UPDF_RCC_OMITTED_ctr);
464 fprintf(tickyfile,"\nUPDATES: %ld\n", tot_updates);
465 fprintf(tickyfile,"%7ld (%5.1f%%) data values\n\t\t [%ld in place, %ld allocated new space, %ld with Node]\n",
467 PC(INTAVG(con_updates,tot_updates)),
468 UPD_CON_IN_PLACE_ctr, UPD_CON_IN_NEW_ctr, UPD_CON_W_NODE_ctr);
469 fprintf(tickyfile,"%7ld (%5.1f%%) partial applications\n\t\t [%ld in place, %ld allocated new space]\n",
471 PC(INTAVG(pap_updates,tot_updates)),
472 UPD_PAP_IN_PLACE_ctr, UPD_PAP_IN_NEW_ctr);
473 fprintf(tickyfile,"%7ld (%5.1f%%) updates to existing heap objects\n",
475 PC(INTAVG(UPD_EXISTING_ctr,tot_updates)));
476 fprintf(tickyfile,"%7ld (%5.1f%%) in-place updates copied\n",
477 UPD_IN_PLACE_COPY_ctr,
478 PC(INTAVG(UPD_IN_PLACE_COPY_ctr,tot_in_place_updates)));
479 if (UPD_ENTERED_ctr != 0) {
480 fprintf(tickyfile,"%7ld (%5.1f%%) subsequently entered\n",
482 PC(INTAVG(UPD_ENTERED_ctr,tot_updates)));
483 fprintf(tickyfile,"%7ld (%5.1f%%) subsequently entered more than once\n",
484 UPD_ENTERED_AGAIN_ctr,
485 PC(INTAVG(UPD_ENTERED_AGAIN_ctr,tot_updates)));
488 if (tot_gengc_updates != 0) {
489 fprintf(tickyfile,"\nNEW GEN UPDATES: %ld (%5.1f%%)\n",
491 PC(INTAVG(tot_new_updates,tot_gengc_updates)));
492 fprintf(tickyfile,"%7ld (%5.1f%%) indirections\n",
494 PC(INTAVG(UPD_NEW_IND_ctr,tot_gengc_updates)));
495 fprintf(tickyfile,"%7ld (%5.1f%%) inplace with ptrs\n",
496 UPD_NEW_IN_PLACE_PTRS_ctr,
497 PC(INTAVG(UPD_NEW_IN_PLACE_PTRS_ctr,tot_gengc_updates)));
498 fprintf(tickyfile,"%7ld (%5.1f%%) inplace without ptrs\n",
499 UPD_NEW_IN_PLACE_NOPTRS_ctr,
500 PC(INTAVG(UPD_NEW_IN_PLACE_NOPTRS_ctr,tot_gengc_updates)));
501 fprintf(tickyfile,"\nOLD GEN UPDATES: %ld (%5.1f%%)\n",
503 PC(INTAVG(tot_old_updates,tot_gengc_updates)));
504 fprintf(tickyfile,"%7ld (%5.1f%%) indirections\n",
506 PC(INTAVG(UPD_OLD_IND_ctr,tot_gengc_updates)));
507 fprintf(tickyfile,"%7ld (%5.1f%%) inplace with ptrs\n",
508 UPD_OLD_IN_PLACE_PTRS_ctr,
509 PC(INTAVG(UPD_OLD_IN_PLACE_PTRS_ctr,tot_gengc_updates)));
510 fprintf(tickyfile,"%7ld (%5.1f%%) inplace without ptrs\n",
511 UPD_OLD_IN_PLACE_NOPTRS_ctr,
512 PC(INTAVG(UPD_OLD_IN_PLACE_NOPTRS_ctr,tot_gengc_updates)));
515 printRegisteredCounterInfo();
517 fprintf(tickyfile,"\n**************************************************\n");
518 fprintf(tickyfile,"%6ld ALLOC_HEAP_ctr\n", ALLOC_HEAP_ctr);
519 fprintf(tickyfile,"%6ld ALLOC_HEAP_tot\n", ALLOC_HEAP_tot);
522 fprintf(tickyfile,"%6ld HWM_SpA\n", (I_) (stackInfo.botA - max_SpA));
523 fprintf(tickyfile,"%6ld HWM_SpB\n", (I_) (max_SpB - stackInfo.botB));
526 fprintf(tickyfile,"%6ld ALLOC_FUN_ctr\n", ALLOC_FUN_ctr);
527 fprintf(tickyfile,"%6ld ALLOC_FUN_adm\n", ALLOC_FUN_adm);
528 fprintf(tickyfile,"%6ld ALLOC_FUN_gds\n", ALLOC_FUN_gds);
529 fprintf(tickyfile,"%6ld ALLOC_FUN_slp\n", ALLOC_FUN_slp);
530 fprintf(tickyfile,"%6ld ALLOC_THK_ctr\n", ALLOC_THK_ctr);
531 fprintf(tickyfile,"%6ld ALLOC_THK_adm\n", ALLOC_THK_adm);
532 fprintf(tickyfile,"%6ld ALLOC_THK_gds\n", ALLOC_THK_gds);
533 fprintf(tickyfile,"%6ld ALLOC_THK_slp\n", ALLOC_THK_slp);
534 fprintf(tickyfile,"%6ld ALLOC_CON_ctr\n", ALLOC_CON_ctr);
535 fprintf(tickyfile,"%6ld ALLOC_CON_adm\n", ALLOC_CON_adm);
536 fprintf(tickyfile,"%6ld ALLOC_CON_gds\n", ALLOC_CON_gds);
537 fprintf(tickyfile,"%6ld ALLOC_CON_slp\n", ALLOC_CON_slp);
538 fprintf(tickyfile,"%6ld ALLOC_TUP_ctr\n", ALLOC_TUP_ctr);
539 fprintf(tickyfile,"%6ld ALLOC_TUP_adm\n", ALLOC_TUP_adm);
540 fprintf(tickyfile,"%6ld ALLOC_TUP_gds\n", ALLOC_TUP_gds);
541 fprintf(tickyfile,"%6ld ALLOC_TUP_slp\n", ALLOC_TUP_slp);
542 fprintf(tickyfile,"%6ld ALLOC_BH_ctr\n", ALLOC_BH_ctr);
543 fprintf(tickyfile,"%6ld ALLOC_BH_adm\n", ALLOC_BH_adm);
544 fprintf(tickyfile,"%6ld ALLOC_BH_gds\n", ALLOC_BH_gds);
545 fprintf(tickyfile,"%6ld ALLOC_BH_slp\n", ALLOC_BH_slp);
547 fprintf(tickyfile,"%6ld ALLOC_PAP_ctr\n", ALLOC_PAP_ctr);
548 fprintf(tickyfile,"%6ld ALLOC_PAP_adm\n", ALLOC_PAP_adm);
549 fprintf(tickyfile,"%6ld ALLOC_PAP_gds\n", ALLOC_PAP_gds);
550 fprintf(tickyfile,"%6ld ALLOC_PAP_slp\n", ALLOC_PAP_slp);
552 fprintf(tickyfile,"%6ld ALLOC_PRIM_ctr\n", ALLOC_PRIM_ctr);
553 fprintf(tickyfile,"%6ld ALLOC_PRIM_adm\n", ALLOC_PRIM_adm);
554 fprintf(tickyfile,"%6ld ALLOC_PRIM_gds\n", ALLOC_PRIM_gds);
555 fprintf(tickyfile,"%6ld ALLOC_PRIM_slp\n", ALLOC_PRIM_slp);
557 fprintf(tickyfile,"%6ld ALLOC_UPD_CON_ctr\n", ALLOC_UPD_CON_ctr);
558 fprintf(tickyfile,"%6ld ALLOC_UPD_CON_adm\n", ALLOC_UPD_CON_adm);
559 fprintf(tickyfile,"%6ld ALLOC_UPD_CON_gds\n", ALLOC_UPD_CON_gds);
560 fprintf(tickyfile,"%6ld ALLOC_UPD_CON_slp\n", ALLOC_UPD_CON_slp);
562 fprintf(tickyfile,"%6ld ALLOC_UPD_PAP_ctr\n", ALLOC_UPD_PAP_ctr);
563 fprintf(tickyfile,"%6ld ALLOC_UPD_PAP_adm\n", ALLOC_UPD_PAP_adm);
564 fprintf(tickyfile,"%6ld ALLOC_UPD_PAP_gds\n", ALLOC_UPD_PAP_gds);
565 fprintf(tickyfile,"%6ld ALLOC_UPD_PAP_slp\n", ALLOC_UPD_PAP_slp);
568 fprintf(tickyfile,"%6ld ALLOC_STK_ctr\n", ALLOC_STK_ctr);
569 fprintf(tickyfile,"%6ld ALLOC_STK_adm\n", ALLOC_STK_adm);
570 fprintf(tickyfile,"%6ld ALLOC_STK_gds\n", ALLOC_STK_gds);
571 fprintf(tickyfile,"%6ld ALLOC_STK_slp\n", ALLOC_STK_slp);
572 fprintf(tickyfile,"%6ld ALLOC_TSO_ctr\n", ALLOC_TSO_ctr);
573 fprintf(tickyfile,"%6ld ALLOC_TSO_adm\n", ALLOC_TSO_adm);
574 fprintf(tickyfile,"%6ld ALLOC_TSO_gds\n", ALLOC_TSO_gds);
575 fprintf(tickyfile,"%6ld ALLOC_TSO_slp\n", ALLOC_TSO_slp);
577 fprintf(tickyfile,"%6ld ALLOC_FMBQ_ctr\n", ALLOC_FMBQ_ctr);
578 fprintf(tickyfile,"%6ld ALLOC_FMBQ_adm\n", ALLOC_FMBQ_adm);
579 fprintf(tickyfile,"%6ld ALLOC_FMBQ_gds\n", ALLOC_FMBQ_gds);
580 fprintf(tickyfile,"%6ld ALLOC_FMBQ_slp\n", ALLOC_FMBQ_slp);
581 fprintf(tickyfile,"%6ld ALLOC_FME_ctr\n", ALLOC_FME_ctr);
582 fprintf(tickyfile,"%6ld ALLOC_FME_adm\n", ALLOC_FME_adm);
583 fprintf(tickyfile,"%6ld ALLOC_FME_gds\n", ALLOC_FME_gds);
584 fprintf(tickyfile,"%6ld ALLOC_FME_slp\n", ALLOC_FME_slp);
585 fprintf(tickyfile,"%6ld ALLOC_BF_ctr\n", ALLOC_BF_ctr);
586 fprintf(tickyfile,"%6ld ALLOC_BF_adm\n", ALLOC_BF_adm);
587 fprintf(tickyfile,"%6ld ALLOC_BF_gds\n", ALLOC_BF_gds);
588 fprintf(tickyfile,"%6ld ALLOC_BF_slp\n", ALLOC_BF_slp);
592 fprintf(tickyfile,"%6ld ENT_VIA_NODE_ctr\n", ENT_VIA_NODE_ctr);
593 fprintf(tickyfile,"%6ld ENT_CON_ctr\n", ENT_CON_ctr);
594 fprintf(tickyfile,"%6ld ENT_FUN_STD_ctr\n", ENT_FUN_STD_ctr);
595 fprintf(tickyfile,"%6ld ENT_FUN_DIRECT_ctr\n", ENT_FUN_DIRECT_ctr);
596 fprintf(tickyfile,"%6ld ENT_IND_ctr\n", ENT_IND_ctr);
597 fprintf(tickyfile,"%6ld ENT_PAP_ctr\n", ENT_PAP_ctr);
598 fprintf(tickyfile,"%6ld ENT_THK_ctr\n", ENT_THK_ctr);
600 fprintf(tickyfile,"%6ld RET_NEW_IN_HEAP_ctr\n", RET_NEW_IN_HEAP_ctr);
601 fprintf(tickyfile,"%6ld RET_NEW_IN_REGS_ctr\n", RET_NEW_IN_REGS_ctr);
602 fprintf(tickyfile,"%6ld RET_OLD_IN_HEAP_ctr\n", RET_OLD_IN_HEAP_ctr);
603 fprintf(tickyfile,"%6ld RET_OLD_IN_REGS_ctr\n", RET_OLD_IN_REGS_ctr);
604 fprintf(tickyfile,"%6ld RET_SEMI_BY_DEFAULT_ctr\n", RET_SEMI_BY_DEFAULT_ctr);
605 fprintf(tickyfile,"%6ld RET_SEMI_IN_HEAP_ctr\n", RET_SEMI_IN_HEAP_ctr);
606 fprintf(tickyfile,"%6ld RET_SEMI_IN_REGS_ctr\n", RET_SEMI_IN_REGS_ctr);
607 fprintf(tickyfile,"%6ld VEC_RETURN_ctr\n", VEC_RETURN_ctr);
609 fprintf(tickyfile,"%6ld UPDF_OMITTED_ctr\n", UPDF_OMITTED_ctr);
610 fprintf(tickyfile,"%6ld UPDF_STD_PUSHED_ctr\n", UPDF_STD_PUSHED_ctr);
611 fprintf(tickyfile,"%6ld UPDF_CON_PUSHED_ctr\n", UPDF_CON_PUSHED_ctr);
612 fprintf(tickyfile,"%6ld UPDF_HOLE_PUSHED_ctr\n", UPDF_HOLE_PUSHED_ctr);
614 fprintf(tickyfile,"%6ld UPDF_RCC_PUSHED_ctr\n", UPDF_RCC_PUSHED_ctr);
615 fprintf(tickyfile,"%6ld UPDF_RCC_OMITTED_ctr\n", UPDF_RCC_OMITTED_ctr);
617 fprintf(tickyfile,"%6ld UPD_EXISTING_ctr\n", UPD_EXISTING_ctr);
618 fprintf(tickyfile,"%6ld UPD_CON_W_NODE_ctr\n", UPD_CON_W_NODE_ctr);
619 fprintf(tickyfile,"%6ld UPD_CON_IN_PLACE_ctr\n", UPD_CON_IN_PLACE_ctr);
620 fprintf(tickyfile,"%6ld UPD_CON_IN_NEW_ctr\n", UPD_CON_IN_NEW_ctr);
621 fprintf(tickyfile,"%6ld UPD_PAP_IN_PLACE_ctr\n", UPD_PAP_IN_PLACE_ctr);
622 fprintf(tickyfile,"%6ld UPD_PAP_IN_NEW_ctr\n", UPD_PAP_IN_NEW_ctr);
623 fprintf(tickyfile,"%6ld UPD_ENTERED_ctr\n", UPD_ENTERED_ctr);
624 fprintf(tickyfile,"%6ld UPD_ENTERED_AGAIN_ctr\n",UPD_ENTERED_AGAIN_ctr);
626 fprintf(tickyfile,"%6ld UPD_NEW_IND_ctr\n", UPD_NEW_IND_ctr);
627 fprintf(tickyfile,"%6ld UPD_NEW_IN_PLACE_PTRS_ctr\n", UPD_NEW_IN_PLACE_PTRS_ctr);
628 fprintf(tickyfile,"%6ld UPD_NEW_IN_PLACE_NOPTRS_ctr\n", UPD_NEW_IN_PLACE_NOPTRS_ctr);
629 fprintf(tickyfile,"%6ld UPD_OLD_IND_ctr\n", UPD_OLD_IND_ctr);
630 fprintf(tickyfile,"%6ld UPD_OLD_IN_PLACE_PTRS_ctr\n", UPD_OLD_IN_PLACE_PTRS_ctr);
631 fprintf(tickyfile,"%6ld UPD_OLD_IN_PLACE_NOPTRS_ctr\n", UPD_OLD_IN_PLACE_NOPTRS_ctr);
635 %************************************************************************
637 \subsection[RednCounts-ent-counters]{Handle named entry counters}
639 %************************************************************************
641 Data structure used in ``registering'' one of these counters.
643 struct ent_counter *ListOfEntryCtrs = NULL; /* root of list of them */
646 To print out all the registered-counter info:
649 printRegisteredCounterInfo ( STG_NO_ARGS )
651 struct ent_counter *p;
653 if ( ListOfEntryCtrs != NULL ) {
654 fprintf(tickyfile,"\n**************************************************\n");
657 for (p = ListOfEntryCtrs; p != NULL; p = p->link) {
658 /* common stuff first; then the wrapper info if avail */
659 fprintf(tickyfile, "%-40s%u\t%u\t%u\t%-16s%ld",
667 if ( p->wrap_str == NULL ) {
668 fprintf(tickyfile, "\n");
671 fprintf(tickyfile, "\t%s\t%s\n",
681 #endif /* DO_REDN_COUNTING */