
TICKY_TICKY is the right #def to check, and it should work the straightforward way. Why doesn't #ifdef TICKY_TICKY #define MYBUMP(ctr,n) ctr = ctr + n #else #define MYBUMP(ctr,n) /* nothing */ #endif work? As a trick, you can check and make sure TICKY_TICKY is actually defined by inserting an #error if it's not defined, and then taking a look at the failing build command. Edward Excerpts from Nicolas Frisby's message of Thu Mar 14 14:21:16 -0700 2013:
I'm trying to enable some ticky counters for profiling the RTS code (eg in Storage.c:allocate). Much of the code was already in place, but disabled via CPP.
I can enable the counters, but I'm having trouble making them only tick in the debug RTS.
Can someone advise regarding the presence/accuracy of, say, the TICKY_TICKY symbol within the $(TOP)/includes/stg/Ticky.h file?
Recap:
* I use a macro in Storage.c to tick a ticky counter
* The macro is #defined in stg/Ticky.h
* I'd like the macro definition to be empty unless the Rts build way is DEBUG
* There's this TICKY_TICKY symbol already floating around, so that seems like the right symbol to check
* Thus: what do #include in stg/Ticky.h to make TICKY_TICKY accurate wrt to the build way?
Maybe I'm dense at the moment, but trying some of the straight-forward options suggested by http://hackage.haskell.org/trac/ghc/wiki/Commentary/SourceTree/Includes didn't seem to help.
Thanks.