From 567381a2cfdf7bf93e8c5daf3621383bec954041 Mon Sep 17 00:00:00 2001 From: andy Date: Mon, 23 Jul 2001 23:37:35 +0000 Subject: [PATCH] [project @ 2001-07-23 23:37:35 by andy] Adding the -Pa flag. This allows you to see all the cost centres --- ghc/rts/Profiling.c | 8 ++++++-- ghc/rts/RtsFlags.c | 11 +++++++---- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/ghc/rts/Profiling.c b/ghc/rts/Profiling.c index b40b298..23cd5a7 100644 --- a/ghc/rts/Profiling.c +++ b/ghc/rts/Profiling.c @@ -1,5 +1,5 @@ /* ----------------------------------------------------------------------------- - * $Id: Profiling.c,v 1.20 2000/05/12 13:01:04 simonmar Exp $ + * $Id: Profiling.c,v 1.21 2001/07/23 23:37:35 andy Exp $ * * (c) The GHC Team, 1998-2000 * @@ -135,6 +135,8 @@ static CostCentreStack * IsInIndexTable ( IndexTable *, CostCentre * ); static IndexTable * AddToIndexTable ( IndexTable *, CostCentreStack *, CostCentre *, unsigned int ); + + #ifdef DEBUG static void printCCS ( CostCentreStack *ccs ); #endif @@ -568,7 +570,8 @@ report_per_cc_costs( void ) for (cc = CC_LIST; cc != NULL; cc = next) { next = cc->link; if (cc->time_ticks > total_prof_ticks/100 - || cc->mem_alloc > total_alloc/100) { + || cc->mem_alloc > total_alloc/100 + || RtsFlags.CcFlags.doCostCentres >= COST_CENTRES_ALL) { insert_cc_in_sorted_list(cc); } } @@ -724,6 +727,7 @@ reportCCS(CostCentreStack *ccs, nat indent) } } + /* Traverse the cost centre stack tree and accumulate * ticks/allocations. */ diff --git a/ghc/rts/RtsFlags.c b/ghc/rts/RtsFlags.c index d9e51fc..3c78d10 100644 --- a/ghc/rts/RtsFlags.c +++ b/ghc/rts/RtsFlags.c @@ -1,5 +1,5 @@ /* ----------------------------------------------------------------------------- - * $Id: RtsFlags.c,v 1.41 2001/07/23 17:23:19 simonmar Exp $ + * $Id: RtsFlags.c,v 1.42 2001/07/23 23:37:35 andy Exp $ * * (c) The AQUA Project, Glasgow University, 1994-1997 * (c) The GHC Team, 1998-1999 @@ -403,9 +403,9 @@ usage_text[] = { #if defined(PROFILING) || defined(PAR) "", " -px Time/allocation profile (XML) (output file .prof)", -" -p Time/allocation profile (output file .prof)", -" sort: T = time (default), A = alloc, C = cost centre label", -" -P More detailed Time/Allocation profile", +" -p Time/allocation profile (output file .prof)", +" -P More detailed Time/Allocation profile", +" -Pa Give information about *all* cost centres", # if defined(PROFILING) "", @@ -745,6 +745,9 @@ error = rtsTrue; case 'x': RtsFlags.CcFlags.doCostCentres = COST_CENTRES_XML; break; + case 'a': + RtsFlags.CcFlags.doCostCentres = COST_CENTRES_ALL; + break; default: RtsFlags.CcFlags.doCostCentres = COST_CENTRES_SUMMARY; break; -- 1.7.10.4