doc: Add serial to list of ci file reserved words
[charm.git] / src / conv-core / conv-trace.h
1 #ifndef _CONV_TRACE_H
2 #define _CONV_TRACE_H
3
4 #include "converse.h"
5
6 /* 
7  * These functions are called from Converse, and should be provided C binding
8  * by the tracing strategies.
9  */
10
11 void traceInit(char **argv);
12 void traceCharmInit(char **argv);       /* init trace module in ck */
13 void traceMessageRecv(char *msg, int pe);
14 void traceBeginIdle(void);
15 void traceEndIdle(void);
16 void traceResume(CmiObjId *);
17 void traceSuspend(void);
18 void traceAwaken(CthThread t);
19 void traceUserEvent(int);
20 void traceUserBracketEvent(int, double, double);
21 void traceUserSuppliedData(int);
22 void traceUserSuppliedBracketedNote(char *note, int eventID, double bt, double et);
23 void traceUserSuppliedNote(char*);
24 void traceMemoryUsage();
25 int  traceRegisterUserEvent(const char*, int e
26 #ifdef __cplusplus
27 =-1
28 #endif
29 );
30
31 #if CMK_SMP_TRACE_COMMTHREAD
32 int  traceBeginCommOp(char *msg);
33 void traceEndCommOp(char *msg);
34 void traceSendMsgComm(char *msg);
35 void traceCommSetMsgID(char *msg);
36 #endif
37 void traceChangeLastTimestamp(double ts);
38 void traceGetMsgID(char *msg, int *pe, int *event);
39 void traceSetMsgID(char *msg, int pe, int event);
40
41 /* Support for machine layers to register their user events to projections */
42 void registerMachineUserEventsFunction(void (*eventRegistrationFunc)());
43
44 int traceRegisterFunction(const char*, int idx
45 #ifdef __cplusplus
46 =-999
47 #endif
48 );
49 void traceBeginFuncIndexProj(int, char* file, int);
50 void traceEndFuncIndexProj(int);
51
52 void traceClose(void);
53 void traceCharmClose(void);          /* close trace in ck */
54 void traceBegin(void);
55 void traceEnd(void);
56 void traceWriteSts(void);
57 void traceFlushLog(void);
58
59 #if CMK_TRACE_ENABLED
60 CpvExtern(int, traceOn);
61 #define traceIsOn()  (CpvAccess(traceOn))
62 #else 
63 #define traceIsOn()  0
64 #endif
65
66 int  traceAvailable();
67
68 /* Comm thread tracing */
69 #if CMK_SMP_TRACE_COMMTHREAD
70 #define  TRACE_COMM_CREATION(time, msg)   \
71                     if (traceBeginCommOp(msg)) {   \
72                       traceChangeLastTimestamp(time);    \
73                       traceSendMsgComm(msg);   \
74                       traceEndCommOp(msg);    \
75                     }
76
77 #define  TRACE_COMM_CONTROL_CREATION(time0, time1, time2, msg)   \
78                     if (traceBeginCommOp(msg)) {   \
79                       traceChangeLastTimestamp(time0);    \
80                       traceSendMsgComm(msg);   \
81                       traceChangeLastTimestamp(time1);    \
82                       traceEndCommOp(msg);    \
83                       traceChangeLastTimestamp(time2);    \
84                     }
85
86 #define TRACE_COMM_SET_MSGID(msg, pe, event)  traceSetMsgID(msg, pe, event)
87 #define TRACE_COMM_GET_MSGID(msg, pe, event)  traceGetMsgID(msg, pe, event)
88 #define TRACE_COMM_SET_COMM_MSGID(msg)  traceCommSetMsgID(msg)
89 #else
90 #define TRACE_COMM_CREATION(time, msg)
91 #define TRACE_COMM_CONTROL_CREATION(time0, time1, time2, msg)
92 #define TRACE_COMM_SET_MSGID(msg, pe, event) 
93 #define TRACE_COMM_GET_MSGID(msg, pe, event) 
94 #define TRACE_COMM_SET_COMM_MSGID(msg)
95 #endif
96
97 #endif