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
36 #define LDV_RECORD_CREATE(c) \
37 LDVW((c)) = ((StgWord)RTS_DEREF(era) << LDV_SHIFT) | LDV_STATE_CREATE
41 #else /* !PROFILING */
43 #define LDV_RECORD_CREATE(c) /* nothing */
45 #endif /* PROFILING */
47 #endif /* STGLDVPROF_H */