[commit: ghc] master: eventlog: Clean up profiling heap breakdown type (822abbb)

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


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

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/822abbb1b4300ebaa3f12014b9fc477261283143/ghc

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

commit 822abbb1b4300ebaa3f12014b9fc477261283143
Author: Ben Gamari <bgamari.foss at gmail.com>
Date:   Mon Sep 4 08:14:38 2017 -0400

    eventlog: Clean up profiling heap breakdown type
    
    Reviewers: austin, erikd, simonmar
    
    Subscribers: rwbarton, thomie
    
    GHC Trac Issues: #14096
    
    Differential Revision: https://phabricator.haskell.org/D3923


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

822abbb1b4300ebaa3f12014b9fc477261283143
 docs/users_guide/eventlog-formats.rst | 13 +++++++------
 docs/users_guide/profiling.rst        | 29 +++++++++++++++--------------
 includes/rts/EventLogFormat.h         | 12 ++++++++++++
 rts/eventlog/EventLog.c               |  9 ---------
 4 files changed, 34 insertions(+), 29 deletions(-)

diff --git a/docs/users_guide/eventlog-formats.rst b/docs/users_guide/eventlog-formats.rst
index 8b1427d..9910d4d 100644
--- a/docs/users_guide/eventlog-formats.rst
+++ b/docs/users_guide/eventlog-formats.rst
@@ -33,12 +33,13 @@ A single fixed-width event emitted during program start-up describing the sample
    * ``Word64``: Sampling period in nanoseconds
    * ``Word32``: Sample break-down type. One of,
 
-      * ``SAMPLE_TYPE_COST_CENTER`` (output from ``-hc``)
-      * ``SAMPLE_TYPE_CLOSURE_DESCR`` (output from ``-hd``)
-      * ``SAMPLE_TYPE_RETAINER`` (output from ``-hr``)
-      * ``SAMPLE_TYPE_MODULE`` (output from ``-hm``)
-      * ``SAMPLE_TYPE_TYPE_DESCR`` (output from ``-hy``)
-      * ``SAMPLE_TYPE_BIOGRAPHY`` (output from ``-hb``)
+      * ``HEAP_PROF_BREAKDOWN_COST_CENTER`` (output from :rts-flag:`-hc`)
+      * ``HEAP_PROF_BREAKDOWN_CLOSURE_DESCR`` (output from :rts-flag:`-hd`)
+      * ``HEAP_PROF_BREAKDOWN_RETAINER`` (output from :rts-flag:`-hr`)
+      * ``HEAP_PROF_BREAKDOWN_MODULE`` (output from :rts-flag:`-hm`)
+      * ``HEAP_PROF_BREAKDOWN_TYPE_DESCR`` (output from :rts-flag:`-hy`)
+      * ``HEAP_PROF_BREAKDOWN_BIOGRAPHY`` (output from :rts-flag:`-hb`)
+      * ``HEAP_PROF_BREAKDOWN_CLOSURE_TYPE`` (output from :rts-flag:`-hT`)
 
    * ``String``: Module filter
    * ``String``: Closure description filter
diff --git a/docs/users_guide/profiling.rst b/docs/users_guide/profiling.rst
index ded6675..589fbdb 100644
--- a/docs/users_guide/profiling.rst
+++ b/docs/users_guide/profiling.rst
@@ -690,35 +690,36 @@ following RTS options select which break-down to use:
 .. rts-flag:: -hc
               -h
 
-    (can be shortened to :rts-flag:`-h`). Breaks down the graph by the
-    cost-centre stack which produced the data.
+    *Requires :ghc-flag:`-prof`.* Breaks down the graph by the cost-centre stack
+    which produced the data.
 
 .. rts-flag:: -hm
 
-    Break down the live heap by the module containing the code which
-    produced the data.
+    *Requires :ghc-flag:`-prof`.* Break down the live heap by the module
+    containing the code which produced the data.
 
 .. rts-flag:: -hd
 
-    Breaks down the graph by closure description. For actual data, the
-    description is just the constructor name, for other closures it is a
-    compiler-generated string identifying the closure.
+    *Requires :ghc-flag:`-prof`.* Breaks down the graph by closure description.
+    For actual data, the description is just the constructor name, for other
+    closures it is a compiler-generated string identifying the closure.
 
 .. rts-flag:: -hy
 
-    Breaks down the graph by type. For closures which have function type
-    or unknown/polymorphic type, the string will represent an
-    approximation to the actual type.
+    *Requires :ghc-flag:`-prof`.* Breaks down the graph by type. For closures
+    which have function type or unknown/polymorphic type, the string will
+    represent an approximation to the actual type.
 
 .. rts-flag:: -hr
 
-    Break down the graph by retainer set. Retainer profiling is
-    described in more detail below (:ref:`retainer-prof`).
+    *Requires :ghc-flag:`-prof`.* Break down the graph by retainer set. Retainer
+    profiling is described in more detail below (:ref:`retainer-prof`).
 
 .. rts-flag:: -hb
 
-    Break down the graph by biography. Biographical profiling is
-    described in more detail below (:ref:`biography-prof`).
+    *Requires :ghc-flag:`-prof`.* Break down the graph by biography.
+    Biographical profiling is described in more detail below
+    (:ref:`biography-prof`).
 
 .. rts-flag:: -l
 
diff --git a/includes/rts/EventLogFormat.h b/includes/rts/EventLogFormat.h
index f839be0..d7b465a 100644
--- a/includes/rts/EventLogFormat.h
+++ b/includes/rts/EventLogFormat.h
@@ -231,6 +231,18 @@
 #define CAPSET_TYPE_OSPROCESS   2  /* caps belong to the same OS process */
 #define CAPSET_TYPE_CLOCKDOMAIN 3  /* caps share a local clock/time      */
 
+/*
+ * Heap profile breakdown types. See EVENT_HEAP_PROF_BEGIN.
+ */
+typedef enum {
+    HEAP_PROF_BREAKDOWN_COST_CENTRE = 0x1,
+    HEAP_PROF_BREAKDOWN_MODULE,
+    HEAP_PROF_BREAKDOWN_CLOSURE_DESCR,
+    HEAP_PROF_BREAKDOWN_TYPE_DESCR,
+    HEAP_PROF_BREAKDOWN_RETAINER,
+    HEAP_PROF_BREAKDOWN_BIOGRAPHY,
+} HeapProfBreakdown;
+
 #if !defined(EVENTLOG_CONSTANTS_ONLY)
 
 typedef StgWord16 EventTypeNum;
diff --git a/rts/eventlog/EventLog.c b/rts/eventlog/EventLog.c
index ed297b8..c8b4485 100644
--- a/rts/eventlog/EventLog.c
+++ b/rts/eventlog/EventLog.c
@@ -1094,15 +1094,6 @@ void postBlockMarker (EventsBuf *eb)
     postCapNo(eb, eb->capno);
 }
 
-typedef enum {
-    HEAP_PROF_BREAKDOWN_COST_CENTRE = 0x1,
-    HEAP_PROF_BREAKDOWN_MODULE,
-    HEAP_PROF_BREAKDOWN_CLOSURE_DESCR,
-    HEAP_PROF_BREAKDOWN_TYPE_DESCR,
-    HEAP_PROF_BREAKDOWN_RETAINER,
-    HEAP_PROF_BREAKDOWN_BIOGRAPHY,
-} HeapProfBreakdown;
-
 static HeapProfBreakdown getHeapProfBreakdown(void)
 {
     switch (RtsFlags.ProfFlags.doHeapProfile) {



More information about the ghc-commits mailing list