summaryrefslogtreecommitdiff
path: root/rts/Updates.h
diff options
context:
space:
mode:
authorKirsten Chevalier <chevalier@alum.wellesley.edu>2007-02-07 08:14:04 +0000
committerKirsten Chevalier <chevalier@alum.wellesley.edu>2007-02-07 08:14:04 +0000
commit5ddee764beb312933256096d03df7c3ec47ac452 (patch)
tree633a4d9c75624535facbd632e4d564e43c685f30 /rts/Updates.h
parent06decfcd62d1ca9069cd4707115ecb92bea39064 (diff)
downloadhaskell-5ddee764beb312933256096d03df7c3ec47ac452.tar.gz
Lightweight ticky-ticky profiling
The following changes restore ticky-ticky profiling to functionality from its formerly bit-rotted state. Sort of. (It got bit-rotted as part of the switch to the C-- back-end.) The way that ticky-ticky is supposed to work is documented in Section 5.7 of the GHC manual (though the manual doesn't mention that it hasn't worked since sometime around 6.0, alas). Changes from this are as follows (which I'll document on the wiki): * In the past, you had to build all of the libraries with way=t in order to use ticky-ticky, because it entailed a different closure layout. No longer. You still need to do make way=t in rts/ in order to build the ticky RTS, but you should now be able to mix ticky and non-ticky modules. * Some of the counters that worked in the past aren't implemented yet. I was originally just trying to get entry counts to work, so those should be correct. The list of counters was never documented in the first place, so I hope it's not too much of a disaster that some don't appear anymore. Someday, someone (perhaps me) should document all the counters and what they do. For now, all of the counters are either accurate (or at least as accurate as they always were), zero, or missing from the ticky profiling report altogether. This hasn't been particularly well-tested, but these changes shouldn't affect anything except when compiling with -fticky-ticky (famous last words...) Implementation details: I got rid of StgTicky.h, which in the past had the macros and declarations for all of the ticky counters. Now, those macros are defined in Cmm.h. StgTicky.h was still there for inclusion in C code. Now, any remaining C code simply cannot call the ticky macros -- or rather, they do call those macros, but from the perspective of C code, they're defined as no-ops. (This shouldn't be too big a problem.) I added a new file TickyCounter.h that has all the declarations for ticky counters, as well as dummy macros for use in C code. Someday, these declarations should really be automatically generated, since they need to be kept consistent with the macros defined in Cmm.h. Other changes include getting rid of the header that was getting added to closures before, and getting rid of various code having to do with eager blackholing and permanent indirections (the changes under compiler/ and rts/Updates.*).
Diffstat (limited to 'rts/Updates.h')
-rw-r--r--rts/Updates.h80
1 files changed, 7 insertions, 73 deletions
diff --git a/rts/Updates.h b/rts/Updates.h
index abca78817d..3461c91144 100644
--- a/rts/Updates.h
+++ b/rts/Updates.h
@@ -23,21 +23,14 @@
-------------------------------------------------------------------------- */
-#ifdef TICKY_TICKY
-# define UPD_IND(updclosure, heapptr) \
- UPD_PERM_IND(updclosure,heapptr)
-# define UPD_SPEC_IND(updclosure, ind_info, heapptr, and_then) \
- UPD_PERM_IND(updclosure,heapptr); and_then
-#else
# define SEMI ;
# define UPD_IND(updclosure, heapptr) \
UPD_REAL_IND(updclosure,INFO_PTR(stg_IND_info),heapptr,SEMI)
# define UPD_SPEC_IND(updclosure, ind_info, heapptr, and_then) \
UPD_REAL_IND(updclosure,ind_info,heapptr,and_then)
-#endif
/* These macros have to work in both C and C--, so here's the
- * impedence matching:
+ * impedance matching:
*/
#ifdef CMINUSMINUS
#define BLOCK_BEGIN
@@ -57,9 +50,10 @@
#define ARG_PTR /* nothing */
#endif
-/* UPD_IND actually does a PERM_IND if TICKY_TICKY is on;
- if you *really* need an IND use UPD_REAL_IND
- */
+/* krc: there used to be an UPD_REAL_IND and an
+ UPD_PERM_IND, the latter of which was used for
+ ticky and cost-centre profiling.
+ for now, we just have UPD_REAL_IND. */
#define UPD_REAL_IND(updclosure, ind_info, heapptr, and_then) \
BLOCK_BEGIN \
DECLARE_IPTR(info); \
@@ -70,34 +64,18 @@
and_then); \
BLOCK_END
-#if defined(PROFILING) || defined(TICKY_TICKY)
-#define UPD_PERM_IND(updclosure, heapptr) \
- BLOCK_BEGIN \
- updateWithPermIndirection(updclosure, \
- heapptr); \
- BLOCK_END
-#endif
-
#if defined(RTS_SUPPORTS_THREADS)
-# ifdef TICKY_TICKY
-# define UPD_IND_NOLOCK(updclosure, heapptr) \
- BLOCK_BEGIN \
- updateWithPermIndirection(updclosure, \
- heapptr); \
- BLOCK_END
-# else
# define UPD_IND_NOLOCK(updclosure, heapptr) \
BLOCK_BEGIN \
updateWithIndirection(INFO_PTR(stg_IND_info), \
updclosure, \
heapptr,); \
BLOCK_END
-# endif
#else
#define UPD_IND_NOLOCK(updclosure,heapptr) UPD_IND(updclosure,heapptr)
-#endif
+#endif /* RTS_SUPPORTS_THREADS */
/* -----------------------------------------------------------------------------
Awaken any threads waiting on a blocking queue (BLACKHOLE_BQ).
@@ -321,49 +299,5 @@ no_slop:
and_then; \
} \
}
-#endif
-
-/* The permanent indirection version isn't performance critical. We
- * therefore use an inline C function instead of the C-- macro.
- */
-#ifndef CMINUSMINUS
-INLINE_HEADER void
-updateWithPermIndirection(StgClosure *p1,
- StgClosure *p2)
-{
- bdescr *bd;
-
- ASSERT( p1 != p2 && !closure_IND(p1) );
-
- /*
- * @LDV profiling
- * Destroy the old closure.
- * Nb: LDV_* stuff cannot mix with ticky-ticky
- */
- LDV_RECORD_DEAD_FILL_SLOP_DYNAMIC(p1);
-
- bd = Bdescr((P_)p1);
- if (bd->gen_no != 0) {
- recordMutableGenLock(p1, &generations[bd->gen_no]);
- ((StgInd *)p1)->indirectee = p2;
- SET_INFO(p1, &stg_IND_OLDGEN_PERM_info);
- /*
- * @LDV profiling
- * We have just created a new closure.
- */
- LDV_RECORD_CREATE(p1);
- TICK_UPD_OLD_PERM_IND();
- } else {
- ((StgInd *)p1)->indirectee = p2;
- SET_INFO(p1, &stg_IND_PERM_info);
- /*
- * @LDV profiling
- * We have just created a new closure.
- */
- LDV_RECORD_CREATE(p1);
- TICK_UPD_NEW_PERM_IND(p1);
- }
-}
-#endif
-
+#endif /* CMINUSMINUS */
#endif /* UPDATES_H */