rts: Add heap breakdown type for -hT
authorBen Gamari <bgamari.foss@gmail.com>
Mon, 4 Sep 2017 12:15:08 +0000 (08:15 -0400)
committerBen Gamari <ben@smart-cactus.org>
Tue, 5 Sep 2017 11:20:01 +0000 (07:20 -0400)
Test Plan: Build, program with `-eventlog`, try running with `+RTS -h`

Reviewers: austin, erikd, simonmar

Subscribers: rwbarton, thomie

GHC Trac Issues: #14096

Differential Revision: https://phabricator.haskell.org/D3922

docs/users_guide/profiling.rst
includes/rts/EventLogFormat.h
rts/eventlog/EventLog.c

index 589fbdb..def3596 100644 (file)
@@ -687,6 +687,10 @@ All the different profile types yield a graph of live heap against time,
 but they differ in how the live heap is broken down into bands. The
 following RTS options select which break-down to use:
 
+.. rts-flag:: -hT
+
+    Breaks down the graph by heap closure type.
+
 .. rts-flag:: -hc
               -h
 
index d7b465a..b3ad52b 100644 (file)
@@ -241,6 +241,7 @@ typedef enum {
     HEAP_PROF_BREAKDOWN_TYPE_DESCR,
     HEAP_PROF_BREAKDOWN_RETAINER,
     HEAP_PROF_BREAKDOWN_BIOGRAPHY,
+    HEAP_PROF_BREAKDOWN_CLOSURE_TYPE,
 } HeapProfBreakdown;
 
 #if !defined(EVENTLOG_CONSTANTS_ONLY)
index c8b4485..619d576 100644 (file)
@@ -1109,6 +1109,8 @@ static HeapProfBreakdown getHeapProfBreakdown(void)
         return HEAP_PROF_BREAKDOWN_RETAINER;
     case HEAP_BY_LDV:
         return HEAP_PROF_BREAKDOWN_BIOGRAPHY;
+    case HEAP_BY_CLOSURE_TYPE:
+        return HEAP_PROF_BREAKDOWN_CLOSURE_TYPE;
     default:
         barf("getHeapProfBreakdown: unknown heap profiling mode");
     }