From ed6629013b91f782953b4aa5db2854647e3eae97 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Gr=C3=B6ber?= Date: Thu, 4 Jul 2019 06:49:15 +0200 Subject: rts: Fix -hT option with profiling rts In dumpCensus we switch/case on doHeapProfile twice. The second switch tries to barf on unknown doHeapProfile modes but HEAP_BY_CLOSURE_TYPE is checked by the first switch and not included in the second. So when trying to pass -hT to the profiling rts it barfs. This commit simply merges the two switches into one which fixes this problem. --- rts/ProfHeap.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'rts/ProfHeap.c') diff --git a/rts/ProfHeap.c b/rts/ProfHeap.c index 6a2c23d1e1..b63bc527ef 100644 --- a/rts/ProfHeap.c +++ b/rts/ProfHeap.c @@ -836,10 +836,7 @@ dumpCensus( Census *census ) traceHeapProfSampleString(0, (char *)ctr->identity, count * sizeof(W_)); break; - } - #if defined(PROFILING) - switch (RtsFlags.ProfFlags.doHeapProfile) { case HEAP_BY_CCS: fprint_ccs(hp_file, (CostCentreStack *)ctr->identity, RtsFlags.ProfFlags.ccsLength); @@ -876,10 +873,10 @@ dumpCensus( Census *census ) printRetainerSetShort(hp_file, rs, RtsFlags.ProfFlags.ccsLength); break; } +#endif default: barf("dumpCensus; doHeapProfile"); } -#endif fprintf(hp_file, "\t%" FMT_Word "\n", (W_)count * sizeof(W_)); } -- cgit v1.2.1