1 /* -----------------------------------------------------------------------------
2 * $Id: Profiling.c,v 1.32 2002/07/05 01:23:45 mthomas 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 /* figures for the profiling report.
41 static lnat total_alloc, total_prof_ticks;
43 /* Globals for opening the profiling log file(s)
45 static char *prof_filename; /* prof report file name = <program>.prof */
48 static char *hp_filename; /* heap profile (hp2ps style) log file */
51 /* The Current Cost Centre Stack (for attributing costs)
53 CostCentreStack *CCCS;
55 /* Linked lists to keep track of cc's and ccs's that haven't
56 * been declared in the log file yet
59 CostCentreStack *CCS_LIST;
62 * Built-in cost centres and cost-centre stacks:
64 * MAIN is the root of the cost-centre stack tree. If there are
65 * no _scc_s in the program, all costs will be attributed
68 * SYSTEM is the RTS in general (scheduler, etc.). All costs for
69 * RTS operations apart from garbage collection are attributed
72 * GC is the storage manager / garbage collector.
74 * OVERHEAD gets all costs generated by the profiling system
75 * itself. These are costs that would not be incurred
76 * during non-profiled execution of the program.
78 * SUBSUMED is the one-and-only CCS placed on top-level functions.
79 * It indicates that all costs are to be attributed to the
80 * enclosing cost centre stack. SUBSUMED never accumulates
81 * any costs. The is_caf flag is set on the subsumed cost
84 * DONT_CARE is a placeholder cost-centre we assign to static
85 * constructors. It should *never* accumulate any costs.
88 CC_DECLARE(CC_MAIN, "MAIN", "MAIN", CC_IS_BORING, );
89 CC_DECLARE(CC_SYSTEM, "SYSTEM", "MAIN", CC_IS_BORING, );
90 CC_DECLARE(CC_GC, "GC", "GC", CC_IS_BORING, );
91 CC_DECLARE(CC_OVERHEAD, "OVERHEAD_of", "PROFILING", CC_IS_CAF, );
92 CC_DECLARE(CC_SUBSUMED, "SUBSUMED", "MAIN", CC_IS_CAF, );
93 CC_DECLARE(CC_DONT_CARE, "DONT_CARE", "MAIN", CC_IS_BORING, );
95 CCS_DECLARE(CCS_MAIN, CC_MAIN, );
96 CCS_DECLARE(CCS_SYSTEM, CC_SYSTEM, );
97 CCS_DECLARE(CCS_GC, CC_GC, );
98 CCS_DECLARE(CCS_OVERHEAD, CC_OVERHEAD, );
99 CCS_DECLARE(CCS_SUBSUMED, CC_SUBSUMED, );
100 CCS_DECLARE(CCS_DONT_CARE, CC_DONT_CARE, );
103 * Uniques for the XML log-file format
108 #define HEAP_OBJ_UQ 4
109 #define TIME_UPD_UQ 5
110 #define HEAP_UPD_UQ 6
116 static CostCentreStack * ActualPush_ ( CostCentreStack *ccs, CostCentre *cc,
117 CostCentreStack *new_ccs );
118 static rtsBool ccs_to_ignore ( CostCentreStack *ccs );
119 static void count_ticks ( CostCentreStack *ccs );
120 static void inherit_costs ( CostCentreStack *ccs );
121 static void reportCCS ( CostCentreStack *ccs, nat indent );
122 static void DecCCS ( CostCentreStack *ccs );
123 static void DecBackEdge ( CostCentreStack *ccs,
124 CostCentreStack *oldccs );
125 static CostCentreStack * CheckLoop ( CostCentreStack *ccs, CostCentre *cc );
126 static CostCentreStack * pruneCCSTree ( CostCentreStack *ccs );
127 static CostCentreStack * ActualPush ( CostCentreStack *, CostCentre * );
128 static CostCentreStack * IsInIndexTable ( IndexTable *, CostCentre * );
129 static IndexTable * AddToIndexTable ( IndexTable *, CostCentreStack *,
130 CostCentre *, unsigned int );
131 static void ccsSetSelected ( CostCentreStack *ccs );
133 static void initTimeProfiling ( void );
134 static void initProfilingLogFile( void );
136 static void reportCCS_XML ( CostCentreStack *ccs );
138 /* -----------------------------------------------------------------------------
139 Initialise the profiling environment
140 -------------------------------------------------------------------------- */
143 initProfiling1 (void)
145 // initialise our arena
146 prof_arena = newArena();
148 /* for the benefit of allocate()... */
151 /* Initialize counters for IDs */
156 /* Initialize Declaration lists to NULL */
160 /* Register all the cost centres / stacks in the program
161 * CC_MAIN gets link = 0, all others have non-zero link.
163 REGISTER_CC(CC_MAIN);
164 REGISTER_CC(CC_SYSTEM);
166 REGISTER_CC(CC_OVERHEAD);
167 REGISTER_CC(CC_SUBSUMED);
168 REGISTER_CC(CC_DONT_CARE);
169 REGISTER_CCS(CCS_MAIN);
170 REGISTER_CCS(CCS_SYSTEM);
171 REGISTER_CCS(CCS_GC);
172 REGISTER_CCS(CCS_OVERHEAD);
173 REGISTER_CCS(CCS_SUBSUMED);
174 REGISTER_CCS(CCS_DONT_CARE);
178 /* cost centres are registered by the per-module
179 * initialisation code now...
184 initProfiling2 (void)
186 CostCentreStack *ccs, *next;
190 /* Set up the log file, and dump the header and cost centre
191 * information into it. */
192 initProfilingLogFile();
194 /* find all the "special" cost centre stacks, and make them children
197 ASSERT(CCS_MAIN->prevStack == 0);
198 CCS_MAIN->root = CC_MAIN;
199 ccsSetSelected(CCS_MAIN);
202 for (ccs = CCS_LIST; ccs != CCS_MAIN; ) {
203 next = ccs->prevStack;
205 ActualPush_(CCS_MAIN,ccs->cc,ccs);
210 if (RtsFlags.CcFlags.doCostCentres) {
214 if (RtsFlags.ProfFlags.doHeapProfile) {
219 // Decide whether closures with this CCS should contribute to the heap
222 ccsSetSelected( CostCentreStack *ccs )
224 if (RtsFlags.ProfFlags.modSelector) {
225 if (! strMatchesSelector( ccs->cc->module,
226 RtsFlags.ProfFlags.modSelector ) ) {
231 if (RtsFlags.ProfFlags.ccSelector) {
232 if (! strMatchesSelector( ccs->cc->label,
233 RtsFlags.ProfFlags.ccSelector ) ) {
238 if (RtsFlags.ProfFlags.ccsSelector) {
240 for (c = ccs; c != NULL; c = c->prevStack) {
241 if ( strMatchesSelector( c->cc->label,
242 RtsFlags.ProfFlags.ccsSelector )) {
258 initProfilingLogFile(void)
260 /* Initialise the log file name */
261 prof_filename = arenaAlloc(prof_arena, strlen(prog_argv[0]) + 6);
262 sprintf(prof_filename, "%s.prof", prog_argv[0]);
264 /* open the log file */
265 if ((prof_file = fopen(prof_filename, "w")) == NULL) {
266 fprintf(stderr, "Can't open profiling report file %s\n", prof_filename);
267 RtsFlags.CcFlags.doCostCentres = 0;
268 // The following line was added by Sung; retainer/LDV profiling may need
269 // two output files, i.e., <program>.prof/hp.
270 if (RtsFlags.ProfFlags.doHeapProfile == HEAP_BY_RETAINER)
271 RtsFlags.ProfFlags.doHeapProfile = 0;
275 if (RtsFlags.CcFlags.doCostCentres == COST_CENTRES_XML) {
276 /* dump the time, and the profiling interval */
277 fprintf(prof_file, "\"%s\"\n", time_str());
278 fprintf(prof_file, "\"%d ms\"\n", TICK_MILLISECS);
280 /* declare all the cost centres */
283 for (cc = CC_LIST; cc != NULL; cc = cc->link) {
284 fprintf(prof_file, "%d %d \"%s\" \"%s\"\n",
285 CC_UQ, cc->ccID, cc->label, cc->module);
290 if (RtsFlags.ProfFlags.doHeapProfile) {
291 /* Initialise the log file name */
292 hp_filename = arenaAlloc(prof_arena, strlen(prog_argv[0]) + 6);
293 sprintf(hp_filename, "%s.hp", prog_argv[0]);
295 /* open the log file */
296 if ((hp_file = fopen(hp_filename, "w")) == NULL) {
297 fprintf(stderr, "Can't open profiling report file %s\n",
299 RtsFlags.ProfFlags.doHeapProfile = 0;
306 initTimeProfiling(void)
313 endProfiling ( void )
315 if (RtsFlags.CcFlags.doCostCentres) {
318 if (RtsFlags.ProfFlags.doHeapProfile) {
323 /* -----------------------------------------------------------------------------
324 Set cost centre stack when entering a function.
325 -------------------------------------------------------------------------- */
326 rtsBool entering_PAP;
329 EnterFunCCS ( CostCentreStack *cccs, CostCentreStack *ccsfn )
331 /* PAP_entry has already set CCCS for us */
333 entering_PAP = rtsFalse;
337 if (ccsfn->root->is_caf == CC_IS_CAF) {
338 return AppendCCS(cccs,ccsfn);
344 /* -----------------------------------------------------------------------------
345 Cost-centre stack manipulation
346 -------------------------------------------------------------------------- */
349 CostCentreStack * _PushCostCentre ( CostCentreStack *ccs, CostCentre *cc );
351 PushCostCentre ( CostCentreStack *ccs, CostCentre *cc )
352 #define PushCostCentre _PushCostCentre
355 fprintf(stderr,"Pushing %s on ", cc->label);
356 fprintCCS(stderr,ccs);
357 fprintf(stderr,"\n"));
358 return PushCostCentre(ccs,cc);
363 PushCostCentre ( CostCentreStack *ccs, CostCentre *cc )
365 CostCentreStack *temp_ccs;
367 if (ccs == EMPTY_STACK)
368 return ActualPush(ccs,cc);
373 /* check if we've already memoized this stack */
374 temp_ccs = IsInIndexTable(ccs->indexTable,cc);
376 if (temp_ccs != EMPTY_STACK)
379 temp_ccs = CheckLoop(ccs,cc);
380 if (temp_ccs != NULL) {
381 /* we have recursed to an older CCS. Mark this in
382 * the index table, and emit a "back edge" into the
385 ccs->indexTable = AddToIndexTable(ccs->indexTable,temp_ccs,cc,1);
386 DecBackEdge(temp_ccs,ccs);
389 return ActualPush(ccs,cc);
396 static CostCentreStack *
397 CheckLoop ( CostCentreStack *ccs, CostCentre *cc )
399 while (ccs != EMPTY_STACK) {
402 ccs = ccs->prevStack;
407 /* Append ccs1 to ccs2 (ignoring any CAF cost centre at the root of ccs1 */
410 CostCentreStack *_AppendCCS ( CostCentreStack *ccs1, CostCentreStack *ccs2 );
412 AppendCCS ( CostCentreStack *ccs1, CostCentreStack *ccs2 )
413 #define AppendCCS _AppendCCS
417 fprintf(stderr,"Appending ");
418 fprintCCS(stderr,ccs1);
419 fprintf(stderr," to ");
420 fprintCCS(stderr,ccs2);
421 fprintf(stderr,"\n");});
422 return AppendCCS(ccs1,ccs2);
427 AppendCCS ( CostCentreStack *ccs1, CostCentreStack *ccs2 )
429 CostCentreStack *ccs = NULL;
435 if (ccs2->cc->is_caf == CC_IS_CAF) {
439 if (ccs2->prevStack != NULL) {
440 ccs = AppendCCS(ccs1, ccs2->prevStack);
443 return PushCostCentre(ccs,ccs2->cc);
446 static CostCentreStack *
447 ActualPush ( CostCentreStack *ccs, CostCentre *cc )
449 CostCentreStack *new_ccs;
451 /* allocate space for a new CostCentreStack */
452 new_ccs = (CostCentreStack *) arenaAlloc(prof_arena, sizeof(CostCentreStack));
454 return ActualPush_(ccs, cc, new_ccs);
457 static CostCentreStack *
458 ActualPush_ ( CostCentreStack *ccs, CostCentre *cc, CostCentreStack *new_ccs )
460 /* assign values to each member of the structure */
461 ASSIGN_CCS_ID(new_ccs->ccsID);
464 new_ccs->prevStack = ccs;
466 new_ccs->indexTable = EMPTY_TABLE;
468 /* Initialise the various _scc_ counters to zero
470 new_ccs->scc_count = 0;
472 /* Initialize all other stats here. There should be a quick way
473 * that's easily used elsewhere too
475 new_ccs->time_ticks = 0;
476 new_ccs->mem_alloc = 0;
477 new_ccs->inherited_ticks = 0;
478 new_ccs->inherited_alloc = 0;
480 new_ccs->root = ccs->root;
482 // Set the selected field.
483 ccsSetSelected(new_ccs);
485 /* update the memoization table for the parent stack */
486 if (ccs != EMPTY_STACK)
487 ccs->indexTable = AddToIndexTable(ccs->indexTable, new_ccs, cc,
488 0/*not a back edge*/);
490 /* make sure this CC is declared at the next heap/time sample */
493 /* return a pointer to the new stack */
498 static CostCentreStack *
499 IsInIndexTable(IndexTable *it, CostCentre *cc)
501 while (it!=EMPTY_TABLE)
509 /* otherwise we never found it so return EMPTY_TABLE */
515 AddToIndexTable(IndexTable *it, CostCentreStack *new_ccs,
516 CostCentre *cc, unsigned int back_edge)
520 new_it = arenaAlloc(prof_arena, sizeof(IndexTable));
523 new_it->ccs = new_ccs;
525 new_it->back_edge = back_edge;
531 DecCCS(CostCentreStack *ccs)
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, ccs->prevStack->ccsID);
544 DecBackEdge( CostCentreStack *ccs, CostCentreStack *oldccs )
546 if (prof_file && RtsFlags.CcFlags.doCostCentres == COST_CENTRES_XML) {
547 if (ccs->prevStack == EMPTY_STACK)
548 fprintf(prof_file, "%d %d 1 %d\n", CCS_UQ,
549 ccs->ccsID, ccs->cc->ccID);
551 fprintf(prof_file, "%d %d 2 %d %d\n", CCS_UQ,
552 ccs->ccsID, ccs->cc->ccID, oldccs->ccsID);
556 /* -----------------------------------------------------------------------------
557 Generating a time & allocation profiling report.
558 -------------------------------------------------------------------------- */
560 /* We omit certain system-related CCs and CCSs from the default
561 * reports, so as not to cause confusion.
564 cc_to_ignore (CostCentre *cc)
566 if ( cc == CC_OVERHEAD
567 || cc == CC_DONT_CARE
569 || cc == CC_SYSTEM) {
577 ccs_to_ignore (CostCentreStack *ccs)
579 if ( ccs == CCS_OVERHEAD
580 || ccs == CCS_DONT_CARE
582 || ccs == CCS_SYSTEM) {
589 /* -----------------------------------------------------------------------------
590 Generating the aggregated per-cost-centre time/alloc report.
591 -------------------------------------------------------------------------- */
593 static CostCentre *sorted_cc_list;
596 aggregate_cc_costs( CostCentreStack *ccs )
600 ccs->cc->mem_alloc += ccs->mem_alloc;
601 ccs->cc->time_ticks += ccs->time_ticks;
603 for (i = ccs->indexTable; i != 0; i = i->next) {
605 aggregate_cc_costs(i->ccs);
611 insert_cc_in_sorted_list( CostCentre *new_cc )
613 CostCentre **prev, *cc;
615 prev = &sorted_cc_list;
616 for (cc = sorted_cc_list; cc != NULL; cc = cc->link) {
617 if (new_cc->time_ticks > cc->time_ticks) {
630 report_per_cc_costs( void )
632 CostCentre *cc, *next;
634 aggregate_cc_costs(CCS_MAIN);
635 sorted_cc_list = NULL;
637 for (cc = CC_LIST; cc != NULL; cc = next) {
639 if (cc->time_ticks > total_prof_ticks/100
640 || cc->mem_alloc > total_alloc/100
641 || RtsFlags.CcFlags.doCostCentres >= COST_CENTRES_ALL) {
642 insert_cc_in_sorted_list(cc);
646 fprintf(prof_file, "%-30s %-20s", "COST CENTRE", "MODULE");
647 fprintf(prof_file, "%6s %6s", "%time", "%alloc");
648 if (RtsFlags.CcFlags.doCostCentres >= COST_CENTRES_VERBOSE) {
649 fprintf(prof_file, " %5s %9s", "ticks", "bytes");
651 fprintf(prof_file, "\n\n");
653 for (cc = sorted_cc_list; cc != NULL; cc = cc->link) {
654 if (cc_to_ignore(cc)) {
657 fprintf(prof_file, "%-30s %-20s", cc->label, cc->module);
658 fprintf(prof_file, "%6.1f %6.1f",
659 total_prof_ticks == 0 ? 0.0 : (cc->time_ticks / (StgFloat) total_prof_ticks * 100),
660 total_alloc == 0 ? 0.0 : (cc->mem_alloc / (StgFloat)
664 if (RtsFlags.CcFlags.doCostCentres >= COST_CENTRES_VERBOSE) {
665 fprintf(prof_file, " %5ld %9lld", cc->time_ticks, cc->mem_alloc);
667 fprintf(prof_file, "\n");
670 fprintf(prof_file,"\n\n");
673 /* -----------------------------------------------------------------------------
674 Generate the cost-centre-stack time/alloc report
675 -------------------------------------------------------------------------- */
678 fprint_header( void )
680 fprintf(prof_file, "%-24s %-10s individual inherited\n", "", "");
682 fprintf(prof_file, "%-24s %-50s", "COST CENTRE", "MODULE");
683 fprintf(prof_file, "%6s %10s %5s %5s %5s %5s", "no.", "entries", "%time", "%alloc", "%time", "%alloc");
685 if (RtsFlags.CcFlags.doCostCentres >= COST_CENTRES_VERBOSE) {
686 fprintf(prof_file, " %5s %9s", "ticks", "bytes");
687 #if defined(PROFILING_DETAIL_COUNTS)
688 fprintf(prof_file, " %8s %8s %8s %8s %8s %8s %8s",
689 "closures", "thunks", "funcs", "PAPs", "subfuns", "subcafs", "cafssub");
693 fprintf(prof_file, "\n\n");
697 reportCCSProfiling( void )
700 char temp[128]; /* sigh: magic constant */
704 total_prof_ticks = 0;
706 count_ticks(CCS_MAIN);
708 switch (RtsFlags.CcFlags.doCostCentres) {
711 case COST_CENTRES_XML:
717 fprintf(prof_file, "\t%s Time and Allocation Profiling Report (%s)\n",
718 time_str(), "Final");
720 fprintf(prof_file, "\n\t ");
721 fprintf(prof_file, " %s", prog_argv[0]);
722 fprintf(prof_file, " +RTS");
723 for (count = 0; rts_argv[count]; count++)
724 fprintf(prof_file, " %s", rts_argv[count]);
725 fprintf(prof_file, " -RTS");
726 for (count = 1; prog_argv[count]; count++)
727 fprintf(prof_file, " %s", prog_argv[count]);
728 fprintf(prof_file, "\n\n");
730 fprintf(prof_file, "\ttotal time = %11.2f secs (%lu ticks @ %d ms)\n",
731 total_prof_ticks / (StgFloat) TICK_FREQUENCY,
732 total_prof_ticks, TICK_MILLISECS);
734 fprintf(prof_file, "\ttotal alloc = %11s bytes",
735 ullong_format_string((ullong) total_alloc * sizeof(W_),
736 temp, rtsTrue/*commas*/));
737 /* ToDo: 64-bit error! */
739 #if defined(PROFILING_DETAIL_COUNTS)
740 fprintf(prof_file, " (%lu closures)", total_allocs);
742 fprintf(prof_file, " (excludes profiling overheads)\n\n");
744 report_per_cc_costs();
746 inherit_costs(CCS_MAIN);
749 reportCCS(pruneCCSTree(CCS_MAIN), 0);
753 reportCCS(CostCentreStack *ccs, nat indent)
760 /* Only print cost centres with non 0 data ! */
762 if ( RtsFlags.CcFlags.doCostCentres >= COST_CENTRES_ALL ||
763 ! ccs_to_ignore(ccs))
764 /* force printing of *all* cost centres if -P -P */
767 fprintf(prof_file, "%-*s%-*s %-50s",
768 indent, "", 24-indent, cc->label, cc->module);
770 fprintf(prof_file, "%6d %11.0f %5.1f %5.1f %5.1f %5.1f",
771 ccs->ccsID, (double) ccs->scc_count,
772 total_prof_ticks == 0 ? 0.0 : ((double)ccs->time_ticks / (double)total_prof_ticks * 100.0),
773 total_alloc == 0 ? 0.0 : ((double)ccs->mem_alloc / (double)total_alloc * 100.0),
774 total_prof_ticks == 0 ? 0.0 : ((double)ccs->inherited_ticks / (double)total_prof_ticks * 100.0),
775 total_alloc == 0 ? 0.0 : ((double)ccs->inherited_alloc / (double)total_alloc * 100.0)
778 if (RtsFlags.CcFlags.doCostCentres >= COST_CENTRES_VERBOSE) {
779 fprintf(prof_file, " %5ld %9lld", ccs->time_ticks, ccs->mem_alloc*sizeof(W_));
780 #if defined(PROFILING_DETAIL_COUNTS)
781 fprintf(prof_file, " %8ld %8ld %8ld %8ld %8ld %8ld %8ld",
782 ccs->mem_allocs, ccs->thunk_count,
783 ccs->function_count, ccs->pap_count,
784 ccs->subsumed_fun_count, ccs->subsumed_caf_count,
785 ccs->caffun_subsumed);
788 fprintf(prof_file, "\n");
791 for (i = ccs->indexTable; i != 0; i = i->next) {
793 reportCCS(i->ccs, indent+1);
799 /* Traverse the cost centre stack tree and accumulate
803 count_ticks(CostCentreStack *ccs)
807 if (!ccs_to_ignore(ccs)) {
808 total_alloc += ccs->mem_alloc;
809 total_prof_ticks += ccs->time_ticks;
811 for (i = ccs->indexTable; i != NULL; i = i->next)
817 /* Traverse the cost centre stack tree and inherit ticks & allocs.
820 inherit_costs(CostCentreStack *ccs)
824 if (ccs_to_ignore(ccs)) { return; }
826 ccs->inherited_ticks += ccs->time_ticks;
827 ccs->inherited_alloc += ccs->mem_alloc;
829 for (i = ccs->indexTable; i != NULL; i = i->next)
831 inherit_costs(i->ccs);
832 ccs->inherited_ticks += i->ccs->inherited_ticks;
833 ccs->inherited_alloc += i->ccs->inherited_alloc;
839 static CostCentreStack *
840 pruneCCSTree( CostCentreStack *ccs )
842 CostCentreStack *ccs1;
843 IndexTable *i, **prev;
845 prev = &ccs->indexTable;
846 for (i = ccs->indexTable; i != 0; i = i->next) {
847 if (i->back_edge) { continue; }
849 ccs1 = pruneCCSTree(i->ccs);
857 if ( (RtsFlags.CcFlags.doCostCentres >= COST_CENTRES_ALL
858 /* force printing of *all* cost centres if -P -P */ )
860 || ( ccs->indexTable != 0 )
861 || ( ccs->scc_count || ccs->time_ticks || ccs->mem_alloc )
869 /* -----------------------------------------------------------------------------
870 Generate the XML time/allocation profile
871 -------------------------------------------------------------------------- */
874 gen_XML_logfile( void )
876 fprintf(prof_file, "%d %lu", TIME_UPD_UQ, total_prof_ticks);
878 reportCCS_XML(pruneCCSTree(CCS_MAIN));
880 fprintf(prof_file, " 0\n");
886 reportCCS_XML(CostCentreStack *ccs)
891 if (ccs_to_ignore(ccs)) { return; }
895 fprintf(prof_file, " 1 %d %llu %lu %llu",
896 ccs->ccsID, ccs->scc_count, ccs->time_ticks, ccs->mem_alloc);
898 for (i = ccs->indexTable; i != 0; i = i->next) {
900 reportCCS_XML(i->ccs);
906 fprintCCS( FILE *f, CostCentreStack *ccs )
909 for (; ccs && ccs != CCS_MAIN; ccs = ccs->prevStack ) {
910 fprintf(f,"%s.%s", ccs->cc->module, ccs->cc->label);
911 if (ccs->prevStack && ccs->prevStack != CCS_MAIN) {
918 #endif /* PROFILING */