1 /* -----------------------------------------------------------------------------
2 * $Id: Profiling.c,v 1.26 2001/11/22 16:33:06 simonmar Exp $
4 * (c) The GHC Team, 1998-2000
6 * Support for profiling
8 * ---------------------------------------------------------------------------*/
12 #include "PosixSource.h"
16 #include "Profiling.h"
18 #include "Proftimer.h"
22 #include "RetainerProfile.h"
23 #include "LdvProfile.h"
26 * Profiling allocation arena.
31 * Global variables used to assign unique IDs to cc's, ccs's, and
39 /* Table sizes from old profiling system. Not sure if we'll need
42 nat time_intervals = 0;
43 nat earlier_ticks = 0;
50 /* Are we time-profiling?
52 rtsBool time_profiling = rtsFalse;
54 /* figures for the profiling report.
56 static lnat total_alloc, total_prof_ticks;
58 /* Globals for opening the profiling log file(s)
60 static char *prof_filename; /* prof report file name = <program>.prof */
63 static char *hp_filename; /* heap profile (hp2ps style) log file */
66 /* The Current Cost Centre Stack (for attributing costs)
68 CostCentreStack *CCCS;
70 /* Linked lists to keep track of cc's and ccs's that haven't
71 * been declared in the log file yet
74 CostCentreStack *CCS_LIST;
77 * Built-in cost centres and cost-centre stacks:
79 * MAIN is the root of the cost-centre stack tree. If there are
80 * no _scc_s in the program, all costs will be attributed
83 * SYSTEM is the RTS in general (scheduler, etc.). All costs for
84 * RTS operations apart from garbage collection are attributed
87 * GC is the storage manager / garbage collector.
89 * OVERHEAD gets all costs generated by the profiling system
90 * itself. These are costs that would not be incurred
91 * during non-profiled execution of the program.
93 * SUBSUMED is the one-and-only CCS placed on top-level functions.
94 * It indicates that all costs are to be attributed to the
95 * enclosing cost centre stack. SUBSUMED never accumulates
96 * any costs. The is_caf flag is set on the subsumed cost
99 * DONT_CARE is a placeholder cost-centre we assign to static
100 * constructors. It should *never* accumulate any costs.
103 CC_DECLARE(CC_MAIN, "MAIN", "MAIN", CC_IS_BORING, );
104 CC_DECLARE(CC_SYSTEM, "SYSTEM", "MAIN", CC_IS_BORING, );
105 CC_DECLARE(CC_GC, "GC", "GC", CC_IS_BORING, );
106 CC_DECLARE(CC_OVERHEAD, "OVERHEAD_of", "PROFILING", CC_IS_CAF, );
107 CC_DECLARE(CC_SUBSUMED, "SUBSUMED", "MAIN", CC_IS_CAF, );
108 CC_DECLARE(CC_DONT_CARE, "DONT_CARE", "MAIN", CC_IS_BORING, );
110 CCS_DECLARE(CCS_MAIN, CC_MAIN, );
111 CCS_DECLARE(CCS_SYSTEM, CC_SYSTEM, );
112 CCS_DECLARE(CCS_GC, CC_GC, );
113 CCS_DECLARE(CCS_OVERHEAD, CC_OVERHEAD, );
114 CCS_DECLARE(CCS_SUBSUMED, CC_SUBSUMED, );
115 CCS_DECLARE(CCS_DONT_CARE, CC_DONT_CARE, );
118 * Uniques for the XML log-file format
123 #define HEAP_OBJ_UQ 4
124 #define TIME_UPD_UQ 5
125 #define HEAP_UPD_UQ 6
131 static CostCentreStack * ActualPush_ ( CostCentreStack *ccs, CostCentre *cc,
132 CostCentreStack *new_ccs );
133 static rtsBool ccs_to_ignore ( CostCentreStack *ccs );
134 static void count_ticks ( CostCentreStack *ccs );
135 static void inherit_costs ( CostCentreStack *ccs );
136 static void reportCCS ( CostCentreStack *ccs, nat indent );
137 static void DecCCS ( CostCentreStack *ccs );
138 static void DecBackEdge ( CostCentreStack *ccs,
139 CostCentreStack *oldccs );
140 static CostCentreStack * CheckLoop ( CostCentreStack *ccs, CostCentre *cc );
141 static CostCentreStack * pruneCCSTree ( CostCentreStack *ccs );
142 static CostCentreStack * ActualPush ( CostCentreStack *, CostCentre * );
143 static CostCentreStack * IsInIndexTable ( IndexTable *, CostCentre * );
144 static IndexTable * AddToIndexTable ( IndexTable *, CostCentreStack *,
145 CostCentre *, unsigned int );
149 static void initTimeProfiling ( void );
150 static void initProfilingLogFile( void );
152 static void reportCCS_XML ( CostCentreStack *ccs );
154 /* -----------------------------------------------------------------------------
155 Initialise the profiling environment
156 -------------------------------------------------------------------------- */
159 initProfiling1 (void)
161 // initialise our arena
162 prof_arena = newArena();
164 /* for the benefit of allocate()... */
167 /* Initialize counters for IDs */
172 /* Initialize Declaration lists to NULL */
176 /* Register all the cost centres / stacks in the program
177 * CC_MAIN gets link = 0, all others have non-zero link.
179 REGISTER_CC(CC_MAIN);
180 REGISTER_CC(CC_SYSTEM);
182 REGISTER_CC(CC_OVERHEAD);
183 REGISTER_CC(CC_SUBSUMED);
184 REGISTER_CC(CC_DONT_CARE);
185 REGISTER_CCS(CCS_MAIN);
186 REGISTER_CCS(CCS_SYSTEM);
187 REGISTER_CCS(CCS_GC);
188 REGISTER_CCS(CCS_OVERHEAD);
189 REGISTER_CCS(CCS_SUBSUMED);
190 REGISTER_CCS(CCS_DONT_CARE);
194 /* cost centres are registered by the per-module
195 * initialisation code now...
198 switch (RtsFlags.ProfFlags.doHeapProfile) {
199 case HEAP_BY_RETAINER:
200 initRetainerProfiling();
209 initProfiling2 (void)
211 CostCentreStack *ccs, *next;
215 /* Set up the log file, and dump the header and cost centre
216 * information into it. */
217 initProfilingLogFile();
219 /* find all the "special" cost centre stacks, and make them children
222 ASSERT(CCS_MAIN->prevStack == 0);
223 CCS_MAIN->root = CC_MAIN;
225 for (ccs = CCS_LIST; ccs != CCS_MAIN; ) {
226 next = ccs->prevStack;
228 ActualPush_(CCS_MAIN,ccs->cc,ccs);
233 if (RtsFlags.CcFlags.doCostCentres) {
237 if (RtsFlags.ProfFlags.doHeapProfile) {
243 initProfilingLogFile(void)
245 /* Initialise the log file name */
246 prof_filename = arenaAlloc(prof_arena, strlen(prog_argv[0]) + 6);
247 sprintf(prof_filename, "%s.prof", prog_argv[0]);
249 /* open the log file */
250 if ((prof_file = fopen(prof_filename, "w")) == NULL) {
251 fprintf(stderr, "Can't open profiling report file %s\n", prof_filename);
252 RtsFlags.CcFlags.doCostCentres = 0;
253 // @retainer profiling
255 // The following line was added by Sung; retainer/LDV profiling may need
256 // two output files, i.e., <program>.prof/hp.
257 if (RtsFlags.ProfFlags.doHeapProfile == HEAP_BY_RETAINER ||
258 RtsFlags.ProfFlags.doHeapProfile == HEAP_BY_LDV)
259 RtsFlags.ProfFlags.doHeapProfile = 0;
263 if (RtsFlags.CcFlags.doCostCentres == COST_CENTRES_XML) {
264 /* dump the time, and the profiling interval */
265 fprintf(prof_file, "\"%s\"\n", time_str());
266 fprintf(prof_file, "\"%d ms\"\n", TICK_MILLISECS);
268 /* declare all the cost centres */
271 for (cc = CC_LIST; cc != NULL; cc = cc->link) {
272 fprintf(prof_file, "%d %d \"%s\" \"%s\"\n",
273 CC_UQ, cc->ccID, cc->label, cc->module);
278 if (RtsFlags.ProfFlags.doHeapProfile) {
279 /* Initialise the log file name */
280 hp_filename = arenaAlloc(prof_arena, strlen(prog_argv[0]) + 6);
281 sprintf(hp_filename, "%s.hp", prog_argv[0]);
283 /* open the log file */
284 if ((hp_file = fopen(hp_filename, "w")) == NULL) {
285 fprintf(stderr, "Can't open profiling report file %s\n",
287 RtsFlags.ProfFlags.doHeapProfile = 0;
294 initTimeProfiling(void)
296 time_profiling = rtsTrue;
303 endProfiling ( void )
305 if (RtsFlags.CcFlags.doCostCentres) {
308 if (RtsFlags.ProfFlags.doHeapProfile) {
313 /* -----------------------------------------------------------------------------
314 Set cost centre stack when entering a function.
315 -------------------------------------------------------------------------- */
316 rtsBool entering_PAP;
319 EnterFunCCS ( CostCentreStack *cccs, CostCentreStack *ccsfn )
321 /* PAP_entry has already set CCCS for us */
323 entering_PAP = rtsFalse;
327 if (ccsfn->root->is_caf == CC_IS_CAF) {
328 return AppendCCS(cccs,ccsfn);
334 /* -----------------------------------------------------------------------------
335 Cost-centre stack manipulation
336 -------------------------------------------------------------------------- */
339 CostCentreStack * _PushCostCentre ( CostCentreStack *ccs, CostCentre *cc );
341 PushCostCentre ( CostCentreStack *ccs, CostCentre *cc )
342 #define PushCostCentre _PushCostCentre
345 fprintf(stderr,"Pushing %s on ", cc->label);
346 fprintCCS(stderr,ccs);
347 fprintf(stderr,"\n"));
348 return PushCostCentre(ccs,cc);
353 PushCostCentre ( CostCentreStack *ccs, CostCentre *cc )
355 CostCentreStack *temp_ccs;
357 if (ccs == EMPTY_STACK)
358 return ActualPush(ccs,cc);
363 /* check if we've already memoized this stack */
364 temp_ccs = IsInIndexTable(ccs->indexTable,cc);
366 if (temp_ccs != EMPTY_STACK)
369 temp_ccs = CheckLoop(ccs,cc);
370 if (temp_ccs != NULL) {
371 /* we have recursed to an older CCS. Mark this in
372 * the index table, and emit a "back edge" into the
375 ccs->indexTable = AddToIndexTable(ccs->indexTable,temp_ccs,cc,1);
376 DecBackEdge(temp_ccs,ccs);
379 return ActualPush(ccs,cc);
386 static CostCentreStack *
387 CheckLoop ( CostCentreStack *ccs, CostCentre *cc )
389 while (ccs != EMPTY_STACK) {
392 ccs = ccs->prevStack;
397 /* Append ccs1 to ccs2 (ignoring any CAF cost centre at the root of ccs1 */
400 CostCentreStack *_AppendCCS ( CostCentreStack *ccs1, CostCentreStack *ccs2 );
402 AppendCCS ( CostCentreStack *ccs1, CostCentreStack *ccs2 )
403 #define AppendCCS _AppendCCS
407 fprintf(stderr,"Appending ");
408 fprintCCS(stderr,ccs1);
409 fprintf(stderr," to ");
410 fprintCCS(stderr,ccs2);
411 fprintf(stderr,"\n");});
412 return AppendCCS(ccs1,ccs2);
417 AppendCCS ( CostCentreStack *ccs1, CostCentreStack *ccs2 )
419 CostCentreStack *ccs = NULL;
425 if (ccs2->cc->is_caf == CC_IS_CAF) {
429 if (ccs2->prevStack != NULL) {
430 ccs = AppendCCS(ccs1, ccs2->prevStack);
433 return PushCostCentre(ccs,ccs2->cc);
436 static CostCentreStack *
437 ActualPush ( CostCentreStack *ccs, CostCentre *cc )
439 CostCentreStack *new_ccs;
441 /* allocate space for a new CostCentreStack */
442 new_ccs = (CostCentreStack *) arenaAlloc(prof_arena, sizeof(CostCentreStack));
444 return ActualPush_(ccs, cc, new_ccs);
447 static CostCentreStack *
448 ActualPush_ ( CostCentreStack *ccs, CostCentre *cc, CostCentreStack *new_ccs )
450 /* assign values to each member of the structure */
451 ASSIGN_CCS_ID(new_ccs->ccsID);
454 new_ccs->prevStack = ccs;
456 new_ccs->indexTable = EMPTY_TABLE;
458 /* Initialise the various _scc_ counters to zero
460 new_ccs->scc_count = 0;
462 /* Initialize all other stats here. There should be a quick way
463 * that's easily used elsewhere too
465 new_ccs->time_ticks = 0;
466 new_ccs->mem_alloc = 0;
467 new_ccs->inherited_ticks = 0;
468 new_ccs->inherited_alloc = 0;
470 new_ccs->root = ccs->root;
472 /* update the memoization table for the parent stack */
473 if (ccs != EMPTY_STACK)
474 ccs->indexTable = AddToIndexTable(ccs->indexTable, new_ccs, cc,
475 0/*not a back edge*/);
477 /* make sure this CC is declared at the next heap/time sample */
480 /* return a pointer to the new stack */
485 static CostCentreStack *
486 IsInIndexTable(IndexTable *it, CostCentre *cc)
488 while (it!=EMPTY_TABLE)
496 /* otherwise we never found it so return EMPTY_TABLE */
502 AddToIndexTable(IndexTable *it, CostCentreStack *new_ccs,
503 CostCentre *cc, unsigned int back_edge)
507 new_it = arenaAlloc(prof_arena, sizeof(IndexTable));
510 new_it->ccs = new_ccs;
512 new_it->back_edge = back_edge;
518 DecCCS(CostCentreStack *ccs)
520 if (prof_file && RtsFlags.CcFlags.doCostCentres == COST_CENTRES_XML) {
521 if (ccs->prevStack == EMPTY_STACK)
522 fprintf(prof_file, "%d %d 1 %d\n", CCS_UQ,
523 ccs->ccsID, ccs->cc->ccID);
525 fprintf(prof_file, "%d %d 2 %d %d\n", CCS_UQ,
526 ccs->ccsID, ccs->cc->ccID, ccs->prevStack->ccsID);
531 DecBackEdge( CostCentreStack *ccs, CostCentreStack *oldccs )
533 if (prof_file && RtsFlags.CcFlags.doCostCentres == COST_CENTRES_XML) {
534 if (ccs->prevStack == EMPTY_STACK)
535 fprintf(prof_file, "%d %d 1 %d\n", CCS_UQ,
536 ccs->ccsID, ccs->cc->ccID);
538 fprintf(prof_file, "%d %d 2 %d %d\n", CCS_UQ,
539 ccs->ccsID, ccs->cc->ccID, oldccs->ccsID);
543 /* -----------------------------------------------------------------------------
544 Generating a time & allocation profiling report.
545 -------------------------------------------------------------------------- */
547 /* We omit certain system-related CCs and CCSs from the default
548 * reports, so as not to cause confusion.
551 cc_to_ignore (CostCentre *cc)
553 if ( cc == CC_OVERHEAD
554 || cc == CC_DONT_CARE
556 || cc == CC_SYSTEM) {
564 ccs_to_ignore (CostCentreStack *ccs)
566 if ( ccs == CCS_OVERHEAD
567 || ccs == CCS_DONT_CARE
569 || ccs == CCS_SYSTEM) {
576 /* -----------------------------------------------------------------------------
577 Generating the aggregated per-cost-centre time/alloc report.
578 -------------------------------------------------------------------------- */
580 static CostCentre *sorted_cc_list;
583 aggregate_cc_costs( CostCentreStack *ccs )
587 ccs->cc->mem_alloc += ccs->mem_alloc;
588 ccs->cc->time_ticks += ccs->time_ticks;
590 for (i = ccs->indexTable; i != 0; i = i->next) {
592 aggregate_cc_costs(i->ccs);
598 insert_cc_in_sorted_list( CostCentre *new_cc )
600 CostCentre **prev, *cc;
602 prev = &sorted_cc_list;
603 for (cc = sorted_cc_list; cc != NULL; cc = cc->link) {
604 if (new_cc->time_ticks > cc->time_ticks) {
617 report_per_cc_costs( void )
619 CostCentre *cc, *next;
621 aggregate_cc_costs(CCS_MAIN);
622 sorted_cc_list = NULL;
624 for (cc = CC_LIST; cc != NULL; cc = next) {
626 if (cc->time_ticks > total_prof_ticks/100
627 || cc->mem_alloc > total_alloc/100
628 || RtsFlags.CcFlags.doCostCentres >= COST_CENTRES_ALL) {
629 insert_cc_in_sorted_list(cc);
633 fprintf(prof_file, "%-20s %-10s", "COST CENTRE", "MODULE");
634 fprintf(prof_file, "%6s %6s", "%time", "%alloc");
635 if (RtsFlags.CcFlags.doCostCentres >= COST_CENTRES_VERBOSE) {
636 fprintf(prof_file, " %5s %9s", "ticks", "bytes");
638 fprintf(prof_file, "\n\n");
640 for (cc = sorted_cc_list; cc != NULL; cc = cc->link) {
641 if (cc_to_ignore(cc)) {
644 fprintf(prof_file, "%-20s %-10s", cc->label, cc->module);
645 fprintf(prof_file, "%6.1f %6.1f",
646 total_prof_ticks == 0 ? 0.0 : (cc->time_ticks / (StgFloat) total_prof_ticks * 100),
647 total_alloc == 0 ? 0.0 : (cc->mem_alloc / (StgFloat)
651 if (RtsFlags.CcFlags.doCostCentres >= COST_CENTRES_VERBOSE) {
652 fprintf(prof_file, " %5ld %9lld", cc->time_ticks, cc->mem_alloc);
654 fprintf(prof_file, "\n");
657 fprintf(prof_file,"\n\n");
660 /* -----------------------------------------------------------------------------
661 Generate the cost-centre-stack time/alloc report
662 -------------------------------------------------------------------------- */
665 fprint_header( void )
667 fprintf(prof_file, "%-24s %-10s individual inherited\n", "", "");
669 fprintf(prof_file, "%-24s %-10s", "COST CENTRE", "MODULE");
670 fprintf(prof_file, "%8s %5s %5s %5s %5s", "entries", "%time", "%alloc", "%time", "%alloc");
672 if (RtsFlags.CcFlags.doCostCentres >= COST_CENTRES_VERBOSE) {
673 fprintf(prof_file, " %5s %9s", "ticks", "bytes");
674 #if defined(PROFILING_DETAIL_COUNTS)
675 fprintf(prof_file, " %8s %8s %8s %8s %8s %8s %8s",
676 "closures", "thunks", "funcs", "PAPs", "subfuns", "subcafs", "cafssub");
680 fprintf(prof_file, "\n\n");
684 report_ccs_profiling( void )
687 char temp[128]; /* sigh: magic constant */
691 total_prof_ticks = 0;
693 count_ticks(CCS_MAIN);
695 switch (RtsFlags.CcFlags.doCostCentres) {
698 case COST_CENTRES_XML:
704 fprintf(prof_file, "\t%s Time and Allocation Profiling Report (%s)\n",
705 time_str(), "Final");
707 fprintf(prof_file, "\n\t ");
708 fprintf(prof_file, " %s", prog_argv[0]);
709 fprintf(prof_file, " +RTS");
710 for (count = 0; rts_argv[count]; count++)
711 fprintf(prof_file, " %s", rts_argv[count]);
712 fprintf(prof_file, " -RTS");
713 for (count = 1; prog_argv[count]; count++)
714 fprintf(prof_file, " %s", prog_argv[count]);
715 fprintf(prof_file, "\n\n");
717 fprintf(prof_file, "\ttotal time = %11.2f secs (%lu ticks @ %d ms)\n",
718 total_prof_ticks / (StgFloat) TICK_FREQUENCY,
719 total_prof_ticks, TICK_MILLISECS);
721 fprintf(prof_file, "\ttotal alloc = %11s bytes",
722 ullong_format_string((ullong) total_alloc * sizeof(W_),
723 temp, rtsTrue/*commas*/));
724 /* ToDo: 64-bit error! */
726 #if defined(PROFILING_DETAIL_COUNTS)
727 fprintf(prof_file, " (%lu closures)", total_allocs);
729 fprintf(prof_file, " (excludes profiling overheads)\n\n");
731 report_per_cc_costs();
733 inherit_costs(CCS_MAIN);
736 reportCCS(pruneCCSTree(CCS_MAIN), 0);
738 // @retainer profiling
740 // Now, prof_file is closed in shutdownHaskell() because this file
741 // is also used for retainer/LDV profiling. See shutdownHaskell().
742 // fclose(prof_file);
746 reportCCS(CostCentreStack *ccs, nat indent)
753 /* Only print cost centres with non 0 data ! */
755 if ( RtsFlags.CcFlags.doCostCentres >= COST_CENTRES_ALL ||
756 ! ccs_to_ignore(ccs))
757 /* force printing of *all* cost centres if -P -P */
760 fprintf(prof_file, "%-*s%-*s %-10s",
761 indent, "", 24-indent, cc->label, cc->module);
763 fprintf(prof_file, "%8lld %5.1f %5.1f %5.1f %5.1f",
765 total_prof_ticks == 0 ? 0.0 : (ccs->time_ticks / (StgFloat) total_prof_ticks * 100),
766 total_alloc == 0 ? 0.0 : (ccs->mem_alloc / (StgFloat) total_alloc * 100),
767 total_prof_ticks == 0 ? 0.0 : (ccs->inherited_ticks / (StgFloat) total_prof_ticks * 100),
768 total_alloc == 0 ? 0.0 : (ccs->inherited_alloc / (StgFloat) total_alloc * 100)
771 if (RtsFlags.CcFlags.doCostCentres >= COST_CENTRES_VERBOSE) {
772 fprintf(prof_file, " %5ld %9lld", ccs->time_ticks, ccs->mem_alloc*sizeof(W_));
773 #if defined(PROFILING_DETAIL_COUNTS)
774 fprintf(prof_file, " %8ld %8ld %8ld %8ld %8ld %8ld %8ld",
775 ccs->mem_allocs, ccs->thunk_count,
776 ccs->function_count, ccs->pap_count,
777 ccs->subsumed_fun_count, ccs->subsumed_caf_count,
778 ccs->caffun_subsumed);
781 fprintf(prof_file, "\n");
784 for (i = ccs->indexTable; i != 0; i = i->next) {
786 reportCCS(i->ccs, indent+1);
792 /* Traverse the cost centre stack tree and accumulate
796 count_ticks(CostCentreStack *ccs)
800 if (!ccs_to_ignore(ccs)) {
801 total_alloc += ccs->mem_alloc;
802 total_prof_ticks += ccs->time_ticks;
804 for (i = ccs->indexTable; i != NULL; i = i->next)
810 /* Traverse the cost centre stack tree and inherit ticks & allocs.
813 inherit_costs(CostCentreStack *ccs)
817 if (ccs_to_ignore(ccs)) { return; }
819 ccs->inherited_ticks += ccs->time_ticks;
820 ccs->inherited_alloc += ccs->mem_alloc;
822 for (i = ccs->indexTable; i != NULL; i = i->next)
824 inherit_costs(i->ccs);
825 ccs->inherited_ticks += i->ccs->inherited_ticks;
826 ccs->inherited_alloc += i->ccs->inherited_alloc;
832 static CostCentreStack *
833 pruneCCSTree( CostCentreStack *ccs )
835 CostCentreStack *ccs1;
836 IndexTable *i, **prev;
838 prev = &ccs->indexTable;
839 for (i = ccs->indexTable; i != 0; i = i->next) {
840 if (i->back_edge) { continue; }
842 ccs1 = pruneCCSTree(i->ccs);
850 if ( (RtsFlags.CcFlags.doCostCentres >= COST_CENTRES_ALL
851 /* force printing of *all* cost centres if -P -P */ )
853 || ( ccs->indexTable != 0 )
854 || ( ccs->scc_count || ccs->time_ticks || ccs->mem_alloc )
862 /* -----------------------------------------------------------------------------
863 Generate the XML time/allocation profile
864 -------------------------------------------------------------------------- */
867 gen_XML_logfile( void )
869 fprintf(prof_file, "%d %lu", TIME_UPD_UQ, total_prof_ticks);
871 reportCCS_XML(pruneCCSTree(CCS_MAIN));
873 fprintf(prof_file, " 0\n");
879 reportCCS_XML(CostCentreStack *ccs)
884 if (ccs_to_ignore(ccs)) { return; }
888 fprintf(prof_file, " 1 %d %llu %lu %llu",
889 ccs->ccsID, ccs->scc_count, ccs->time_ticks, ccs->mem_alloc);
891 for (i = ccs->indexTable; i != 0; i = i->next) {
893 reportCCS_XML(i->ccs);
899 fprintCCS( FILE *f, CostCentreStack *ccs )
902 for (; ccs && ccs != CCS_MAIN; ccs = ccs->prevStack ) {
903 fprintf(f,"%s.%s", ccs->cc->module, ccs->cc->label);
904 if (ccs->prevStack && ccs->prevStack != CCS_MAIN) {
911 #endif /* PROFILING */