From 16871485a44ba8a6e93e40f30af7ea46839e0c4c Mon Sep 17 00:00:00 2001 From: Ravi Nanavati Date: Fri, 29 Sep 2006 22:51:15 +0000 Subject: [PATCH] rts_ccs_length Add the -L RTS flag to control the length of the cost-centre stacks reported in a heap profile. Please include this change in the 6.6 branch as well as HEAD --- includes/RtsFlags.h | 2 ++ rts/ProfHeap.c | 2 +- rts/RtsFlags.c | 12 +++++++++++- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/includes/RtsFlags.h b/includes/RtsFlags.h index fbdc64e..6c4b230 100644 --- a/includes/RtsFlags.h +++ b/includes/RtsFlags.h @@ -97,6 +97,8 @@ struct PROFILING_FLAGS { nat maxRetainerSetSize; + nat ccsLength; + char* modSelector; char* descrSelector; char* typeSelector; diff --git a/rts/ProfHeap.c b/rts/ProfHeap.c index 2818fb6..0ee53f3 100644 --- a/rts/ProfHeap.c +++ b/rts/ProfHeap.c @@ -806,7 +806,7 @@ dumpCensus( Census *census ) #ifdef PROFILING switch (RtsFlags.ProfFlags.doHeapProfile) { case HEAP_BY_CCS: - fprint_ccs(hp_file, (CostCentreStack *)ctr->identity, 25); + fprint_ccs(hp_file, (CostCentreStack *)ctr->identity, RtsFlags.ProfFlags.ccsLength); break; case HEAP_BY_MOD: case HEAP_BY_DESCR: diff --git a/rts/RtsFlags.c b/rts/RtsFlags.c index 9aa906f..7b8a4d1 100644 --- a/rts/RtsFlags.c +++ b/rts/RtsFlags.c @@ -177,6 +177,7 @@ void initRtsFlagsDefaults(void) RtsFlags.ProfFlags.includeTSOs = rtsFalse; RtsFlags.ProfFlags.showCCSOnException = rtsFalse; RtsFlags.ProfFlags.maxRetainerSetSize = 8; + RtsFlags.ProfFlags.ccsLength = 25; RtsFlags.ProfFlags.modSelector = NULL; RtsFlags.ProfFlags.descrSelector = NULL; RtsFlags.ProfFlags.typeSelector = NULL; @@ -369,6 +370,9 @@ usage_text[] = { " -hb... closures with specified biographies (lag,drag,void,use)", "", " -R Set the maximum retainer set size (default: 8)", +"", +" -L Maximum length of a cost-centre stack in a heap profile", +" (default: 25)", "", " -i Time between heap samples (seconds, default: 0.1)", "", @@ -858,7 +862,13 @@ error = rtsTrue; PROFILING_BUILD_ONLY( RtsFlags.ProfFlags.maxRetainerSetSize = atof(rts_argv[arg]+2); ) break; - + case 'L': + PROFILING_BUILD_ONLY( + RtsFlags.ProfFlags.ccsLength = atof(rts_argv[arg]+2); + if(RtsFlags.ProfFlags.ccsLength <= 0) { + bad_option(rts_argv[arg]); + } + ) break; case 'h': /* serial heap profile */ #if !defined(PROFILING) && defined(DEBUG) switch (rts_argv[arg][2]) { -- 1.7.10.4