Exposed a per-entry-method memleak when testing with valgrind. Committing Chee Wai...
authorRamprasad Venkataraman <ramv@illinois.edu>
Wed, 24 Jun 2009 22:11:13 +0000 (22:11 +0000)
committerRamprasad Venkataraman <ramv@illinois.edu>
Wed, 24 Jun 2009 22:11:13 +0000 (22:11 +0000)
src/ck-perf/trace.h

index 513a454cfa15fd7a01ab134aca5c3f921889ca5b..fcc9bcf20727e5c8f8a1c03fbb454497c1d83a7e 100644 (file)
@@ -291,7 +291,9 @@ extern "C" {
 #define _TRACE_END_SDAG(env) _TRACE_ONLY(CkpvAccess(_traces)->endSDAGBlock(env))
 #define _TRACE_BEGIN_EXECUTE(env) _TRACE_ONLY(CkpvAccess(_traces)->beginExecute(env))
 #define _TRACE_BEGIN_EXECUTE_DETAILED(evt,typ,ep,src,mlen,idx) \
-       _TRACE_ONLY(CkpvAccess(_traces)->beginExecute(evt,typ,ep,src,mlen,idx))
+      do{ if (CkpvAccess(_traces)->length()) \
+          { _TRACE_ONLY(CkpvAccess(_traces)->beginExecute(evt,typ,ep,src,mlen,idx)) } \
+        } while(0)
 #define _TRACE_END_EXECUTE() _TRACE_ONLY(CkpvAccess(_traces)->endExecute())
 #define _TRACE_MESSAGE_RECV(env, pe) _TRACE_ONLY(CkpvAccess(_traces)->messageRecv(env, pe))
 #define _TRACE_BEGIN_PACK() _TRACE_ONLY(CkpvAccess(_traces)->beginPack())