[commit: ghc] ghc-8.2: rts: Add heap breakdown type for -hT (3b2fc86)

git at git.haskell.org git at git.haskell.org
Tue Sep 19 21:10:53 UTC 2017


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

On branch  : ghc-8.2
Link       : http://ghc.haskell.org/trac/ghc/changeset/3b2fc86a2804424eafbad5ce51ce80ed8c0a4257/ghc

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

commit 3b2fc86a2804424eafbad5ce51ce80ed8c0a4257
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
    
    (cherry picked from commit 24e50f988f775c6bba7d1daaee2e23c13650aa3b)


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

3b2fc86a2804424eafbad5ce51ce80ed8c0a4257
 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 8cf6bcb..bd56358 100644
--- a/docs/users_guide/profiling.rst
+++ b/docs/users_guide/profiling.rst
@@ -657,6 +657,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 05ce50a..f47e3ea 100644
--- a/includes/rts/EventLogFormat.h
+++ b/includes/rts/EventLogFormat.h
@@ -240,6 +240,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 b3af25d..b82f578 100644
--- a/rts/eventlog/EventLog.c
+++ b/rts/eventlog/EventLog.c
@@ -1134,6 +1134,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