13 #include "vt_inttypes.h"
15 #define IS_POMP_TRACE_ON ( pomp_tracing )
17 extern int pomp_initialized;
18 extern int pomp_tracing;
31 #define GUARDED_ENTER(id) \
32 if ( IS_POMP_TRACE_ON ) { \
33 struct VTRegDescr* data = (struct VTRegDescr*)(r->data); \
34 uint64_t time = vt_pform_wtime(); \
35 vt_enter(VT_CURRENT_THREAD, &time, data->id); \
38 #define GUARDED_ENTER_2(ch,id1,id2) \
39 if ( IS_POMP_TRACE_ON ) { \
40 struct VTRegDescr* data; \
42 data = (struct VTRegDescr*)(r->data); \
43 time = vt_pform_wtime(); \
44 if ( r->name[0] == ch ) \
45 vt_enter(VT_CURRENT_THREAD, &time, data->id1); \
47 vt_enter(VT_CURRENT_THREAD, &time, data->id2); \
50 #define GUARDED_EXIT() \
51 if ( IS_POMP_TRACE_ON ) { \
53 time = vt_pform_wtime(); \
54 vt_exit(VT_CURRENT_THREAD, &time); \
57 #define GUARDED_COLL_ENTER(id) \
58 if ( IS_POMP_TRACE_ON ) { \
59 struct VTRegDescr* data; \
61 data = (struct VTRegDescr*)(r->data); \
62 time = vt_pform_wtime(); \
64 vt_enter(VT_CURRENT_THREAD, &time, data->id); \
67 #define GUARDED_COLL_ENTER_2(ch,id1,id2) \
68 if ( IS_POMP_TRACE_ON ) { \
69 struct VTRegDescr* data; \
71 data = (struct VTRegDescr*)(r->data); \
72 time = vt_pform_wtime(); \
73 if ( r->name[0] == ch ) { \
75 vt_enter(VT_CURRENT_THREAD, &time, data->id1); \
78 vt_enter(VT_CURRENT_THREAD, &time, data->id2); \
82 #define GUARDED_COLL_EXIT() \
83 if ( IS_POMP_TRACE_ON ) { \
85 time = vt_pform_wtime(); \
87 vt_exit(VT_CURRENT_THREAD, &time); \