Commit ec48c5ab authored by simonm's avatar simonm

[project @ 1999-01-21 10:31:41 by simonm]

Resurrect ticky-ticky profiling.  Not quite polished yet, but it
compiles and produces some reasonable-looking stats.
parent e40c2d73
%
% (c) The GRASP/AQUA Project, Glasgow University, 1992-1998
%
% $Id: CgClosure.lhs,v 1.22 1999/01/15 15:57:36 simonm Exp $
% $Id: CgClosure.lhs,v 1.23 1999/01/21 10:31:55 simonm Exp $
%
\section[CgClosure]{Code generation for closures}
......@@ -371,12 +371,15 @@ closureCodeBody binder_info srt closure_info cc all_args body
fast_entry_code
= profCtrC SLIT("TICK_ENT_FUN_DIRECT") [
CLbl (mkRednCountsLabel name) PtrRep,
mkIntCLit stg_arity -- total # of args
{- CLbl (mkRednCountsLabel name) PtrRep,
CString (_PK_ (showSDoc (ppr name))),
mkIntCLit stg_arity, -- total # of args
mkIntCLit sp_stk_args, -- # passed on stk
CString (_PK_ (map (showTypeCategory . idType) all_args)),
CString SLIT(""), CString SLIT("")
-}
-- Nuked for now; see comment at end of file
-- CString (_PK_ (show_wrapper_name wrapper_maybe)),
......
......@@ -344,6 +344,7 @@ cgReturnDataCon con amodes all_zero_size_args
ASSERT(not (isUnboxedTupleCon con))
buildDynCon binder currentCCS con amodes all_zero_size_args
`thenFC` \ idinfo ->
profCtrC SLIT("TICK_RET_NEW") [mkIntCLit (length amodes)] `thenC`
idInfoToAmode PtrRep idinfo `thenFC` \ amode ->
performReturn (move_to_reg amode node) jump_to_join_point
......@@ -361,6 +362,9 @@ cgReturnDataCon con amodes all_zero_size_args
let (ret_regs, leftovers) =
assignRegs [] (map getAmodeRep amodes)
in
profCtrC SLIT("TICK_RET_UNBOXED_TUP")
[mkIntCLit (length amodes)] `thenC`
doTailCall amodes ret_regs
mkUnboxedTupleReturnCode
(length leftovers) {- fast args arity -}
......@@ -385,7 +389,7 @@ cgReturnDataCon con amodes all_zero_size_args
-- RETURN
profCtrC SLIT("TICK_RET_CON") [mkIntCLit (length amodes)] `thenC`
profCtrC SLIT("TICK_RET_NEW") [mkIntCLit (length amodes)] `thenC`
-- could use doTailCall here.
performReturn (move_to_reg amode node)
(mkStaticAlgReturnCode con)
......
%
% (c) The GRASP/AQUA Project, Glasgow University, 1992-1998
%
% $Id: CgHeapery.lhs,v 1.11 1998/12/18 17:40:51 simonpj Exp $
% $Id: CgHeapery.lhs,v 1.12 1999/01/21 10:31:56 simonm Exp $
%
\section[CgHeapery]{Heap management functions}
\begin{code}
module CgHeapery (
fastEntryChecks, altHeapCheck, thunkChecks,
allocHeap, allocDynClosure
allocDynClosure
-- new functions, basically inserting macro calls into Code -- HWL
,fetchAndReschedule, yield
......@@ -436,10 +436,8 @@ allocDynClosure closure_info use_cc blame_cc amodes_with_offsets
in
-- SAY WHAT WE ARE ABOUT TO DO
profCtrC (allocProfilingMsg closure_info)
[mkIntCLit fixedHdrSize,
mkIntCLit (closureGoodStuffSize closure_info),
mkIntCLit slop_size,
mkIntCLit closure_size] `thenC`
[mkIntCLit (closureGoodStuffSize closure_info),
mkIntCLit slop_size] `thenC`
-- GENERATE THE CODE
absC ( mkAbstractCs (
......@@ -468,27 +466,3 @@ cInitHdr closure_info amode cc
| otherwise = CInitHdr closure_info amode (panic "absent cc")
\end{code}
%************************************************************************
%* *
\subsection{Allocate uninitialized heap space}
%* *
%************************************************************************
\begin{code}
allocHeap :: HeapOffset -- Size of the space required
-> FCode CAddrMode -- Addr mode for first word of object
allocHeap space
= getVirtAndRealHp `thenFC` \ (virtHp, realHp) ->
let block_start = virtHp + 1
in
-- We charge the allocation to "PRIM" (which is probably right)
profCtrC SLIT("ALLOC_PRIM2") [mkIntCLit space] `thenC`
-- BUMP THE VIRTUAL HEAP POINTER
setVirtHp (virtHp + space) `thenC`
-- RETURN PTR TO START OF OBJECT
returnFC (CAddr (hpRel realHp block_start))
\end{code}
%
% (c) The GRASP/AQUA Project, Glasgow University, 1992-1998
%
% $Id: CgTailCall.lhs,v 1.17 1998/12/18 17:40:53 simonpj Exp $
% $Id: CgTailCall.lhs,v 1.18 1999/01/21 10:31:57 simonm Exp $
%
%********************************************************
%* *
......@@ -307,6 +307,8 @@ returnUnboxedTuple amodes before_jump
let (ret_regs, leftovers) = assignRegs [] (map getAmodeRep amodes)
in
profCtrC SLIT("TICK_RET_UNBOXED_TUP") [mkIntCLit (length amodes)] `thenC`
doTailCall amodes ret_regs
mkUnboxedTupleReturnCode
(length leftovers) {- fast args arity -}
......
/* ----------------------------------------------------------------------------
* $Id: Constants.h,v 1.2 1998/12/02 13:21:03 simonm Exp $
* $Id: Constants.h,v 1.3 1999/01/21 10:31:41 simonm Exp $
*
* Constants
*
......@@ -21,7 +21,7 @@
#define STD_HDR_SIZE 1
#define PROF_HDR_SIZE 1
#define GRAN_HDR_SIZE 1
#define TICKY_HDR_SIZE 1
#define TICKY_HDR_SIZE 0
#define ARR_HDR_SIZE 1
......@@ -33,13 +33,13 @@
NOTE: keep these in line with the real definitions in InfoTables.h
NOTE: the PROF, GRAN and TICKY values are *wrong* (ToDo)
NOTE: the PROF, and GRAN values are *wrong* (ToDo)
-------------------------------------------------------------------------- */
#define STD_ITBL_SIZE 3
#define PROF_ITBL_SIZE 1
#define GRAN_ITBL_SIZE 1
#define TICKY_ITBL_SIZE 1
#define TICKY_ITBL_SIZE 0
/* -----------------------------------------------------------------------------
Minimum closure sizes
......
/* -----------------------------------------------------------------------------
* $Id: PrimOps.h,v 1.7 1999/01/19 09:49:55 simonm Exp $
* $Id: PrimOps.h,v 1.8 1999/01/21 10:31:42 simonm Exp $
*
* Macros for primitive operations in STG-ish C code.
*
......@@ -278,7 +278,7 @@ typedef union {
arg2._mp_size = (s2); \
arg2._mp_d = (unsigned long int *) (BYTE_ARR_CTS(d2)); \
\
(r) = RET_PRIM_STGCALL2(I_,mpz_cmp,&arg1,&arg2); \
(r) = RET_PRIM_STGCALL2(I_,mpz_cmp,&arg1,&arg2); \
}
/* A glorious hack: calling mpz_neg would entail allocation and
......
/* -----------------------------------------------------------------------------
* $Id: Rts.h,v 1.3 1999/01/13 17:25:54 simonm Exp $
* $Id: Rts.h,v 1.4 1999/01/21 10:31:43 simonm Exp $
*
* Top-level include file for the RTS itself
*
......@@ -45,20 +45,6 @@ typedef enum {
Assertions and Debuggery
-------------------------------------------------------------------------- */
#ifndef DEBUG
#define ASSERT(predicate) /* nothing */
#else
void _stgAssert (char *, unsigned int);
#define ASSERT(predicate) \
if (predicate) \
/*null*/; \
else \
_stgAssert(__FILE__, __LINE__)
#endif /* DEBUG */
#ifndef DEBUG
#define IF_DEBUG(c,s) doNothing()
#else
......
/* -----------------------------------------------------------------------------
* $Id: Stg.h,v 1.3 1999/01/18 14:37:43 sof Exp $
* $Id: Stg.h,v 1.4 1999/01/21 10:31:43 simonm Exp $
*
* Top-level include file for everything STG-ish.
*
......@@ -90,7 +90,7 @@
#include "StgProf.h"
#include "PrimOps.h"
#include "Updates.h"
#include "Ticky.h"
#include "StgTicky.h"
#include "CCall.h"
/* Built-in entry points */
......@@ -106,10 +106,27 @@ extern int prog_argc;
extern char **environ;
/* Creating and destroying an adjustor thunk.
I cannot make myself creating a separate .h file
I cannot make myself create a separate .h file
for these two (sof.)
*/
extern void* createAdjustor(int cconv, StgStablePtr hptr, StgFunPtr wptr);
extern void freeHaskellFunctionPtr(void* ptr);
/* -----------------------------------------------------------------------------
Assertions and Debuggery
-------------------------------------------------------------------------- */
#ifndef DEBUG
#define ASSERT(predicate) /* nothing */
#else
void _stgAssert (char *, unsigned int);
#define ASSERT(predicate) \
if (predicate) \
/*null*/; \
else \
_stgAssert(__FILE__, __LINE__)
#endif /* DEBUG */
#endif /* STG_H */
/* -----------------------------------------------------------------------------
* $Id: StgMacros.h,v 1.2 1998/12/02 13:21:35 simonm Exp $
* $Id: StgMacros.h,v 1.3 1999/01/21 10:31:43 simonm Exp $
*
* Macros used for writing STG-ish C code.
*
......@@ -156,17 +156,19 @@ static inline int IS_ARG_TAG( StgWord p ) { return p <= ARGTAG_MAX; }
if ((Hp += headroom) > HpLim) { \
EXTFUN(stg_chk_##layout); \
tag_assts \
(r) = (P_)ret; \
(r) = (P_)ret; \
JMP_(stg_chk_##layout); \
}
} \
TICK_ALLOC_HEAP(headroom);
#define HP_STK_CHK(stk_headroom,hp_headroom,ret,r,layout,tag_assts) \
if (Sp - stk_headroom < SpLim || (Hp += hp_headroom) > HpLim) { \
EXTFUN(stg_chk_##layout); \
tag_assts \
(r) = (P_)ret; \
(r) = (P_)ret; \
JMP_(stg_chk_##layout); \
}
} \
TICK_ALLOC_HEAP(hp_headroom);
/* -----------------------------------------------------------------------------
A Heap Check in a case alternative are much simpler: everything is
......@@ -195,21 +197,24 @@ static inline int IS_ARG_TAG( StgWord p ) { return p <= ARGTAG_MAX; }
EXTFUN(stg_gc_enter_##ptrs); \
tag_assts \
JMP_(stg_gc_enter_##ptrs); \
}
} \
TICK_ALLOC_HEAP(headroom);
#define HP_CHK_SEQ_NP(headroom,ptrs,tag_assts) \
if ((Hp += (headroom)) > HpLim) { \
EXTFUN(stg_gc_seq_##ptrs); \
tag_assts \
JMP_(stg_gc_seq_##ptrs); \
}
} \
TICK_ALLOC_HEAP(headroom);
#define HP_STK_CHK_NP(stk_headroom, hp_headroom, ptrs, tag_assts) \
if ((Sp - (stk_headroom)) < SpLim || (Hp += (hp_headroom)) > HpLim) { \
EXTFUN(stg_gc_enter_##ptrs); \
tag_assts \
JMP_(stg_gc_enter_##ptrs); \
}
} \
TICK_ALLOC_HEAP(hp_headroom);
/* Heap checks for branches of a primitive case / unboxed tuple return */
......@@ -218,7 +223,8 @@ static inline int IS_ARG_TAG( StgWord p ) { return p <= ARGTAG_MAX; }
EXTFUN(lbl); \
tag_assts \
JMP_(lbl); \
}
} \
TICK_ALLOC_HEAP(headroom);
#define HP_CHK_NOREGS(headroom,tag_assts) \
GEN_HP_CHK_ALT(headroom,stg_gc_noregs,tag_assts);
......@@ -295,30 +301,32 @@ static inline int IS_ARG_TAG( StgWord p ) { return p <= ARGTAG_MAX; }
#define R7_PTR 1<<6
#define R8_PTR 1<<7
#define HP_CHK_GEN(headroom,liveness,reentry,tag_assts) \
if ((Hp += (headroom)) > HpLim ) { \
EF_(stg_gen_chk); \
tag_assts \
R9.w = (W_)LIVENESS_MASK(liveness); \
R10.w = (W_)reentry; \
JMP_(stg_gen_chk); \
}
#define STK_CHK_GEN(headroom,liveness,reentry,tag_assts) \
if ((Sp - (headroom)) < SpLim) { \
EF_(stg_gen_chk); \
tag_assts \
R9.w = (W_)LIVENESS_MASK(liveness); \
R10.w = (W_)reentry; \
JMP_(stg_gen_chk); \
}
#define MAYBE_GC(liveness,reentry) \
if (doYouWantToGC()) { \
EF_(stg_gen_hp); \
R9.w = (W_)LIVENESS_MASK(liveness); \
R10.w = (W_)reentry; \
JMP_(stg_gen_hp); \
#define HP_CHK_GEN(headroom,liveness,reentry,tag_assts) \
if ((Hp += (headroom)) > HpLim ) { \
EF_(stg_gen_chk); \
tag_assts \
R9.w = (W_)LIVENESS_MASK(liveness); \
R10.w = (W_)reentry; \
JMP_(stg_gen_chk); \
} \
TICK_ALLOC_HEAP(headroom);
#define STK_CHK_GEN(headroom,liveness,reentry,tag_assts) \
if ((Sp - (headroom)) < SpLim) { \
EF_(stg_gen_chk); \
tag_assts \
R9.w = (W_)LIVENESS_MASK(liveness); \
R10.w = (W_)reentry; \
JMP_(stg_gen_chk); \
} \
TICK_ALLOC_HEAP(headroom);
#define MAYBE_GC(liveness,reentry) \
if (doYouWantToGC()) { \
EF_(stg_gen_hp); \
R9.w = (W_)LIVENESS_MASK(liveness); \
R10.w = (W_)reentry; \
JMP_(stg_gen_hp); \
}
/* -----------------------------------------------------------------------------
......
/* ----------------------------------------------------------------------------
* $Id: StgTicky.h,v 1.1 1999/01/21 10:31:44 simonm Exp $
*
* Ticky-ticky profiling macros.
*
* -------------------------------------------------------------------------- */
#ifndef TICKY_H
#define TICKY_H
#ifdef TICKY_TICKY
/* -----------------------------------------------------------------------------
Allocations
-------------------------------------------------------------------------- */
/* How many times we do a heap check and move Hp; comparing this with
* the allocations gives an indication of how many things we get per trip
* to the well:
*/
#define TICK_ALLOC_HEAP(n) ALLOC_HEAP_ctr++; ALLOC_HEAP_tot += (n)
/* We count things every time we allocate something in the dynamic heap.
* For each, we count the number of words of (1) ``admin'' (header),
* (2) good stuff (useful pointers and data), and (3) ``slop'' (extra
* space, to leave room for an old generation indirection for example).
*
* The first five macros are inserted when the compiler generates code
* to allocate something; the categories correspond to the @ClosureClass@
* datatype (manifest functions, thunks, constructors, big tuples, and
* partial applications).
*/
#define _HS sizeofW(StgHeader)
#define TICK_ALLOC_FUN(g,s) \
ALLOC_FUN_ctr++; ALLOC_FUN_adm += _HS; \
ALLOC_FUN_gds += (g); ALLOC_FUN_slp += (s); \
TICK_ALLOC_HISTO(FUN,_HS,g,s)
#define TICK_ALLOC_THK(g,s) \
ALLOC_THK_ctr++; ALLOC_THK_adm += _HS; \
ALLOC_THK_gds += (g); ALLOC_THK_slp += (s); \
TICK_ALLOC_HISTO(THK,_HS,g,s)
#define TICK_ALLOC_CON(g,s) \
ALLOC_CON_ctr++; ALLOC_CON_adm += _HS; \
ALLOC_CON_gds += (g); ALLOC_CON_slp += (s); \
TICK_ALLOC_HISTO(CON,_HS,g,s)
#define TICK_ALLOC_TUP(g,s) \
ALLOC_TUP_ctr++; ALLOC_TUP_adm += _HS; \
ALLOC_TUP_gds += (g); ALLOC_TUP_slp += (s); \
TICK_ALLOC_HISTO(TUP,_HS,g,s)
#define TICK_ALLOC_BH(g,s) \
ALLOC_BH_ctr++; ALLOC_BH_adm += _HS; \
ALLOC_BH_gds += (g); ALLOC_BH_slp += (s); \
TICK_ALLOC_HISTO(BH,_HS,g,s)
#define TICK_ALLOC_UPD_PAP(g,s) \
ALLOC_UPD_PAP_ctr++; ALLOC_UPD_PAP_adm += sizeofW(StgPAP)-1; \
ALLOC_UPD_PAP_gds += (g); ALLOC_UPD_PAP_slp += (s); \
TICK_ALLOC_HISTO(UPD_PAP,sizeofW(StgPAP)-1,g,s)
#define TICK_ALLOC_TSO(g,s) \
ALLOC_TSO_ctr++; ALLOC_TSO_adm += sizeofW(StgTSO); \
ALLOC_TSO_gds += (g); ALLOC_TSO_slp += (s); \
TICK_ALLOC_HISTO(TSO,sizeofW(StgTSO),g,s)
#ifdef PAR
#define TICK_ALLOC_FMBQ(a,g,s) \
ALLOC_FMBQ_ctr++; ALLOC_FMBQ_adm += (a); \
ALLOC_FMBQ_gds += (g); ALLOC_FMBQ_slp += (s); \
TICK_ALLOC_HISTO(FMBQ,a,g,s)
#define TICK_ALLOC_FME(a,g,s) \
ALLOC_FME_ctr++; ALLOC_FME_adm += (a); \
ALLOC_FME_gds += (g); ALLOC_FME_slp += (s); \
TICK_ALLOC_HISTO(FME,a,g,s)
#define TICK_ALLOC_BF(a,g,s) \
ALLOC_BF_ctr++; ALLOC_BF_adm += (a); \
ALLOC_BF_gds += (g); ALLOC_BF_slp += (s); \
TICK_ALLOC_HISTO(BF,a,g,s)
#endif
/* The histogrammy bit is fairly straightforward; the -2 is: one for
* 0-origin C arrays; the other one because we do no one-word
* allocations, so we would never inc that histogram slot; so we shift
* everything over by one.
*/
#define TICK_ALLOC_HISTO(categ,a,g,s) \
{ I_ __idx; \
__idx = (a) + (g) + (s) - 2; \
ALLOC_##categ##_hst[((__idx > 4) ? 4 : __idx)] += 1;}
/* Some hard-to-account-for words are allocated by/for primitives,
* includes Integer support. ALLOC_PRIM2 tells us about these. We
* count everything as ``goods'', which is not strictly correct.
* (ALLOC_PRIM is the same sort of stuff, but we know the
* admin/goods/slop breakdown.)
*/
#define TICK_ALLOC_PRIM(a,g,s) \
ALLOC_PRIM_ctr++; ALLOC_PRIM_adm += (a); \
ALLOC_PRIM_gds += (g); ALLOC_PRIM_slp += (s); \
TICK_ALLOC_HISTO(PRIM,a,g,s)
#define TICK_ALLOC_PRIM2(w) ALLOC_PRIM_ctr++; ALLOC_PRIM_gds +=(w); \
TICK_ALLOC_HISTO(PRIM,0,w,0)
/* -----------------------------------------------------------------------------
Enters
-------------------------------------------------------------------------- */
#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_FUN_DIRECT(n) ENT_FUN_DIRECT_ctr++ /* fast entry pt */
#define TICK_ENT_CON(n) ENT_CON_ctr++ /* enter constructor */
#define TICK_ENT_IND(n) ENT_IND_ctr++ /* enter indirection */
#define TICK_ENT_PAP(n) ENT_PAP_ctr++ /* enter PAP */
#define TICK_ENT_AP_UPD(n) ENT_AP_UPD_ctr++ /* enter AP_UPD */
#define TICK_ENT_BH() ENT_BH_ctr++ /* enter BLACKHOLE */
/* -----------------------------------------------------------------------------
Returns
-------------------------------------------------------------------------- */
/* Whenever a ``return'' occurs, it is returning the constituent parts of
* a data constructor. The parts can be returned either in registers, or
* by allocating some heap to put it in (the TICK_ALLOC_* macros account for
* the allocation). The constructor can either be an existing one
* *OLD* or we could have {\em just} figured out this stuff
* *NEW*.
*/
#define TICK_RET_HISTO(categ,n) \
{ I_ __idx; \
__idx = (n); \
RET_##categ##_hst[((__idx > 8) ? 8 : __idx)] += 1;}
#define TICK_RET_NEW(n) RET_NEW_ctr++; \
TICK_RET_HISTO(NEW,n)
#define TICK_RET_OLD(n) RET_OLD_ctr++; \
TICK_RET_HISTO(OLD,n)
#define TICK_RET_UNBOXED_TUP(n) RET_UNBOXED_TUP_ctr++; \
TICK_RET_HISTO(UNBOXED_TUP,n)
#define TICK_RET_SEMI(n) RET_SEMI_IN_HEAP_ctr++; \
TICK_RET_HISTO(SEMI_IN_HEAP,n)
#define TICK_RET_SEMI_BY_DEFAULT()/*???*/ RET_SEMI_BY_DEFAULT_ctr++
#define TICK_RET_SEMI_FAILED(tag) do { \
if ((tag) == INFO_IND_TAG) \
RET_SEMI_FAILED_IND_ctr++; \
else \
RET_SEMI_FAILED_UNEVAL_ctr++; \
} while (0)
#define TICK_VEC_RETURN(n) VEC_RETURN_ctr++; \
TICK_RET_HISTO(VEC_RETURN,n)
/* -----------------------------------------------------------------------------
Stack Frames
Macro Counts
------------------ -------------------------------------------
TICK_UPDF_PUSHED Update frame pushed
TICK_SEQF_PUSHED Seq frame pushed
TICK_CATCHF_PUSHED Catch frame pushed
TICK_UPDF_OMITTED A thunk decided not to push an update frame
TICK_UPDF_RCC_PUSHED Cost Centre restore frame pushed
TICK_UPDF_RCC_OMITTED Cost Centres not required -- not pushed
-------------------------------------------------------------------------- */
#define TICK_UPDF_OMITTED() UPDF_OMITTED_ctr++
#define TICK_UPDF_PUSHED() UPDF_PUSHED_ctr++
#define TICK_SEQF_PUSHED() SEQF_PUSHED_ctr++
#define TICK_CATCHF_PUSHED() CATCHF_PUSHED_ctr++
#define TICK_UPDF_RCC_PUSHED() UPDF_RCC_PUSHED_ctr++
#define TICK_UPDF_RCC_OMITTED() UPDF_RCC_OMITTED_ctr++
/* -----------------------------------------------------------------------------
Updates
These macros record information when we do an update. We always
update either with a data constructor (CON) or a partial application
(PAP).
Macro Where
----------------------- --------------------------------------------
TICK_UPD_EXISTING Updating with an indirection to something
already in the heap
TICK_UPD_SQUEEZED Same as UPD_EXISTING but because
of stack-squeezing
TICK_UPD_CON_IN_NEW Allocating a new CON
TICK_UPD_PAP_IN_NEW Allocating a new PAP
TICK_UPD_PAP_IN_PLACE Updating with a PAP in place
-------------------------------------------------------------------------- */
#define TICK_UPD_HISTO(categ,n) \
{ I_ __idx; \
__idx = (n); \
UPD_##categ##_hst[((__idx > 8) ? 8 : __idx)] += 1;}
#define TICK_UPD_EXISTING() UPD_EXISTING_ctr++
#define TICK_UPD_SQUEEZED() UPD_SQUEEZED_ctr++
#define TICK_UPD_CON_IN_NEW(n) UPD_CON_IN_NEW_ctr++ ; \
TICK_UPD_HISTO(CON_IN_NEW,n)
#define TICK_UPD_PAP_IN_NEW(n) UPD_PAP_IN_NEW_ctr++ ; \
TICK_UPD_HISTO(PAP_IN_NEW,n)
#define TICK_UPD_PAP_IN_PLACE() UPD_PAP_IN_PLACE_ctr++
/* For the generational collector:
*/
#define TICK_UPD_NEW_IND() UPD_NEW_IND_ctr++
#define TICK_UPD_OLD_IND() UPD_OLD_IND_ctr++
/* -----------------------------------------------------------------------------
Garbage collection counters
-------------------------------------------------------------------------- */
/* Selectors:
*
* GC_SEL_ABANDONED: we could've done the selection, but we gave up
* (e.g., to avoid overflowing the C stack); GC_SEL_MINOR: did a
* selection in a minor GC; GC_SEL_MAJOR: ditto, but major GC.
*/
#define TICK_GC_SEL_ABANDONED() GC_SEL_ABANDONED_ctr++
#define TICK_GC_SEL_MINOR() GC_SEL_MINOR_ctr++
#define TICK_GC_SEL_MAJOR() GC_SEL_MAJOR_ctr++
/* Failed promotion: we wanted to promote an object early, but
* it had already been evacuated to (or resided in) a younger
* generation.
*/
#define TICK_GC_FAILED_PROMOTION() GC_FAILED_PROMOTION_ctr++
/* -----------------------------------------------------------------------------
The accumulators (extern decls)
-------------------------------------------------------------------------- */
#ifdef TICKY_C
#define INIT(ializer) = ializer
#define EXTERN
#else
#define INIT(ializer)
#define EXTERN extern
#endif
EXTERN unsigned long ALLOC_HEAP_ctr INIT(0);
EXTERN unsigned long ALLOC_HEAP_tot INIT(0);
EXTERN unsigned long ALLOC_FUN_ctr INIT(0);
EXTERN unsigned long ALLOC_FUN_adm INIT(0);
EXTERN unsigned long ALLOC_FUN_gds INIT(0);
EXTERN unsigned long ALLOC_FUN_slp INIT(0);
EXTERN unsigned long ALLOC_FUN_hst[5]
#ifdef TICKY_C
= {0,0,0,0,0} /* urk, can't use INIT macro 'cause of the commas */
#endif
;
EXTERN unsigned long ALLOC_THK_ctr INIT(0);
EXTERN unsigned long ALLOC_THK_adm INIT(0);
EXTERN unsigned long ALLOC_THK_gds INIT(0);
EXTERN unsigned long ALLOC_THK_slp INIT(0);
EXTERN unsigned long ALLOC_THK_hst[5]
#ifdef TICKY_C
= {0,0,0,0,0}
#endif
;
EXTERN unsigned long ALLOC_CON_ctr INIT(0);
EXTERN unsigned long ALLOC_CON_adm INIT(0);
EXTERN unsigned long ALLOC_CON_gds INIT(0);
EXTERN unsigned long ALLOC_CON_slp INIT(0);
EXTERN unsigned long ALLOC_CON_hst[5]
#ifdef TICKY_C
= {0,0,0,0,0}
#endif
;
EXTERN unsigned long ALLOC_TUP_ctr INIT(0);
EXTERN unsigned long ALLOC_TUP_adm INIT(0);