1 /* -----------------------------------------------------------------------------
3 * (c) The AQUA project, Glasgow University, 1992-1997
4 * (c) The GHC Team, 1998-1999
6 * Ticky-ticky profiling
7 *-------------------------------------------------------------------------- */
9 #if defined(TICKY_TICKY)
11 #define TICKY_C /* define those variables */
12 #include "PosixSource.h"
14 #include "TickyCounters.h"
18 /* -----------------------------------------------------------------------------
19 Print out all the counters
20 -------------------------------------------------------------------------- */
22 static void printRegisteredCounterInfo (FILE *); /* fwd decl */
24 #define INTAVG(a,b) ((b == 0) ? 0.0 : ((double) (a) / (double) (b)))
25 #define PC(a) (100.0 * a)
28 StgDouble avg##thing = INTAVG(tot##thing,ctr##thing)
35 unsigned long tot_allocs = /* total number of things allocated */
36 ALLOC_FUN_ctr + ALLOC_SE_THK_ctr + ALLOC_UP_THK_ctr + ALLOC_CON_ctr + ALLOC_TUP_ctr +
37 + ALLOC_TSO_ctr + ALLOC_BH_ctr + ALLOC_PAP_ctr + ALLOC_PRIM_ctr
39 + ALLOC_FMBQ_ctr + ALLOC_FME_ctr + ALLOC_BF_ctr
43 unsigned long tot_adm_wds = /* total number of admin words allocated */
44 ALLOC_FUN_adm + ALLOC_THK_adm + ALLOC_CON_adm + ALLOC_TUP_adm
45 + ALLOC_TSO_adm + ALLOC_BH_adm + ALLOC_PAP_adm + ALLOC_PRIM_adm
47 + ALLOC_FMBQ_adm + ALLOC_FME_adm + ALLOC_BF_adm
51 unsigned long tot_gds_wds = /* total number of words of ``good stuff'' allocated */
52 ALLOC_FUN_gds + ALLOC_THK_gds + ALLOC_CON_gds + ALLOC_TUP_gds
53 + ALLOC_TSO_gds + ALLOC_BH_gds + ALLOC_PAP_gds + ALLOC_PRIM_gds
55 + ALLOC_FMBQ_gds + ALLOC_FME_gds + ALLOC_BF_gds
59 unsigned long tot_slp_wds = /* total number of ``slop'' words allocated */
60 ALLOC_FUN_slp + ALLOC_THK_slp + ALLOC_CON_slp + ALLOC_TUP_slp
61 + ALLOC_TSO_slp + ALLOC_BH_slp + ALLOC_PAP_slp + ALLOC_PRIM_slp
63 + ALLOC_FMBQ_slp + ALLOC_FME_slp + ALLOC_BF_slp
67 unsigned long tot_wds = /* total words */
68 tot_adm_wds + tot_gds_wds + tot_slp_wds;
70 unsigned long tot_thk_enters = ENT_STATIC_THK_ctr + ENT_DYN_THK_ctr;
71 unsigned long tot_con_enters = ENT_STATIC_CON_ctr + ENT_DYN_CON_ctr;
73 unsigned long tot_fun_direct_enters = ENT_STATIC_FUN_DIRECT_ctr + ENT_DYN_FUN_DIRECT_ctr;
74 unsigned long tot_ind_enters = ENT_STATIC_IND_ctr + ENT_DYN_IND_ctr;
76 // This is the number of times we entered a function via some kind
77 // of slow call. It amounts to all the slow applications, not
78 // counting those that were to too few arguments.
79 unsigned long tot_fun_slow_enters =
81 SLOW_CALL_FUN_TOO_FEW_ctr -
82 SLOW_CALL_PAP_TOO_FEW_ctr;
84 unsigned long tot_known_calls =
85 KNOWN_CALL_ctr + KNOWN_CALL_TOO_FEW_ARGS_ctr +
86 + KNOWN_CALL_EXTRA_ARGS_ctr;
87 unsigned long tot_tail_calls =
88 UNKNOWN_CALL_ctr + tot_known_calls;
90 unsigned long tot_enters =
91 tot_con_enters + tot_fun_direct_enters +
92 tot_ind_enters + ENT_PERM_IND_ctr + ENT_PAP_ctr + tot_thk_enters;
93 unsigned long jump_direct_enters =
94 tot_enters - ENT_VIA_NODE_ctr;
97 unsigned long tot_returns =
98 RET_NEW_ctr + RET_OLD_ctr + RET_UNBOXED_TUP_ctr;
100 unsigned long tot_returns_of_new = RET_NEW_ctr;
102 unsigned long con_updates = UPD_CON_IN_NEW_ctr + UPD_CON_IN_PLACE_ctr;
103 unsigned long pap_updates = UPD_PAP_IN_NEW_ctr + UPD_PAP_IN_PLACE_ctr;
105 unsigned long tot_updates = UPD_SQUEEZED_ctr + pap_updates + con_updates;
107 unsigned long tot_new_updates = UPD_NEW_IND_ctr + UPD_NEW_PERM_IND_ctr;
108 unsigned long tot_old_updates = UPD_OLD_IND_ctr + UPD_OLD_PERM_IND_ctr;
109 unsigned long tot_gengc_updates = tot_new_updates + tot_old_updates;
111 FILE *tf = RtsFlags.TickyFlags.tickyFile;
113 /* krc: avoid dealing with this just now */
115 fprintf(tf,"\n\nALLOCATIONS: %ld (%ld words total: %ld admin, %ld goods, %ld slop)\n",
116 tot_allocs, tot_wds, tot_adm_wds, tot_gds_wds, tot_slp_wds);
117 fprintf(tf,"\t\t\t\ttotal words:\t 2 3 4 5 6+\n");
119 #define ALLOC_HISTO_MAGIC(categ) \
120 (PC(INTAVG(ALLOC_##categ##_hst[0], ALLOC_##categ##_ctr))), \
121 (PC(INTAVG(ALLOC_##categ##_hst[1], ALLOC_##categ##_ctr))), \
122 (PC(INTAVG(ALLOC_##categ##_hst[2], ALLOC_##categ##_ctr))), \
123 (PC(INTAVG(ALLOC_##categ##_hst[3], ALLOC_##categ##_ctr))), \
124 (PC(INTAVG(ALLOC_##categ##_hst[4], ALLOC_##categ##_ctr)))
126 fprintf(tf,"%7ld (%5.1f%%) function values",
128 PC(INTAVG(ALLOC_FUN_ctr, tot_allocs)));
129 if (ALLOC_FUN_ctr != 0)
130 fprintf(tf,"\t\t%5.1f %5.1f %5.1f %5.1f %5.1f", ALLOC_HISTO_MAGIC(FUN));
133 fprintf(tf,"\n%7ld (%5.1f%%) thunks",
134 ALLOC_SE_THK_ctr + ALLOC_UP_THK_ctr,
135 PC(INTAVG(ALLOC_SE_THK_ctr + ALLOC_UP_THK_ctr, tot_allocs)));
137 #define ALLOC_THK_ctr (ALLOC_UP_THK_ctr + ALLOC_SE_THK_ctr)
138 /* hack to make ALLOC_HISTO_MAGIC still work for THK */
139 if ((ALLOC_SE_THK_ctr + ALLOC_UP_THK_ctr) != 0)
140 fprintf(tf,"\t\t\t\t%5.1f %5.1f %5.1f %5.1f %5.1f", ALLOC_HISTO_MAGIC(THK));
143 fprintf(tf,"\n%7ld (%5.1f%%) data values",
145 PC(INTAVG(ALLOC_CON_ctr, tot_allocs)));
146 if (ALLOC_CON_ctr != 0)
147 fprintf(tf,"\t\t\t%5.1f %5.1f %5.1f %5.1f %5.1f", ALLOC_HISTO_MAGIC(CON));
149 fprintf(tf,"\n%7ld (%5.1f%%) big tuples",
151 PC(INTAVG(ALLOC_TUP_ctr, tot_allocs)));
152 if (ALLOC_TUP_ctr != 0)
153 fprintf(tf,"\t\t\t%5.1f %5.1f %5.1f %5.1f %5.1f", ALLOC_HISTO_MAGIC(TUP));
155 fprintf(tf,"\n%7ld (%5.1f%%) black holes",
157 PC(INTAVG(ALLOC_BH_ctr, tot_allocs)));
158 if (ALLOC_BH_ctr != 0)
159 fprintf(tf,"\t\t\t%5.1f %5.1f %5.1f %5.1f %5.1f", ALLOC_HISTO_MAGIC(BH));
161 fprintf(tf,"\n%7ld (%5.1f%%) prim things",
163 PC(INTAVG(ALLOC_PRIM_ctr, tot_allocs)));
164 if (ALLOC_PRIM_ctr != 0)
165 fprintf(tf,"\t\t\t%5.1f %5.1f %5.1f %5.1f %5.1f", ALLOC_HISTO_MAGIC(PRIM));
167 fprintf(tf,"\n%7ld (%5.1f%%) partial applications",
169 PC(INTAVG(ALLOC_PAP_ctr, tot_allocs)));
170 if (ALLOC_PAP_ctr != 0)
171 fprintf(tf,"\t\t%5.1f %5.1f %5.1f %5.1f %5.1f", ALLOC_HISTO_MAGIC(PAP));
173 fprintf(tf,"\n%7ld (%5.1f%%) thread state objects",
175 PC(INTAVG(ALLOC_TSO_ctr, tot_allocs)));
176 if (ALLOC_TSO_ctr != 0)
177 fprintf(tf,"\t\t%5.1f %5.1f %5.1f %5.1f %5.1f", ALLOC_HISTO_MAGIC(TSO));
179 fprintf(tf,"\n%7ld (%5.1f%%) thread state objects",
181 PC(INTAVG(ALLOC_FMBQ_ctr, tot_allocs)));
182 if (ALLOC_FMBQ_ctr != 0)
183 fprintf(tf,"\t\t%5.1f %5.1f %5.1f %5.1f %5.1f", ALLOC_HISTO_MAGIC(FMBQ));
184 fprintf(tf,"\n%7ld (%5.1f%%) thread state objects",
186 PC(INTAVG(ALLOC_FME_ctr, tot_allocs)));
187 if (ALLOC_FME_ctr != 0)
188 fprintf(tf,"\t\t%5.1f %5.1f %5.1f %5.1f %5.1f", ALLOC_HISTO_MAGIC(FME));
189 fprintf(tf,"\n%7ld (%5.1f%%) thread state objects",
191 PC(INTAVG(ALLOC_BF_ctr, tot_allocs)));
192 if (ALLOC_BF_ctr != 0)
193 fprintf(tf,"\t\t%5.1f %5.1f %5.1f %5.1f %5.1f", ALLOC_HISTO_MAGIC(BF));
198 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);
202 fprintf(tf,"\nSTACK USAGE:\n"); /* NB: some bits are direction sensitive */
205 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",
208 PC(INTAVG(jump_direct_enters,tot_enters)));
209 fprintf(tf,"%7ld (%5.1f%%) thunks\n",
211 PC(INTAVG(tot_thk_enters,tot_enters)));
212 fprintf(tf,"%7ld (%5.1f%%) data values\n",
214 PC(INTAVG(tot_con_enters,tot_enters)));
215 fprintf(tf,"%7ld (%5.1f%%) normal indirections\n",
217 PC(INTAVG(tot_ind_enters,tot_enters)));
218 fprintf(tf,"%7ld (%5.1f%%) permanent indirections\n",
220 PC(INTAVG(ENT_PERM_IND_ctr,tot_enters)));
223 fprintf(tf,"\nFUNCTION ENTRIES: %ld\n", tot_fun_direct_enters);
225 fprintf(tf, "\nTAIL CALLS: %ld, of which %ld (%.lf%%) were to known functions\n",
226 tot_tail_calls, tot_known_calls,
227 PC(INTAVG(tot_known_calls,tot_tail_calls)));
229 fprintf(tf, "\nSLOW APPLICATIONS: %ld evaluated, %ld unevaluated\n",
230 SLOW_CALL_ctr, SLOW_CALL_UNEVALD_ctr);
232 fprintf(tf, " Too few args Correct args Too many args\n");
233 fprintf(tf, " FUN %8ld %8ld %8ld\n",
234 SLOW_CALL_FUN_TOO_FEW_ctr, SLOW_CALL_FUN_CORRECT_ctr, SLOW_CALL_FUN_TOO_MANY_ctr);
235 fprintf(tf, " PAP %8ld %8ld %8ld\n",
236 SLOW_CALL_PAP_TOO_FEW_ctr, SLOW_CALL_PAP_CORRECT_ctr, SLOW_CALL_PAP_TOO_MANY_ctr);
239 fprintf(tf,"\nRETURNS: %ld\n", tot_returns);
240 fprintf(tf,"%7ld (%5.1f%%) from entering a new constructor\n\t\t [the rest from entering an existing constructor]\n",
242 PC(INTAVG(tot_returns_of_new,tot_returns)));
244 /* krc: comment out some of this stuff temporarily */
247 fprintf(tf, "\nRET_NEW: %7ld: ", RET_NEW_ctr);
248 for (i = 0; i < 9; i++) { fprintf(tf, "%5.1f%%",
249 PC(INTAVG(RET_NEW_hst[i],RET_NEW_ctr))); }
251 fprintf(tf, "RET_OLD: %7ld: ", RET_OLD_ctr);
252 for (i = 0; i < 9; i++) { fprintf(tf, "%5.1f%%",
253 PC(INTAVG(RET_OLD_hst[i],RET_OLD_ctr))); }
255 fprintf(tf, "RET_UNBOXED_TUP: %7ld: ", RET_UNBOXED_TUP_ctr);
256 for (i = 0; i < 9; i++) { fprintf(tf, "%5.1f%%",
257 PC(INTAVG(RET_UNBOXED_TUP_hst[i],
258 RET_UNBOXED_TUP_ctr))); }
262 fprintf(tf,"\nUPDATE FRAMES: %ld (%ld omitted from thunks)",
266 fprintf(tf,"\nCATCH FRAMES: %ld", CATCHF_PUSHED_ctr);
268 if (UPDF_RCC_PUSHED_ctr != 0)
269 fprintf(tf,"%7ld restore cost centre frames (%ld omitted)\n",
271 UPDF_RCC_OMITTED_ctr);
273 fprintf(tf,"\nUPDATES: %ld\n", tot_updates);
274 fprintf(tf,"%7ld (%5.1f%%) data values\n\t\t [%ld in place, %ld allocated new space]\n",
276 PC(INTAVG(con_updates,tot_updates)),
277 UPD_CON_IN_PLACE_ctr, UPD_CON_IN_NEW_ctr);
278 fprintf(tf,"%7ld (%5.1f%%) partial applications\n\t\t [%ld in place, %ld allocated new space]\n",
280 PC(INTAVG(pap_updates,tot_updates)),
281 UPD_PAP_IN_PLACE_ctr, UPD_PAP_IN_NEW_ctr);
282 fprintf(tf,"%7ld (%5.1f%%) updates by squeezing\n",
284 PC(INTAVG(UPD_SQUEEZED_ctr, tot_updates)));
286 /* krc: also avoid dealing with this for now */
288 fprintf(tf, "\nUPD_CON_IN_NEW: %7ld: ", UPD_CON_IN_NEW_ctr);
289 for (i = 0; i < 9; i++) { fprintf(tf, "%7ld", UPD_CON_IN_NEW_hst[i]); }
291 fprintf(tf, "UPD_CON_IN_PLACE: %7ld: ", UPD_CON_IN_PLACE_ctr);
292 for (i = 0; i < 9; i++) { fprintf(tf, "%7ld", UPD_CON_IN_PLACE_hst[i]); }
294 fprintf(tf, "UPD_PAP_IN_NEW: %7ld: ", UPD_PAP_IN_NEW_ctr);
295 for (i = 0; i < 9; i++) { fprintf(tf, "%7ld", UPD_PAP_IN_NEW_hst[i]); }
299 if (tot_gengc_updates != 0) {
300 fprintf(tf,"\nNEW GEN UPDATES: %9ld (%5.1f%%)\n",
302 PC(INTAVG(tot_new_updates,tot_gengc_updates)));
303 fprintf(tf,"OLD GEN UPDATES: %9ld (%5.1f%%)\n",
305 PC(INTAVG(tot_old_updates,tot_gengc_updates)));
308 fprintf(tf,"\nTotal bytes copied during GC: %ld\n",
309 GC_WORDS_COPIED_ctr * sizeof(W_));
311 printRegisteredCounterInfo(tf);
313 fprintf(tf,"\n**************************************************\n");
315 /* here, we print out all the raw numbers; these are really
316 more useful when we want to snag them for subsequent
317 rdb-etc processing. WDP 95/11
320 #define PR_CTR(ctr) \
321 do { fprintf(tf,"%7ld " #ctr "\n", ctr); } while(0)
322 /* COND_PR_CTR takes a boolean; if false then msg is the printname rather than ctr */
323 #define COND_PR_CTR(ctr,b,msg) \
324 if (b) { fprintf(tf,"%7ld " #ctr "\n", ctr); } else { fprintf(tf,"%7ld " msg "\n", ctr); }
325 #define PR_HST(hst,i) \
326 do { fprintf(tf,"%7ld " #hst "_" #i "\n", hst[i]); } while(0)
328 PR_CTR(ALLOC_HEAP_ctr);
329 PR_CTR(ALLOC_HEAP_tot);
331 PR_CTR(ALLOC_FUN_ctr);
332 PR_CTR(ALLOC_FUN_adm);
333 PR_CTR(ALLOC_FUN_gds);
334 PR_CTR(ALLOC_FUN_slp);
336 /* krc: comment out some of this stuff temporarily
337 PR_HST(ALLOC_FUN_hst,0);
338 PR_HST(ALLOC_FUN_hst,1);
339 PR_HST(ALLOC_FUN_hst,2);
340 PR_HST(ALLOC_FUN_hst,3);
341 PR_HST(ALLOC_FUN_hst,4);
342 PR_CTR(ALLOC_UP_THK_ctr);
343 PR_CTR(ALLOC_SE_THK_ctr);
344 PR_CTR(ALLOC_THK_adm);
345 PR_CTR(ALLOC_THK_gds);
346 PR_CTR(ALLOC_THK_slp);
347 PR_HST(ALLOC_THK_hst,0);
348 PR_HST(ALLOC_THK_hst,1);
349 PR_HST(ALLOC_THK_hst,2);
350 PR_HST(ALLOC_THK_hst,3);
351 PR_HST(ALLOC_THK_hst,4);
352 PR_CTR(ALLOC_CON_ctr);
353 PR_CTR(ALLOC_CON_adm);
354 PR_CTR(ALLOC_CON_gds);
355 PR_CTR(ALLOC_CON_slp);
356 PR_HST(ALLOC_CON_hst,0);
357 PR_HST(ALLOC_CON_hst,1);
358 PR_HST(ALLOC_CON_hst,2);
359 PR_HST(ALLOC_CON_hst,3);
360 PR_HST(ALLOC_CON_hst,4);
361 PR_CTR(ALLOC_TUP_ctr);
362 PR_CTR(ALLOC_TUP_adm);
363 PR_CTR(ALLOC_TUP_gds);
364 PR_CTR(ALLOC_TUP_slp);
365 PR_HST(ALLOC_TUP_hst,0);
366 PR_HST(ALLOC_TUP_hst,1);
367 PR_HST(ALLOC_TUP_hst,2);
368 PR_HST(ALLOC_TUP_hst,3);
369 PR_HST(ALLOC_TUP_hst,4);
370 PR_CTR(ALLOC_BH_ctr);
371 PR_CTR(ALLOC_BH_adm);
372 PR_CTR(ALLOC_BH_gds);
373 PR_CTR(ALLOC_BH_slp);
374 PR_HST(ALLOC_BH_hst,0);
375 PR_HST(ALLOC_BH_hst,1);
376 PR_HST(ALLOC_BH_hst,2);
377 PR_HST(ALLOC_BH_hst,3);
378 PR_HST(ALLOC_BH_hst,4);
379 PR_CTR(ALLOC_PRIM_ctr);
380 PR_CTR(ALLOC_PRIM_adm);
381 PR_CTR(ALLOC_PRIM_gds);
382 PR_CTR(ALLOC_PRIM_slp);
383 PR_HST(ALLOC_PRIM_hst,0);
384 PR_HST(ALLOC_PRIM_hst,1);
385 PR_HST(ALLOC_PRIM_hst,2);
386 PR_HST(ALLOC_PRIM_hst,3);
387 PR_HST(ALLOC_PRIM_hst,4);
388 PR_CTR(ALLOC_PAP_ctr);
389 PR_CTR(ALLOC_PAP_adm);
390 PR_CTR(ALLOC_PAP_gds);
391 PR_CTR(ALLOC_PAP_slp);
392 PR_HST(ALLOC_PAP_hst,0);
393 PR_HST(ALLOC_PAP_hst,1);
394 PR_HST(ALLOC_PAP_hst,2);
395 PR_HST(ALLOC_PAP_hst,3);
396 PR_HST(ALLOC_PAP_hst,4);
398 PR_CTR(ALLOC_TSO_ctr);
399 PR_CTR(ALLOC_TSO_adm);
400 PR_CTR(ALLOC_TSO_gds);
401 PR_CTR(ALLOC_TSO_slp);
402 PR_HST(ALLOC_TSO_hst,0);
403 PR_HST(ALLOC_TSO_hst,1);
404 PR_HST(ALLOC_TSO_hst,2);
405 PR_HST(ALLOC_TSO_hst,3);
406 PR_HST(ALLOC_TSO_hst,4);
409 PR_CTR(ALLOC_FMBQ_ctr);
410 PR_CTR(ALLOC_FMBQ_adm);
411 PR_CTR(ALLOC_FMBQ_gds);
412 PR_CTR(ALLOC_FMBQ_slp);
413 PR_HST(ALLOC_FMBQ_hst,0);
414 PR_HST(ALLOC_FMBQ_hst,1);
415 PR_HST(ALLOC_FMBQ_hst,2);
416 PR_HST(ALLOC_FMBQ_hst,3);
417 PR_HST(ALLOC_FMBQ_hst,4);
418 PR_CTR(ALLOC_FME_ctr);
419 PR_CTR(ALLOC_FME_adm);
420 PR_CTR(ALLOC_FME_gds);
421 PR_CTR(ALLOC_FME_slp);
422 PR_HST(ALLOC_FME_hst,0);
423 PR_HST(ALLOC_FME_hst,1);
424 PR_HST(ALLOC_FME_hst,2);
425 PR_HST(ALLOC_FME_hst,3);
426 PR_HST(ALLOC_FME_hst,4);
427 PR_CTR(ALLOC_BF_ctr);
428 PR_CTR(ALLOC_BF_adm);
429 PR_CTR(ALLOC_BF_gds);
430 PR_CTR(ALLOC_BF_slp);
431 PR_HST(ALLOC_BF_hst,0);
432 PR_HST(ALLOC_BF_hst,1);
433 PR_HST(ALLOC_BF_hst,2);
434 PR_HST(ALLOC_BF_hst,3);
435 PR_HST(ALLOC_BF_hst,4);
439 PR_CTR(ENT_VIA_NODE_ctr);
440 PR_CTR(ENT_STATIC_CON_ctr);
441 PR_CTR(ENT_DYN_CON_ctr);
442 PR_CTR(ENT_STATIC_FUN_DIRECT_ctr);
443 PR_CTR(ENT_DYN_FUN_DIRECT_ctr);
444 PR_CTR(ENT_STATIC_IND_ctr);
445 PR_CTR(ENT_DYN_IND_ctr);
447 /* The counters ENT_PERM_IND and UPD_{NEW,OLD}_PERM_IND are not dumped
448 * at the end of execution unless update squeezing is turned off (+RTS
449 * -Z =RtsFlags.GcFlags.squeezeUpdFrames), as they will be wrong
450 * otherwise. Why? Because for each update frame squeezed out, we
451 * count an UPD_NEW_PERM_IND *at GC time* (i.e., too early). And
452 * further, when we enter the closure that has been updated, we count
453 * the ENT_PERM_IND, but we then enter the PERM_IND that was built for
454 * the next update frame below, and so on down the chain until we
455 * finally reach the value. Thus we count many new ENT_PERM_INDs too
458 * This of course refers to the -ticky version that uses PERM_INDs to
459 * determine the number of closures entered 0/1/>1. KSW 1999-04. */
460 COND_PR_CTR(ENT_PERM_IND_ctr,RtsFlags.GcFlags.squeezeUpdFrames == rtsFalse,"E!NT_PERM_IND_ctr requires +RTS -Z");
464 PR_CTR(ENT_AP_STACK_ctr);
466 PR_CTR(ENT_STATIC_THK_ctr);
467 PR_CTR(ENT_DYN_THK_ctr);
469 PR_CTR(SLOW_CALL_v_ctr);
470 PR_CTR(SLOW_CALL_f_ctr);
471 PR_CTR(SLOW_CALL_d_ctr);
472 PR_CTR(SLOW_CALL_l_ctr);
473 PR_CTR(SLOW_CALL_n_ctr);
474 PR_CTR(SLOW_CALL_p_ctr);
475 PR_CTR(SLOW_CALL_pv_ctr);
476 PR_CTR(SLOW_CALL_pp_ctr);
477 PR_CTR(SLOW_CALL_ppv_ctr);
478 PR_CTR(SLOW_CALL_ppp_ctr);
479 PR_CTR(SLOW_CALL_pppv_ctr);
480 PR_CTR(SLOW_CALL_pppp_ctr);
481 PR_CTR(SLOW_CALL_ppppp_ctr);
482 PR_CTR(SLOW_CALL_pppppp_ctr);
483 PR_CTR(SLOW_CALL_OTHER_ctr);
485 PR_CTR(UNKNOWN_CALL_ctr);
486 PR_CTR(KNOWN_CALL_ctr);
487 PR_CTR(KNOWN_CALL_TOO_FEW_ARGS_ctr);
488 PR_CTR(KNOWN_CALL_EXTRA_ARGS_ctr);
489 PR_CTR(MULTI_CHUNK_SLOW_CALL_ctr);
490 PR_CTR(MULTI_CHUNK_SLOW_CALL_CHUNKS_ctr);
491 PR_CTR(SLOW_CALL_ctr);
492 PR_CTR(SLOW_CALL_FUN_TOO_FEW_ctr);
493 PR_CTR(SLOW_CALL_FUN_CORRECT_ctr);
494 PR_CTR(SLOW_CALL_FUN_TOO_MANY_ctr);
495 PR_CTR(SLOW_CALL_PAP_TOO_FEW_ctr);
496 PR_CTR(SLOW_CALL_PAP_CORRECT_ctr);
497 PR_CTR(SLOW_CALL_PAP_TOO_MANY_ctr);
498 PR_CTR(SLOW_CALL_UNEVALD_ctr);
500 /* krc: put off till later... */
502 PR_HST(SLOW_CALL_hst,0);
503 PR_HST(SLOW_CALL_hst,1);
504 PR_HST(SLOW_CALL_hst,2);
505 PR_HST(SLOW_CALL_hst,3);
506 PR_HST(SLOW_CALL_hst,4);
507 PR_HST(SLOW_CALL_hst,5);
508 PR_HST(SLOW_CALL_hst,6);
509 PR_HST(SLOW_CALL_hst,7);
514 PR_CTR(RET_UNBOXED_TUP_ctr);
516 /* krc: put off till later... */
518 PR_HST(RET_NEW_hst,0);
519 PR_HST(RET_NEW_hst,1);
520 PR_HST(RET_NEW_hst,2);
521 PR_HST(RET_NEW_hst,3);
522 PR_HST(RET_NEW_hst,4);
523 PR_HST(RET_NEW_hst,5);
524 PR_HST(RET_NEW_hst,6);
525 PR_HST(RET_NEW_hst,7);
526 PR_HST(RET_NEW_hst,8);
527 PR_HST(RET_OLD_hst,0);
528 PR_HST(RET_OLD_hst,1);
529 PR_HST(RET_OLD_hst,2);
530 PR_HST(RET_OLD_hst,3);
531 PR_HST(RET_OLD_hst,4);
532 PR_HST(RET_OLD_hst,5);
533 PR_HST(RET_OLD_hst,6);
534 PR_HST(RET_OLD_hst,7);
535 PR_HST(RET_OLD_hst,8);
536 PR_HST(RET_UNBOXED_TUP_hst,0);
537 PR_HST(RET_UNBOXED_TUP_hst,1);
538 PR_HST(RET_UNBOXED_TUP_hst,2);
539 PR_HST(RET_UNBOXED_TUP_hst,3);
540 PR_HST(RET_UNBOXED_TUP_hst,4);
541 PR_HST(RET_UNBOXED_TUP_hst,5);
542 PR_HST(RET_UNBOXED_TUP_hst,6);
543 PR_HST(RET_UNBOXED_TUP_hst,7);
544 PR_HST(RET_UNBOXED_TUP_hst,8);
547 PR_CTR(UPDF_OMITTED_ctr);
548 PR_CTR(UPDF_PUSHED_ctr);
549 PR_CTR(CATCHF_PUSHED_ctr);
551 PR_CTR(UPDF_RCC_PUSHED_ctr);
552 PR_CTR(UPDF_RCC_OMITTED_ctr);
554 PR_CTR(UPD_SQUEEZED_ctr);
555 PR_CTR(UPD_CON_IN_NEW_ctr);
556 PR_CTR(UPD_CON_IN_PLACE_ctr);
557 PR_CTR(UPD_PAP_IN_NEW_ctr);
558 PR_CTR(UPD_PAP_IN_PLACE_ctr);
560 PR_CTR(UPD_BH_UPDATABLE_ctr);
561 PR_CTR(UPD_BH_SINGLE_ENTRY_ctr);
562 PR_CTR(UPD_CAF_BH_UPDATABLE_ctr);
563 PR_CTR(UPD_CAF_BH_SINGLE_ENTRY_ctr);
565 /* krc: put off till later...*/
567 PR_HST(UPD_CON_IN_NEW_hst,0);
568 PR_HST(UPD_CON_IN_NEW_hst,1);
569 PR_HST(UPD_CON_IN_NEW_hst,2);
570 PR_HST(UPD_CON_IN_NEW_hst,3);
571 PR_HST(UPD_CON_IN_NEW_hst,4);
572 PR_HST(UPD_CON_IN_NEW_hst,5);
573 PR_HST(UPD_CON_IN_NEW_hst,6);
574 PR_HST(UPD_CON_IN_NEW_hst,7);
575 PR_HST(UPD_CON_IN_NEW_hst,8);
576 PR_HST(UPD_PAP_IN_NEW_hst,0);
577 PR_HST(UPD_PAP_IN_NEW_hst,1);
578 PR_HST(UPD_PAP_IN_NEW_hst,2);
579 PR_HST(UPD_PAP_IN_NEW_hst,3);
580 PR_HST(UPD_PAP_IN_NEW_hst,4);
581 PR_HST(UPD_PAP_IN_NEW_hst,5);
582 PR_HST(UPD_PAP_IN_NEW_hst,6);
583 PR_HST(UPD_PAP_IN_NEW_hst,7);
584 PR_HST(UPD_PAP_IN_NEW_hst,8);
587 PR_CTR(UPD_NEW_IND_ctr);
588 /* see comment on ENT_PERM_IND_ctr */
589 COND_PR_CTR(UPD_NEW_PERM_IND_ctr,RtsFlags.GcFlags.squeezeUpdFrames == rtsFalse,"U!PD_NEW_PERM_IND_ctr requires +RTS -Z");
590 PR_CTR(UPD_OLD_IND_ctr);
591 /* see comment on ENT_PERM_IND_ctr */
592 COND_PR_CTR(UPD_OLD_PERM_IND_ctr,RtsFlags.GcFlags.squeezeUpdFrames == rtsFalse,"U!PD_OLD_PERM_IND_ctr requires +RTS -Z");
594 PR_CTR(GC_SEL_ABANDONED_ctr);
595 PR_CTR(GC_SEL_MINOR_ctr);
596 PR_CTR(GC_SEL_MAJOR_ctr);
597 PR_CTR(GC_FAILED_PROMOTION_ctr);
598 PR_CTR(GC_WORDS_COPIED_ctr);
601 /* Data structure used in ``registering'' one of these counters. */
603 StgEntCounter *ticky_entry_ctrs = NULL; /* root of list of them */
605 /* To print out all the registered-counter info: */
608 printRegisteredCounterInfo (FILE *tf)
612 if ( ticky_entry_ctrs != NULL ) {
613 fprintf(tf,"\n**************************************************\n\n");
615 fprintf(tf, "%11s%11s %6s%6s %-11s%-30s\n",
616 "Entries", "Allocs", "Arity", "Stack", "Kinds", "Function");
617 fprintf(tf, "--------------------------------------------------------------------------------\n");
618 /* Function name at the end so it doesn't mess up the tabulation */
620 for (p = ticky_entry_ctrs; p != NULL; p = p->link) {
621 fprintf(tf, "%11ld%11ld %6u%6u %-11s%-30s",
634 /* Catch-all top-level counter struct. Allocations from CAFs will go
642 #endif /* TICKY_TICKY */