[commit: ghc] ghc-8.2: eventlog: Clean up profiling heap breakdown type (4636799)
git at git.haskell.org
git at git.haskell.org
Tue Sep 19 21:10:50 UTC 2017
Repository : ssh://git@git.haskell.org/ghc
On branch : ghc-8.2
Link : http://ghc.haskell.org/trac/ghc/changeset/46367997b8fab50d442cad0ba75d13340afc8d6b/ghc
>---------------------------------------------------------------
commit 46367997b8fab50d442cad0ba75d13340afc8d6b
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
(cherry picked from commit 822abbb1b4300ebaa3f12014b9fc477261283143)
>---------------------------------------------------------------
46367997b8fab50d442cad0ba75d13340afc8d6b
docs/users_guide/eventlog-formats.rst | 13 +++++++------
docs/users_guide/profiling.rst | 29 +++++++++++++++--------------
includes/rts/EventLogFormat.h | 19 ++++++++++++++-----
rts/eventlog/EventLog.c | 9 ---------
4 files changed, 36 insertions(+), 34 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 4107db2..8cf6bcb 100644
--- a/docs/users_guide/profiling.rst
+++ b/docs/users_guide/profiling.rst
@@ -660,35 +660,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 d6838ab..05ce50a 100644
--- a/includes/rts/EventLogFormat.h
+++ b/includes/rts/EventLogFormat.h
@@ -73,8 +73,7 @@
*
* -------------------------------------------------------------------------- */
-#ifndef RTS_EVENTLOGFORMAT_H
-#define RTS_EVENTLOGFORMAT_H
+#pragma once
/*
* Markers for begin/end of the Header.
@@ -231,7 +230,19 @@
#define CAPSET_TYPE_OSPROCESS 2 /* caps belong to the same OS process */
#define CAPSET_TYPE_CLOCKDOMAIN 3 /* caps share a local clock/time */
-#ifndef EVENTLOG_CONSTANTS_ONLY
+/*
+ * 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;
typedef StgWord64 EventTimestamp; /* in nanoseconds */
@@ -245,5 +256,3 @@ typedef StgWord64 EventTaskId; /* for EVENT_TASK_* */
typedef StgWord64 EventKernelThreadId; /* for EVENT_TASK_CREATE */
#endif
-
-#endif /* RTS_EVENTLOGFORMAT_H */
diff --git a/rts/eventlog/EventLog.c b/rts/eventlog/EventLog.c
index ce4cb38..b3af25d 100644
--- a/rts/eventlog/EventLog.c
+++ b/rts/eventlog/EventLog.c
@@ -1119,15 +1119,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