[project @ 2001-08-03 17:03:48 by sof]
[ghc-hetmet.git] / ghc / includes / StgTicky.h
index 6220774..ee9d5d7 100644 (file)
@@ -1,5 +1,5 @@
 /* ----------------------------------------------------------------------------
- * $Id: StgTicky.h,v 1.7 1999/10/13 16:39:21 simonmar Exp $
+ * $Id: StgTicky.h,v 1.10 2000/08/07 23:37:23 qrczak Exp $
  *
  * (c) The AQUA project, Glasgow University, 1994-1997
  * (c) The GHC Team, 1998-1999
 #define TICK_ENT_VIA_NODE()    ENT_VIA_NODE_ctr++
 
 #define TICK_ENT_THK()         ENT_THK_ctr++         /* thunk */
-#define TICK_ENT_FUN_STD()     ENT_FUN_STD_ctr++     /* std entry pt */
 
 typedef struct _StgEntCounter {
     unsigned   registeredp:16, /* 0 == no, 1 == yes */
                arity:16,       /* arity (static info) */
                stk_args:16;    /* # of args off stack */
                                /* (rest of args are in registers) */
-    StgChar    *str;           /* name of the thing */
-    StgChar    *arg_kinds;     /* info about the args types */
-    I_         ctr;            /* the actual counter */
+    char       *str;           /* name of the thing */
+    char       *arg_kinds;     /* info about the args types */
+    I_         entry_count;      /* Trips to fast entry code */
+    I_         slow_entry_count; /* Trips to slow entry code */
     I_          allocs;         /* number of allocations by this fun */
     struct _StgEntCounter *link;/* link to chain them all together */
 } StgEntCounter;
@@ -154,7 +154,14 @@ typedef struct _StgEntCounter {
    static StgEntCounter f_ct                   \
        = { 0, arity, args,                     \
            str, arg_kinds,                     \
-           0, 0, NULL };
+           0, 0, 0, NULL };
+
+/* The slow entry point for a function always goes to
+   the fast entry point, which will register the stats block,
+   so no need to do so here */
+#define TICK_ENT_FUN_STD(f_ct)                                 \
+        f_ct.slow_entry_count++;                                \
+        ENT_FUN_STD_ctr++     /* The total one */
 
 #define TICK_ENT_FUN_DIRECT(f_ct)                              \
        {                                                       \
@@ -165,9 +172,9 @@ typedef struct _StgEntCounter {
            /* mark it as "registered" */                       \
            f_ct.registeredp = 1;                               \
          }                                                     \
-         f_ct.ctr += 1;                                        \
+         f_ct.entry_count += 1;                                \
        }                                                       \
-       ENT_FUN_DIRECT_ctr++ /* the old boring one */
+       ENT_FUN_DIRECT_ctr++ /* The total one */
 
 extern StgEntCounter top_ct;
 extern StgEntCounter *ticky_entry_ctrs;
@@ -559,7 +566,8 @@ EXTERN unsigned long GC_WORDS_COPIED_ctr INIT(0);
 
 #else /* !TICKY_TICKY */
 
-#define TICK_ALLOC_HEAP(words)
+#define TICK_ALLOC_HEAP(words, f_ct)
+#define TICK_ALLOC_HEAP_NOCTR(words)
 
 #define TICK_ALLOC_FUN(g,s)
 #define TICK_ALLOC_UP_THK(g,s)
@@ -578,7 +586,7 @@ EXTERN unsigned long GC_WORDS_COPIED_ctr INIT(0);
 #define TICK_ENT_VIA_NODE()    
                                
 #define TICK_ENT_THK()
-#define TICK_ENT_FUN_STD()
+#define TICK_ENT_FUN_STD(n)
 #define TICK_ENT_FUN_DIRECT(n)
                                
 #define TICK_ENT_CON(n)