diff options
author | Ömer Sinan Ağacan <omeragacan@gmail.com> | 2019-01-02 13:13:59 +0300 |
---|---|---|
committer | Ömer Sinan Ağacan <omeragacan@gmail.com> | 2019-01-03 00:36:07 -0500 |
commit | 6e4e63764aaf558cf177c2a9c2da345b2a360ea6 (patch) | |
tree | e58576be66b4bc1cbf8a6d4c25a4a9ba4858f3d4 /includes | |
parent | 05cd2319152183b3f44bca3561374217d6af5546 (diff) | |
download | haskell-6e4e63764aaf558cf177c2a9c2da345b2a360ea6.tar.gz |
Minor refactoring and documentation in profiling RTS code
Diffstat (limited to 'includes')
-rw-r--r-- | includes/rts/prof/CCS.h | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/includes/rts/prof/CCS.h b/includes/rts/prof/CCS.h index 4805063a0f..89c9fd2b13 100644 --- a/includes/rts/prof/CCS.h +++ b/includes/rts/prof/CCS.h @@ -36,7 +36,7 @@ typedef struct CostCentre_ { StgWord64 mem_alloc; // align 8 (Note [struct alignment]) StgWord time_ticks; - StgInt is_caf; // non-zero for a CAF cost centre + StgBool is_caf; // true <=> CAF cost centre struct CostCentre_ *link; } CostCentre; @@ -96,9 +96,8 @@ void startProfTimer ( void ); #define EMPTY_TABLE NULL /* Constants used to set is_caf flag on CostCentres */ -#define CC_IS_CAF 'c' /* 'c' => *is* a CAF cc */ -#define CC_NOT_CAF 0 - +#define CC_IS_CAF true +#define CC_NOT_CAF false /* ----------------------------------------------------------------------------- * Data Structures * ---------------------------------------------------------------------------*/ @@ -109,10 +108,15 @@ void startProfTimer ( void ); // result). typedef struct IndexTable_ { + // Just a linked list of (cc, ccs) pairs, where the `ccs` is the result of + // pushing `cc` to the owner of the index table (another CostCentreStack). CostCentre *cc; CostCentreStack *ccs; struct IndexTable_ *next; - uint32_t back_edge; + // back_edge is true when `cc` is already in the stack, so pushing it + // truncates or drops (see RECURSION_DROPS and RECURSION_TRUNCATES in + // Profiling.c). + bool back_edge; } IndexTable; |