Add LOGCONDITIONAL protection around RegisterLanguage and
authorOrion Lawlor <olawlor@acm.org>
Sat, 30 Aug 2003 02:42:03 +0000 (02:42 +0000)
committerOrion Lawlor <olawlor@acm.org>
Sat, 30 Aug 2003 02:42:03 +0000 (02:42 +0000)
RegisterEvent calls (before they would segfault if called
under CMK_OPTIMIZE).

src/conv-perf/traceCoreCommon.C

index 3660aa6a598a19e9ba55a535dbf243005e044c57..53b3949a1dce91133bc157c740bcc941b6453a0f 100644 (file)
@@ -1,5 +1,6 @@
 
 #include "traceCore.h"
 
 #include "traceCore.h"
+#include "traceCoreAPI.h"
 #include "traceCoreCommon.h"
 #include "charmProjections.h"
 //#include "ampiProjections.h"
 #include "traceCoreCommon.h"
 #include "charmProjections.h"
 //#include "ampiProjections.h"
@@ -79,11 +80,13 @@ extern "C" void endTraceCore(void) {}
  * Implementation of functions declared in traceCoreAPI.h 
  *****************************************************************/
 extern "C" void RegisterLanguage(int lID, char* ln)
  * Implementation of functions declared in traceCoreAPI.h 
  *****************************************************************/
 extern "C" void RegisterLanguage(int lID, char* ln)
-{ CpvAccess(_traceCore)->RegisterLanguage(lID, ln); }
+{ LOGCONDITIONAL(CpvAccess(_traceCore)->RegisterLanguage(lID, ln)); }
 
 extern "C" void RegisterEvent(int lID, int eID)
 
 extern "C" void RegisterEvent(int lID, int eID)
-{ CpvAccess(_traceCore)->RegisterEvent(lID, eID); }
+{ LOGCONDITIONAL(CpvAccess(_traceCore)->RegisterEvent(lID, eID)); }
 
 
+/* These Log routines will segfault if called under CMK_OPTIMIZE;
+   the solution is to surround their callers with LOGCONDITIONAL. */
 extern "C" void LogEvent(int lID, int eID)
 { CpvAccess(_traceCore)->LogEvent(lID, eID); }
 
 extern "C" void LogEvent(int lID, int eID)
 { CpvAccess(_traceCore)->LogEvent(lID, eID); }