[commit: ghc] master: rts: Add heap breakdown type for -hT (24e50f9)

git at git.haskell.org git at git.haskell.org
Tue Sep 5 11:22:32 UTC 2017


Repository : ssh://git@git.haskell.org/ghc

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/24e50f988f775c6bba7d1daaee2e23c13650aa3b/ghc

>---------------------------------------------------------------

commit 24e50f988f775c6bba7d1daaee2e23c13650aa3b
Author: Ben Gamari <bgamari.foss at gmail.com>
Date:   Mon Sep 4 08:15:08 2017 -0400

    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


>---------------------------------------------------------------

24e50f988f775c6bba7d1daaee2e23c13650aa3b
 docs/users_guide/profiling.rst | 4 ++++
 includes/rts/EventLogFormat.h  | 1 +
 rts/eventlog/EventLog.c        | 2 ++
 3 files changed, 7 insertions(+)

diff --git a/docs/users_guide/profiling.rst b/docs/users_guide/profiling.rst
index 589fbdb..def3596 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 d7b465a..b3ad52b 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 c8b4485..619d576 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");
     }



More information about the ghc-commits mailing list