Quiet constness warnings about string constants passed to REGISTER_LANGUAGE.
[charm.git] / src / conv-perf / traceCoreCommon.C
index f48f2ff7d067b0b10be06e5deb579e6926a90240..fb8d757fda292145820e33d2d770ee64a292b5e5 100644 (file)
@@ -1,8 +1,9 @@
 
 #include "traceCore.h"
+#include "traceCoreAPI.h"
 #include "traceCoreCommon.h"
 #include "charmProjections.h"
-#include "ampiProjections.h"
+//#include "ampiProjections.h"
 #include "converse.h"
 
 
@@ -10,7 +11,9 @@
 #define TRACE_CORE_BUFFER_SIZE 10
 
 /* Trace Storage and associated Structure */
+extern "C" {
 CpvDeclare(int, _traceCoreOn);
+}
 CpvDeclare(double, _traceCoreInitTime);
 CpvDeclare(char*, _traceCoreRoot);
 CpvDeclare(int, _traceCoreBufferSize);
@@ -45,14 +48,14 @@ extern "C" void initTraceCore(char** argv)
 
   CpvInitialize(TraceCore*, _traceCore);
        CpvAccess(_traceCore) = new TraceCore(argv);
-  initCharmProjections();
-  initAmpiProjections();
// initCharmProjections();
// initAmpiProjections();
 }
 
 /* End Core Trace Module */
 //TODO - trace-common.C
 extern "C" void closeTraceCore() {
-       closeAmpiProjections();
+       //closeAmpiProjections();
        delete CpvAccess(_traceCore);
 }
 
@@ -76,12 +79,14 @@ extern "C" void endTraceCore(void) {}
 /* Tracing API 
  * Implementation of functions declared in traceCoreAPI.h 
  *****************************************************************/
-extern "C" void RegisterLanguage(int lID, char* ln)
-{ CpvAccess(_traceCore)->RegisterLanguage(lID, ln); }
+extern "C" void RegisterLanguage(int lID, const char* ln)
+{ LOGCONDITIONAL(CpvAccess(_traceCore)->RegisterLanguage(lID, ln)); }
 
 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); }