1 /* -----------------------------------------------------------------------------
3 * (c) The University of Glasgow, 2009
5 * Lag/Drag/Void profiling.
7 * Do not #include this file directly: #include "Rts.h" instead.
9 * To understand the structure of the RTS headers, see the wiki:
10 * http://hackage.haskell.org/trac/ghc/wiki/Commentary/SourceTree/Includes
12 * ---------------------------------------------------------------------------*/
14 #ifndef RTS_PROF_LDV_H
15 #define RTS_PROF_LDV_H
19 /* retrieves the LDV word from closure c */
20 #define LDVW(c) (((StgClosure *)(c))->header.prof.hp.ldvw)
23 * Stores the creation time for closure c.
24 * This macro is called at the very moment of closure creation.
26 * NOTE: this initializes LDVW(c) to zero, which ensures that there
27 * is no conflict between retainer profiling and LDV profiling,
28 * because retainer profiling also expects LDVW(c) to be initialised
34 #define LDV_RECORD_DEAD_FILL_SLOP_DYNAMIC(c) \
35 foreign "C" LDV_recordDead_FILL_SLOP_DYNAMIC(c "ptr")
39 #define LDV_RECORD_CREATE(c) \
40 LDVW((c)) = ((StgWord)RTS_DEREF(era) << LDV_SHIFT) | LDV_STATE_CREATE
42 void LDV_recordDead_FILL_SLOP_DYNAMIC( StgClosure *p );
44 #define LDV_RECORD_DEAD_FILL_SLOP_DYNAMIC(c) \
45 LDV_recordDead_FILL_SLOP_DYNAMIC(c)
49 #else /* !PROFILING */
51 #define LDV_RECORD_CREATE(c) /* nothing */
52 #define LDV_RECORD_DEAD_FILL_SLOP_DYNAMIC(c) /* nothing */
54 #endif /* PROFILING */
56 #endif /* STGLDVPROF_H */