[project @ 2003-04-28 09:57:12 by simonmar]
[ghc-hetmet.git] / ghc / includes / StgProf.h
index 46f8491..f6af87f 100644 (file)
@@ -1,5 +1,5 @@
 /* -----------------------------------------------------------------------------
- * $Id: StgProf.h,v 1.11 2001/10/03 13:57:42 simonmar Exp $
+ * $Id: StgProf.h,v 1.16 2001/12/12 14:59:41 simonmar Exp $
  *
  * (c) The GHC Team, 1998
  *
@@ -34,12 +34,13 @@ typedef struct _CostCentreStack {
   CostCentre *cc;
   struct _CostCentreStack *prevStack;
   struct _IndexTable *indexTable;
-  
+
+  unsigned int selected;
+
   unsigned long long scc_count;
-    
+
   unsigned long time_ticks;
   unsigned long long mem_alloc;
-  unsigned long mem_resid;
 
   unsigned long inherited_ticks;
   unsigned long long inherited_alloc;
@@ -52,14 +53,8 @@ typedef struct _CostCentreStack {
  * The rest is PROFILING only...
  * ---------------------------------------------------------------------------*/
 
-#if !defined(PROFILING)
+#if defined(PROFILING)
   
-#define CCS_ALLOC(ccs, amount) doNothing()
-#define ENTER_CC_PAP_CL(r)     doNothing()
-#define ENTER_CCS_PAP_CL(r)    doNothing()
-#else /* PROFILING... */
-
 /* -----------------------------------------------------------------------------
  * Constants
  * ---------------------------------------------------------------------------*/
@@ -72,12 +67,10 @@ typedef struct _CostCentreStack {
 #define CC_IS_CAF      'c'            /* 'c'  => *is* a CAF cc           */
 #define CC_IS_BORING   'B'            /* 'B'  => *not* a CAF/sub cc      */
 
+
 /* -----------------------------------------------------------------------------
- * Data Structures 
- * ---------------------------------------------------------------------------*/  
-/* 
- * IndexTable 
- */
+ * Data Structures
+ * ---------------------------------------------------------------------------*/
 
 typedef struct _IndexTable {
   CostCentre *cc;
@@ -189,10 +182,10 @@ extern CostCentreStack *CCS_LIST;         /* registered CCS list */
            cc                  : cc_ident,                     \
            prevStack           : NULL,                         \
            indexTable          : NULL,                         \
+            selected            : 0,                           \
            scc_count           : 0,                            \
            time_ticks          : 0,                            \
            mem_alloc           : 0,                            \
-           mem_resid           : 0,                            \
            inherited_ticks     : 0,                            \
            inherited_alloc     : 0,                            \
            root                : 0,                            \
@@ -205,8 +198,6 @@ extern CostCentreStack *CCS_LIST;         /* registered CCS list */
  * Time / Allocation Macros
  * ---------------------------------------------------------------------------*/
 
-#define CCS_TICK(ccs)  (ccs)->time_ticks++
-
 /* eliminate profiling overhead from allocation costs */
 #define CCS_ALLOC(ccs, size) (ccs)->mem_alloc += ((size)-sizeofW(StgProfHeader))
 
@@ -357,9 +348,15 @@ extern CostCentreStack *CCS_LIST;         /* registered CCS list */
 #define ENTER_CCS_PAP_CL(closure)  \
         ENTER_CCS_PAP((closure)->header.prof.ccs)
 
- /* temp EW */
-#define STATIC_CCS_REF(ccs) (ccs)
+/* -----------------------------------------------------------------------------
+   When not profiling, these macros do nothing...
+   -------------------------------------------------------------------------- */
+#else /* !PROFILING */
 
+#define CCS_ALLOC(ccs, amount) doNothing()
+#define ENTER_CC_PAP_CL(r)     doNothing()
+#define ENTER_CCS_PAP_CL(r)    doNothing()
 #endif /* PROFILING */
 
 #endif /* STGPROF_H */