From 90c6cd0e5b6ee9a9d34b9404a38cf0cf2433ffe4 Mon Sep 17 00:00:00 2001 From: simonpj Date: Thu, 11 Nov 1999 17:50:49 +0000 Subject: [PATCH] [project @ 1999-11-11 17:50:47 by simonpj] Report slow-entry counts in ticky-ticky --- ghc/compiler/codeGen/CgClosure.lhs | 6 ++++-- ghc/includes/StgTicky.h | 21 ++++++++++++++------- ghc/rts/Ticky.c | 13 +++++++------ 3 files changed, 25 insertions(+), 15 deletions(-) diff --git a/ghc/compiler/codeGen/CgClosure.lhs b/ghc/compiler/codeGen/CgClosure.lhs index 38c88dd..c40320c 100644 --- a/ghc/compiler/codeGen/CgClosure.lhs +++ b/ghc/compiler/codeGen/CgClosure.lhs @@ -1,7 +1,7 @@ % % (c) The GRASP/AQUA Project, Glasgow University, 1992-1998 % -% $Id: CgClosure.lhs,v 1.37 1999/11/02 15:05:43 simonmar Exp $ +% $Id: CgClosure.lhs,v 1.38 1999/11/11 17:50:49 simonpj Exp $ % \section[CgClosure]{Code generation for closures} @@ -342,7 +342,9 @@ closureCodeBody binder_info closure_info cc all_args body --slow_entry_code = forceHeapCheck [] True slow_entry_code' slow_entry_code - = profCtrC SLIT("TICK_ENT_FUN_STD") [] `thenC` + = profCtrC SLIT("TICK_ENT_FUN_STD") [ + CLbl ticky_ctr_label DataPtrRep + ] `thenC` -- Bind args, and record expected position of stk ptrs mapCs bindNewToStack arg_offsets `thenC` diff --git a/ghc/includes/StgTicky.h b/ghc/includes/StgTicky.h index c711fd7..b508e8a 100644 --- a/ghc/includes/StgTicky.h +++ b/ghc/includes/StgTicky.h @@ -1,5 +1,5 @@ /* ---------------------------------------------------------------------------- - * $Id: StgTicky.h,v 1.8 1999/10/14 13:12:22 simonmar Exp $ + * $Id: StgTicky.h,v 1.9 1999/11/11 17:50:47 simonpj Exp $ * * (c) The AQUA project, Glasgow University, 1994-1997 * (c) The GHC Team, 1998-1999 @@ -136,7 +136,6 @@ #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 */ @@ -145,7 +144,8 @@ typedef struct _StgEntCounter { /* (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 */ + 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; @@ -579,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) diff --git a/ghc/rts/Ticky.c b/ghc/rts/Ticky.c index f4244e3..c8ccdbb 100644 --- a/ghc/rts/Ticky.c +++ b/ghc/rts/Ticky.c @@ -1,5 +1,5 @@ /* ----------------------------------------------------------------------------- - * $Id: Ticky.c,v 1.11 1999/10/14 13:44:55 simonpj Exp $ + * $Id: Ticky.c,v 1.12 1999/11/11 17:50:48 simonpj Exp $ * * (c) The AQUA project, Glasgow University, 1992-1997 * (c) The GHC Team, 1998-1999 @@ -550,14 +550,15 @@ printRegisteredCounterInfo (FILE *tf) if ( ticky_entry_ctrs != NULL ) { fprintf(tf,"\n**************************************************\n\n"); } - fprintf(tf, "%-11s%-11s %6s%6s %-16s%-30s\n", - "Entries", "Allocs", "Arity", "Stack", "Kinds", "Function"); + fprintf(tf, "%11s%11s%11s %6s%6s %-11s%-30s\n", + "Entries", "Slow ent", "Allocs", "Arity", "Stack", "Kinds", "Function"); fprintf(tf, "--------------------------------------------------------------------------------\n"); /* Function name at the end so it doesn't mess up the tabulation */ for (p = ticky_entry_ctrs; p != NULL; p = p->link) { - fprintf(tf, "%11ld%11ld%6u%6u %-11s%-30s", - p->ctr, + fprintf(tf, "%11ld%11ld%11ld %6u%6u %-11s%-30s", + p->entry_count, + p->slow_entry_count, p->allocs, p->arity, p->stk_args, @@ -575,7 +576,7 @@ printRegisteredCounterInfo (FILE *tf) StgEntCounter top_ct = { 0, 0, 0, "TOP", "", - 0, 0, NULL }; + 0, 0, 0, NULL }; #endif /* TICKY_TICKY */ -- 1.7.10.4