projector files
[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(char*, _traceCoreRoot);
11 CpvDeclare(int, _traceCoreBufferSize);
12 CpvDeclare(TraceCore*, _traceCore);
13
14 /* Initialize TraceCore Module */
15 //TODO decide parameters from command line
16 extern "C" void initTraceCore(char** argv)
17 {
18   CpvInitialize(int, _traceCoreOn);
19         CpvAccess(_traceCoreOn) = 0;
20
21   CpvInitialize(char*, _traceCoreRoot);
22         CpvAccess(_traceCoreRoot) = (char *) malloc(strlen(argv[0])+1);
23         _MEMCHECK(CpvAccess(_traceCoreRoot));
24         strcpy(CpvAccess(_traceCoreRoot), argv[0]);
25
26   CpvInitialize(int, _traceCoreBufferSize);
27         CpvAccess(_traceCoreBufferSize) = TRACE_CORE_BUFFER_SIZE;
28
29   CpvInitialize(double, _traceCoreInitTime);
30         CpvAccess(_traceCoreInitTime) = TRACE_CORE_TIMER();
31
32   CpvInitialize(TraceCore*, _traceCore);
33         CpvAccess(_traceCore) = new TraceCore();
34 }
35
36 /* End Core Trace Module */
37 //TODO
38 extern "C" void closeTraceCore() {}
39
40 /* Resume Core Trace Module */
41 //TODO
42 extern "C" void resumeTraceCore() {}
43
44 /* Tracing API */
45 extern "C" void RegisterLanguage(int lID)
46 { CpvAccess(_traceCore)->RegisterLanguage(lID); }
47
48 extern "C" void RegisterEvent(int lID, int eID)
49 { CpvAccess(_traceCore)->RegisterEvent(lID, eID); }
50
51 extern "C" void LogEvent(int lID, int eID)
52 { CpvAccess(_traceCore)->LogEvent(lID, eID); }
53
54
55