got rid of //
[charm.git] / src / conv-perf / traceCoreCommon.C
1
2 #include "converse.h"
3 #include "traceCore.h"
4 #include "traceCoreCommon.h"
5
6 /* Trace Module Constants (Default Values) */
7 #define TRACE_CORE_BUFFER_SIZE 10000
8
9 /* Trace Storage and associated Structure */
10 CpvDeclare(int, _traceCoreOn);
11 CpvDeclare(double, _traceCoreInitTime);
12 CpvDeclare(char*, _traceCoreRoot);
13 CpvDeclare(int, _traceCoreBufferSize);
14 CpvDeclare(TraceCore*, _traceCore);
15
16 /* Initialize TraceCore Module */
17 //TODO decide parameters from command line
18 extern "C" void initTraceCore(char** argv)
19 {
20   CpvInitialize(int, _traceCoreOn);
21         CpvAccess(_traceCoreOn) = 0;
22
23   CpvInitialize(char*, _traceCoreRoot);
24         CpvAccess(_traceCoreRoot) = (char *) malloc(strlen(argv[0])+1);
25         _MEMCHECK(CpvAccess(_traceCoreRoot));
26         strcpy(CpvAccess(_traceCoreRoot), argv[0]);
27
28   CpvInitialize(int, _traceCoreBufferSize);
29         CpvAccess(_traceCoreBufferSize) = TRACE_CORE_BUFFER_SIZE;
30
31   CpvInitialize(double, _traceCoreInitTime);
32         CpvAccess(_traceCoreInitTime) = TRACE_CORE_TIMER();
33
34   CpvInitialize(TraceCore*, _traceCore);
35         CpvAccess(_traceCore) = new TraceCore();
36 }
37
38 /* End Core Trace Module */
39 //TODO
40 extern "C" void closeTraceCore() {}
41
42 /* Resume Core Trace Module */
43 //TODO
44 extern "C" void resumeTraceCore() {}
45
46 /* Tracing API */
47 extern "C" void RegisterLanguage(int lID)
48 { CpvAccess(_traceCore)->RegisterLanguage(lID); }
49
50 extern "C" void RegisterEvent(int lID, int eID)
51 { CpvAccess(_traceCore)->RegisterEvent(lID, eID); }
52
53 extern "C" void LogEvent(int lID, int eID)
54 { CpvAccess(_traceCore)->LogEvent(lID, eID); }
55
56 extern "C" void LogEvent1(int lID, int eID, int iLen, int* iData)
57 { CpvAccess(_traceCore)->LogEvent(lID, eID, iLen, iData); }
58
59 extern "C" void LogEvent2(int lID, int eID, int sLen, char* sData)
60 { CpvAccess(_traceCore)->LogEvent(lID, eID, sLen, sData); }
61
62 extern "C" void LogEvent3(int lID, int eID, int iLen, int* iData, int sLen, char* sData)
63 { CpvAccess(_traceCore)->LogEvent(lID, eID, iLen, iData, sLen, sData); }
64
65
66