From a9bc54766ddd1bdb011f1656ad58fb409055d08f Mon Sep 17 00:00:00 2001 From: Ben Gamari Date: Thu, 16 Jun 2016 15:03:01 +0200 Subject: Log heap profiler samples to event log Test Plan: Try it Reviewers: hvr, simonmar, austin, erikd Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1722 GHC Trac Issues: #11094 --- includes/rts/Config.h | 8 ++++++-- includes/rts/EventLogFormat.h | 11 ++++++++--- 2 files changed, 14 insertions(+), 5 deletions(-) (limited to 'includes/rts') diff --git a/includes/rts/Config.h b/includes/rts/Config.h index 043bf2deb4..51ee74fdb8 100644 --- a/includes/rts/Config.h +++ b/includes/rts/Config.h @@ -27,12 +27,16 @@ #define USING_LIBBFD 1 #endif -/* DEBUG implies TRACING and TICKY_TICKY - */ +/* DEBUG implies TRACING and TICKY_TICKY */ #if defined(DEBUG) +#if !defined(TRACING) #define TRACING +#endif +#if !defined(TICKY_TICKY) #define TICKY_TICKY #endif +#endif + /* ----------------------------------------------------------------------------- Signals - supported on non-PAR versions of the runtime. See RtsSignals.h. diff --git a/includes/rts/EventLogFormat.h b/includes/rts/EventLogFormat.h index 68d0d08f55..d6838abd8a 100644 --- a/includes/rts/EventLogFormat.h +++ b/includes/rts/EventLogFormat.h @@ -163,8 +163,6 @@ #define EVENT_USER_MARKER 58 /* (marker_name) */ #define EVENT_HACK_BUG_T9003 59 /* Hack: see trac #9003 */ -/* Range 59 - 59 is available for new GHC and common events. */ - /* Range 60 - 80 is used by eden for parallel tracing * see http://www.mathematik.uni-marburg.de/~eden/ */ @@ -173,12 +171,19 @@ /* Range 140 - 159 is reserved for Perf events. */ +/* Range 160 - 180 is reserved for cost-centre heap profiling events. */ + +#define EVENT_HEAP_PROF_BEGIN 160 +#define EVENT_HEAP_PROF_COST_CENTRE 161 +#define EVENT_HEAP_PROF_SAMPLE_BEGIN 162 +#define EVENT_HEAP_PROF_SAMPLE_COST_CENTRE 163 +#define EVENT_HEAP_PROF_SAMPLE_STRING 164 /* * The highest event code +1 that ghc itself emits. Note that some event * ranges higher than this are reserved but not currently emitted by ghc. * This must match the size of the EventDesc[] array in EventLog.c */ -#define NUM_GHC_EVENT_TAGS 60 +#define NUM_GHC_EVENT_TAGS 165 #if 0 /* DEPRECATED EVENTS: */ /* we don't actually need to record the thread, it's implicit */ -- cgit v1.2.1