00001 #ifndef _CONV_TRACE_H
00002 #define _CONV_TRACE_H
00003
00004 #include "converse.h"
00005
00006 #ifdef __cplusplus
00007 extern "C" {
00008 #endif
00009
00010
00011
00012
00013
00014
00015 void traceInit(char **argv);
00016 void traceCharmInit(char **argv);
00017 void traceMessageRecv(char *msg, int pe);
00018 void traceBeginIdle(void);
00019 void traceEndIdle(void);
00020 void traceResume(int,int,CmiObjId *);
00021 void traceSuspend(void);
00022 void traceAwaken(CthThread t);
00023 void traceUserEvent(int);
00024 void beginAppWork(void);
00025 void endAppWork(void);
00026 void beginTuneOverhead(void);
00027 void endTuneOverhead(void);
00028 void traceUserBracketEvent(int, double, double);
00029 void traceUserBracketEventNestedID(int, double, double, int nestedID);
00030 void traceBeginUserBracketEvent(int eventID);
00031 void traceBeginUserBracketEventNestedID(int eventID, int nestedID);
00032 void traceEndUserBracketEvent(int eventID);
00033 void traceEndUserBracketEventNestedID(int eventID, int nestedID);
00034 void traceUserSuppliedData(int);
00035 void traceUserSuppliedBracketedNote(const char *note, int eventID, double bt, double et);
00036 void traceUserSuppliedNote(const char*);
00037 void traceMemoryUsage(void);
00038 int traceRegisterUserEvent(const char*, int e
00039 #ifdef __cplusplus
00040 =-1
00041 #endif
00042 );
00043
00044
00045 int traceRegisterUserStat(const char *evt, int e);
00046 void updateStatPair(int e, double stat, double time);
00047 void updateStat(int e, double stat);
00048
00049 #if CMK_SMP_TRACE_COMMTHREAD
00050 int traceBeginCommOp(char *msg);
00051 void traceEndCommOp(char *msg);
00052 void traceSendMsgComm(char *msg);
00053 void traceCommSetMsgID(char *msg);
00054 #endif
00055 void traceChangeLastTimestamp(double ts);
00056 void traceGetMsgID(char *msg, int *pe, int *event);
00057 void traceSetMsgID(char *msg, int pe, int event);
00058
00059
00060 void registerMachineUserEventsFunction(void (*eventRegistrationFunc)(void));
00061
00062 void traceClose(void);
00063 void traceCharmClose(void);
00064 void traceBegin(void);
00065 void traceEnd(void);
00066 void traceBeginComm(void);
00067 void traceEndComm(void);
00068 void traceWriteSts(void);
00069 void traceFlushLog(void);
00070
00071 #if CMK_TRACE_ENABLED
00072 CpvExtern(int, traceOn);
00073 #define traceIsOn() (CpvAccess(traceOn))
00074 #else
00075 #define traceIsOn() 0
00076 #endif
00077
00078 int traceAvailable(void);
00079
00080
00081 #if CMK_SMP_TRACE_COMMTHREAD
00082 #define TRACE_COMM_CREATION(time, msg) \
00083 if (traceBeginCommOp(msg)) { \
00084 traceChangeLastTimestamp(time); \
00085 traceSendMsgComm(msg); \
00086 traceEndCommOp(msg); \
00087 }
00088
00089 #define TRACE_COMM_CONTROL_CREATION(time0, time1, time2, msg) \
00090 if (traceBeginCommOp(msg)) { \
00091 traceChangeLastTimestamp(time0); \
00092 traceSendMsgComm(msg); \
00093 traceChangeLastTimestamp(time1); \
00094 traceEndCommOp(msg); \
00095 traceChangeLastTimestamp(time2); \
00096 }
00097
00098 #define TRACE_COMM_SET_MSGID(msg, pe, event) traceSetMsgID(msg, pe, event)
00099 #define TRACE_COMM_GET_MSGID(msg, pe, event) traceGetMsgID(msg, pe, event)
00100 #define TRACE_COMM_SET_COMM_MSGID(msg) traceCommSetMsgID(msg)
00101 #else
00102 #define TRACE_COMM_CREATION(time, msg)
00103 #define TRACE_COMM_CONTROL_CREATION(time0, time1, time2, msg)
00104 #define TRACE_COMM_SET_MSGID(msg, pe, event)
00105 #define TRACE_COMM_GET_MSGID(msg, pe, event)
00106 #define TRACE_COMM_SET_COMM_MSGID(msg)
00107 #endif
00108
00109 #ifdef __cplusplus
00110 }
00111 #endif
00112
00113 #endif