Commit 822abbb1 authored by Ben Gamari's avatar Ben Gamari Committed by Ben Gamari

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
parent c2881a23
......@@ -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
......
......@@ -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
......
......@@ -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;
......
......@@ -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) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment