X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc%2Fincludes%2FStgTicky.h;h=fdef66868fc665d43ba1958e6ebedca43ab4e3d0;hb=f0f6913272d9475a6ac1b2a3cc59105c5756fba3;hp=6220774efb1e6f0f37349faebeb2f16ddb270842;hpb=5c67176de89fee19a02056216a7c58579e765148;p=ghc-hetmet.git diff --git a/ghc/includes/StgTicky.h b/ghc/includes/StgTicky.h index 6220774..fdef668 100644 --- a/ghc/includes/StgTicky.h +++ b/ghc/includes/StgTicky.h @@ -1,5 +1,5 @@ /* ---------------------------------------------------------------------------- - * $Id: StgTicky.h,v 1.7 1999/10/13 16:39:21 simonmar Exp $ + * $Id: StgTicky.h,v 1.12 2002/04/09 11:00:11 njn Exp $ * * (c) The AQUA project, Glasgow University, 1994-1997 * (c) The GHC Team, 1998-1999 @@ -135,17 +135,18 @@ #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 */ +#define TICK_ENT_STATIC_THK() ENT_STATIC_THK_ctr++ +#define TICK_ENT_DYN_THK() ENT_DYN_THK_ctr++ 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,9 +155,20 @@ typedef struct _StgEntCounter { static StgEntCounter f_ct \ = { 0, arity, args, \ str, arg_kinds, \ - 0, 0, NULL }; + 0, 0, 0, NULL }; -#define TICK_ENT_FUN_DIRECT(f_ct) \ +/* 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_STATIC_FUN_STD(f_ct) \ + f_ct.slow_entry_count++; \ + ENT_STATIC_FUN_STD_ctr++ /* The static total one */ + +#define TICK_ENT_DYN_FUN_STD(f_ct) \ + f_ct.slow_entry_count++; \ + ENT_DYN_FUN_STD_ctr++ /* The dynamic total one */ + +#define TICK_ENT_FUN_DIRECT_BODY(f_ct) \ { \ if ( ! f_ct.registeredp ) { \ /* hook this one onto the front of the list */ \ @@ -165,15 +177,24 @@ 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 */ + +#define TICK_ENT_STATIC_FUN_DIRECT(f_ct) \ + TICK_ENT_FUN_DIRECT_BODY(f_ct) \ + ENT_STATIC_FUN_DIRECT_ctr++ /* The static total one */ + +#define TICK_ENT_DYN_FUN_DIRECT(f_ct) \ + TICK_ENT_FUN_DIRECT_BODY(f_ct) \ + ENT_DYN_FUN_DIRECT_ctr++ /* The dynamic total one */ extern StgEntCounter top_ct; extern StgEntCounter *ticky_entry_ctrs; -#define TICK_ENT_CON(n) ENT_CON_ctr++ /* enter constructor */ -#define TICK_ENT_IND(n) ENT_IND_ctr++ /* enter indirection */ +#define TICK_ENT_STATIC_CON(n) ENT_STATIC_CON_ctr++ /* enter static constructor */ +#define TICK_ENT_DYN_CON(n) ENT_DYN_CON_ctr++ /* enter dynamic constructor */ +#define TICK_ENT_STATIC_IND(n) ENT_STATIC_IND_ctr++ /* enter static indirection */ +#define TICK_ENT_DYN_IND(n) ENT_DYN_IND_ctr++ /* enter dynamic indirection */ #define TICK_ENT_PERM_IND(n) ENT_PERM_IND_ctr++ /* enter permanent indirection */ #define TICK_ENT_PAP(n) ENT_PAP_ctr++ /* enter PAP */ #define TICK_ENT_AP_UPD(n) ENT_AP_UPD_ctr++ /* enter AP_UPD */ @@ -455,11 +476,16 @@ EXTERN unsigned long ALLOC_BF_hst[5] #endif EXTERN unsigned long ENT_VIA_NODE_ctr INIT(0); -EXTERN unsigned long ENT_THK_ctr INIT(0); -EXTERN unsigned long ENT_FUN_STD_ctr INIT(0); -EXTERN unsigned long ENT_FUN_DIRECT_ctr INIT(0); -EXTERN unsigned long ENT_CON_ctr INIT(0); -EXTERN unsigned long ENT_IND_ctr INIT(0); +EXTERN unsigned long ENT_STATIC_THK_ctr INIT(0); +EXTERN unsigned long ENT_DYN_THK_ctr INIT(0); +EXTERN unsigned long ENT_STATIC_FUN_STD_ctr INIT(0); +EXTERN unsigned long ENT_DYN_FUN_STD_ctr INIT(0); +EXTERN unsigned long ENT_STATIC_FUN_DIRECT_ctr INIT(0); +EXTERN unsigned long ENT_DYN_FUN_DIRECT_ctr INIT(0); +EXTERN unsigned long ENT_STATIC_CON_ctr INIT(0); +EXTERN unsigned long ENT_DYN_CON_ctr INIT(0); +EXTERN unsigned long ENT_STATIC_IND_ctr INIT(0); +EXTERN unsigned long ENT_DYN_IND_ctr INIT(0); EXTERN unsigned long ENT_PERM_IND_ctr INIT(0); EXTERN unsigned long ENT_PAP_ctr INIT(0); EXTERN unsigned long ENT_AP_UPD_ctr INIT(0); @@ -559,7 +585,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) @@ -577,12 +604,17 @@ 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_DIRECT(n) +#define TICK_ENT_STATIC_THK() +#define TICK_ENT_DYN_THK() +#define TICK_ENT_STATIC_FUN_STD(n) +#define TICK_ENT_DYN_FUN_STD(n) +#define TICK_ENT_STATIC_FUN_DIRECT(n) +#define TICK_ENT_DYN_FUN_DIRECT(n) -#define TICK_ENT_CON(n) -#define TICK_ENT_IND(n) +#define TICK_ENT_STATIC_CON(n) +#define TICK_ENT_DYN_CON(n) +#define TICK_ENT_STATIC_IND(n) +#define TICK_ENT_DYN_IND(n) #define TICK_ENT_PERM_IND(n) #define TICK_ENT_PAP(n) #define TICK_ENT_AP_UPD(n)