summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Gamari <bgamari.foss@gmail.com>2017-09-04 08:15:08 -0400
committerBen Gamari <ben@smart-cactus.org>2017-09-05 07:20:01 -0400
commit24e50f988f775c6bba7d1daaee2e23c13650aa3b (patch)
treeab6204b9b3d51c02f4ed6cf06060f707adf88a92
parent822abbb1b4300ebaa3f12014b9fc477261283143 (diff)
downloadhaskell-24e50f988f775c6bba7d1daaee2e23c13650aa3b.tar.gz
rts: Add heap breakdown type for -hT
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
-rw-r--r--docs/users_guide/profiling.rst4
-rw-r--r--includes/rts/EventLogFormat.h1
-rw-r--r--rts/eventlog/EventLog.c2
3 files changed, 7 insertions, 0 deletions
diff --git a/docs/users_guide/profiling.rst b/docs/users_guide/profiling.rst
index 589fbdbded..def3596393 100644
--- a/docs/users_guide/profiling.rst
+++ b/docs/users_guide/profiling.rst
@@ -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
diff --git a/includes/rts/EventLogFormat.h b/includes/rts/EventLogFormat.h
index d7b465a3ac..b3ad52b31e 100644
--- a/includes/rts/EventLogFormat.h
+++ b/includes/rts/EventLogFormat.h
@@ -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)
diff --git a/rts/eventlog/EventLog.c b/rts/eventlog/EventLog.c
index c8b4485be3..619d576b93 100644
--- a/rts/eventlog/EventLog.c
+++ b/rts/eventlog/EventLog.c
@@ -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");
}