diff options
author | Simon Marlow <marlowsd@gmail.com> | 2009-08-02 21:32:04 +0000 |
---|---|---|
committer | Simon Marlow <marlowsd@gmail.com> | 2009-08-02 21:32:04 +0000 |
commit | a2a67cd520b9841114d69a87a423dabcb3b4368e (patch) | |
tree | 3dc6bbf53dff5421c14fbeb2d812c1424f2718c0 /includes/stg/Ticky.h | |
parent | 5d379cbe65e406d5c3a848fe7fcd090cafbfeb78 (diff) | |
download | haskell-a2a67cd520b9841114d69a87a423dabcb3b4368e.tar.gz |
RTS tidyup sweep, first phase
The first phase of this tidyup is focussed on the header files, and in
particular making sure we are exposinng publicly exactly what we need
to, and no more.
- Rts.h now includes everything that the RTS exposes publicly,
rather than a random subset of it.
- Most of the public header files have moved into subdirectories, and
many of them have been renamed. But clients should not need to
include any of the other headers directly, just #include the main
public headers: Rts.h, HsFFI.h, RtsAPI.h.
- All the headers needed for via-C compilation have moved into the
stg subdirectory, which is self-contained. Most of the headers for
the rest of the RTS APIs have moved into the rts subdirectory.
- I left MachDeps.h where it is, because it is so widely used in
Haskell code.
- I left a deprecated stub for RtsFlags.h in place. The flag
structures are now exposed by Rts.h.
- Various internal APIs are no longer exposed by public header files.
- Various bits of dead code and declarations have been removed
- More gcc warnings are turned on, and the RTS code is more
warning-clean.
- More source files #include "PosixSource.h", and hence only use
standard POSIX (1003.1c-1995) interfaces.
There is a lot more tidying up still to do, this is just the first
pass. I also intend to standardise the names for external RTS APIs
(e.g use the rts_ prefix consistently), and declare the internal APIs
as hidden for shared libraries.
Diffstat (limited to 'includes/stg/Ticky.h')
-rw-r--r-- | includes/stg/Ticky.h | 188 |
1 files changed, 188 insertions, 0 deletions
diff --git a/includes/stg/Ticky.h b/includes/stg/Ticky.h new file mode 100644 index 0000000000..fd7edf85c5 --- /dev/null +++ b/includes/stg/Ticky.h @@ -0,0 +1,188 @@ +/* ----------------------------------------------------------------------------- + * + * (c) The GHC Team, 2007 + * + * Declarations for counters used by ticky-ticky profiling. + * + * -------------------------------------------------------------------------- */ + + +#ifndef TICKYCOUNTERS_H +#define TICKYCOUNTERS_H + +/* These should probably be automatically generated in order to + keep them consistent with the macros that use them (which are + defined in Cmm.h. */ + +#ifdef TICKY_TICKY +/* same trick as in the former StgTicky.h: recycle the same declarations + for both extern decls (which are included everywhere) + and initializations (which only happen once) */ +#ifdef TICKY_C +#define INIT(ializer) = ializer +#define EXTERN +#else +#define INIT(ializer) +#define EXTERN extern +#endif + +/* Here are all the counter declarations: */ + +EXTERN StgInt ENT_VIA_NODE_ctr INIT(0); +EXTERN StgInt ENT_STATIC_THK_ctr INIT(0); +EXTERN StgInt ENT_DYN_THK_ctr INIT(0); +EXTERN StgInt ENT_STATIC_FUN_DIRECT_ctr INIT(0); +EXTERN StgInt ENT_DYN_FUN_DIRECT_ctr INIT(0); +EXTERN StgInt ENT_STATIC_CON_ctr INIT(0); +EXTERN StgInt ENT_DYN_CON_ctr INIT(0); +EXTERN StgInt ENT_STATIC_IND_ctr INIT(0); +EXTERN StgInt ENT_DYN_IND_ctr INIT(0); +EXTERN StgInt ENT_PERM_IND_ctr INIT(0); +EXTERN StgInt ENT_PAP_ctr INIT(0); +EXTERN StgInt ENT_AP_ctr INIT(0); +EXTERN StgInt ENT_AP_STACK_ctr INIT(0); +EXTERN StgInt ENT_BH_ctr INIT(0); + +EXTERN StgInt UNKNOWN_CALL_ctr INIT(0); + +EXTERN StgInt SLOW_CALL_v_ctr INIT(0); +EXTERN StgInt SLOW_CALL_f_ctr INIT(0); +EXTERN StgInt SLOW_CALL_d_ctr INIT(0); +EXTERN StgInt SLOW_CALL_l_ctr INIT(0); +EXTERN StgInt SLOW_CALL_n_ctr INIT(0); +EXTERN StgInt SLOW_CALL_p_ctr INIT(0); +EXTERN StgInt SLOW_CALL_pv_ctr INIT(0); +EXTERN StgInt SLOW_CALL_pp_ctr INIT(0); +EXTERN StgInt SLOW_CALL_ppv_ctr INIT(0); +EXTERN StgInt SLOW_CALL_ppp_ctr INIT(0); +EXTERN StgInt SLOW_CALL_pppv_ctr INIT(0); +EXTERN StgInt SLOW_CALL_pppp_ctr INIT(0); +EXTERN StgInt SLOW_CALL_ppppp_ctr INIT(0); +EXTERN StgInt SLOW_CALL_pppppp_ctr INIT(0); +EXTERN StgInt SLOW_CALL_OTHER_ctr INIT(0); + +EXTERN StgInt ticky_slow_call_unevald; +EXTERN StgInt SLOW_CALL_ctr INIT(0); +EXTERN StgInt MULTI_CHUNK_SLOW_CALL_ctr INIT(0); +EXTERN StgInt MULTI_CHUNK_SLOW_CALL_CHUNKS_ctr INIT(0); +EXTERN StgInt KNOWN_CALL_ctr INIT(0); +EXTERN StgInt KNOWN_CALL_TOO_FEW_ARGS_ctr INIT(0); +EXTERN StgInt KNOWN_CALL_EXTRA_ARGS_ctr INIT(0); +EXTERN StgInt SLOW_CALL_FUN_TOO_FEW_ctr INIT(0); +EXTERN StgInt SLOW_CALL_FUN_CORRECT_ctr INIT(0); +EXTERN StgInt SLOW_CALL_FUN_TOO_MANY_ctr INIT(0); +EXTERN StgInt SLOW_CALL_PAP_TOO_FEW_ctr INIT(0); +EXTERN StgInt SLOW_CALL_PAP_CORRECT_ctr INIT(0); +EXTERN StgInt SLOW_CALL_PAP_TOO_MANY_ctr INIT(0); +EXTERN StgInt SLOW_CALL_UNEVALD_ctr INIT(0); + + +EXTERN StgInt UPDF_OMITTED_ctr INIT(0); +EXTERN StgInt UPDF_PUSHED_ctr INIT(0); +EXTERN StgInt CATCHF_PUSHED_ctr INIT(0); +EXTERN StgInt UPDF_RCC_PUSHED_ctr INIT(0); +EXTERN StgInt UPDF_RCC_OMITTED_ctr INIT(0); + +EXTERN StgInt UPD_SQUEEZED_ctr INIT(0); +EXTERN StgInt UPD_CON_IN_NEW_ctr INIT(0); +EXTERN StgInt UPD_CON_IN_PLACE_ctr INIT(0); +EXTERN StgInt UPD_PAP_IN_NEW_ctr INIT(0); +EXTERN StgInt UPD_PAP_IN_PLACE_ctr INIT(0); + +EXTERN StgInt ALLOC_HEAP_ctr INIT(0); +EXTERN StgInt ALLOC_HEAP_tot; + +EXTERN StgInt ALLOC_FUN_ctr INIT(0); +EXTERN StgInt ALLOC_FUN_adm; +EXTERN StgInt ALLOC_FUN_gds; +EXTERN StgInt ALLOC_FUN_slp; + +EXTERN StgInt UPD_NEW_IND_ctr INIT(0); +EXTERN StgInt UPD_NEW_PERM_IND_ctr INIT(0); +EXTERN StgInt UPD_OLD_IND_ctr INIT(0); +EXTERN StgInt UPD_OLD_PERM_IND_ctr INIT(0); + +EXTERN StgInt UPD_BH_UPDATABLE_ctr INIT(0); +EXTERN StgInt UPD_BH_SINGLE_ENTRY_ctr INIT(0); +EXTERN StgInt UPD_CAF_BH_UPDATABLE_ctr INIT(0); +EXTERN StgInt UPD_CAF_BH_SINGLE_ENTRY_ctr INIT(0); + +EXTERN StgInt GC_SEL_ABANDONED_ctr INIT(0); +EXTERN StgInt GC_SEL_MINOR_ctr INIT(0); +EXTERN StgInt GC_SEL_MAJOR_ctr INIT(0); + +EXTERN StgInt GC_FAILED_PROMOTION_ctr INIT(0); + +EXTERN StgInt GC_WORDS_COPIED_ctr INIT(0); + +EXTERN StgInt ALLOC_UP_THK_ctr INIT(0); +EXTERN StgInt ALLOC_SE_THK_ctr INIT(0); +EXTERN StgInt ALLOC_THK_adm INIT(0); +EXTERN StgInt ALLOC_THK_gds INIT(0); +EXTERN StgInt ALLOC_THK_slp INIT(0); + +EXTERN StgInt ALLOC_CON_ctr INIT(0); +EXTERN StgInt ALLOC_CON_adm INIT(0); +EXTERN StgInt ALLOC_CON_gds INIT(0); +EXTERN StgInt ALLOC_CON_slp INIT(0); + +EXTERN StgInt ALLOC_TUP_ctr INIT(0); +EXTERN StgInt ALLOC_TUP_adm INIT(0); +EXTERN StgInt ALLOC_TUP_gds INIT(0); +EXTERN StgInt ALLOC_TUP_slp INIT(0); + +EXTERN StgInt ALLOC_BH_ctr INIT(0); +EXTERN StgInt ALLOC_BH_adm INIT(0); +EXTERN StgInt ALLOC_BH_gds INIT(0); +EXTERN StgInt ALLOC_BH_slp INIT(0); + +EXTERN StgInt ALLOC_PRIM_ctr INIT(0); +EXTERN StgInt ALLOC_PRIM_adm INIT(0); +EXTERN StgInt ALLOC_PRIM_gds INIT(0); +EXTERN StgInt ALLOC_PRIM_slp INIT(0); + +EXTERN StgInt ALLOC_PAP_ctr INIT(0); +EXTERN StgInt ALLOC_PAP_adm INIT(0); +EXTERN StgInt ALLOC_PAP_gds INIT(0); +EXTERN StgInt ALLOC_PAP_slp INIT(0); + +EXTERN StgInt ALLOC_TSO_ctr INIT(0); +EXTERN StgInt ALLOC_TSO_adm INIT(0); +EXTERN StgInt ALLOC_TSO_gds INIT(0); +EXTERN StgInt ALLOC_TSO_slp INIT(0); + +EXTERN StgInt RET_NEW_ctr INIT(0); +EXTERN StgInt RET_OLD_ctr INIT(0); +EXTERN StgInt RET_UNBOXED_TUP_ctr INIT(0); + +EXTERN StgInt RET_SEMI_loads_avoided INIT(0); + +/* End of counter declarations. */ + +#endif /* TICKY_TICKY */ + +/* This is ugly, but the story is: + We got rid of StgTicky.h, which was previously + defining these macros for the benefit of C code + so, we define them here instead (to be no-ops). + (since those macros are only defined in Cmm.h) + + Note that these macros must be defined whether + TICKY_TICKY is defined or not. */ + +#ifndef CMINUSMINUS +#define TICK_ALLOC_PRIM(x,y,z) +#define TICK_UPD_OLD_IND() +#define TICK_UPD_NEW_IND() +#define TICK_UPD_SQUEEZED() +#define TICK_ALLOC_HEAP_NOCTR(x) +#define TICK_GC_WORDS_COPIED(x) +#define TICK_GC_FAILED_PROMOTION() +#define TICK_ALLOC_TSO(g,s) +#define TICK_ALLOC_UP_THK(g,s) +#define TICK_ALLOC_SE_THK(g,s) + +#endif + + +#endif /* TICKYCOUNTERS_H */ |