diff options
-rw-r--r-- | docs/users_guide/eventlog-formats.rst | 13 | ||||
-rw-r--r-- | docs/users_guide/profiling.rst | 29 | ||||
-rw-r--r-- | includes/rts/EventLogFormat.h | 12 | ||||
-rw-r--r-- | 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 8b1427d7d5..9910d4dbb0 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 ded667581f..589fbdbded 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 f839be04a1..d7b465a3ac 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 ed297b879e..c8b4485be3 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) { |