1 #ifndef __BCTRACE_INC__
2 #define __BCTRACE_INC__
30 trace_info() { trace = 0; owner = 0; }
48 #define TRACE(text) BC_Trace::new_trace(text);
49 #define SET_TRACE BC_Trace::new_trace(__FILE__, __FUNCTION__, __LINE__);
50 #define PRINT_TRACE { printf("%s: %d\n", __FILE__, __LINE__); fflush(stdout); }
52 #define UNTRACE BC_Trace::delete_traces();
58 #define PRINT_TRACE { printf("%s: %d\n", __FILE__, __LINE__); fflush(stdout); }
59 //#define PRINT_TRACE ;
66 // Before user acquires
67 #define SET_LOCK(info, title, location) \
68 int table_id = BC_Trace::set_lock(title, location, info);
69 // After successful acquisition of a mutex, the table is flagged
70 #define SET_LOCK2 BC_Trace::set_lock2(table_id, this);
71 // After successful acquisition of a condition, the table is removed because
72 // the user never unlocks a condition after locking it.
73 // Release current lock table after failing to acquire
74 #define UNSET_LOCK2 BC_Trace::unset_lock2(table_id, this);
76 // Release current owner of lock
77 #define UNSET_LOCK(info) BC_Trace::unset_lock(info);
79 #define UNSET_ALL_LOCKS(info) BC_Trace::unset_all_locks(info);
81 #define LOCK_LOCKS(s) BC_Trace::lock_locks(s);
82 #define UNLOCK_LOCKS BC_Trace::unlock_locks();
83 #define CLEAR_LOCKS_TID(tid) BC_Trace::clear_locks_tid(tid);
87 #define SET_LOCK(title, location) ;
89 #define SET_LOCK2_CONDITION ;
90 #define UNSET_LOCK(info) ;
92 #define UNSET_ALL_LOCKS(info) ;
94 #define LOCK_LOCKS(s) ;
95 #define UNLOCK_LOCKS ;
96 #define CLEAR_LOCKS_TID(tid) ;
102 #define ENABLE_BUFFER BC_Trace::enable_memory();
103 #define DISABLE_BUFFER BC_Trace::disable_memory();
104 // Note the size, pointer, and location of an allocation
105 #define BUFFER(size, ptr, location) BC_Trace::set_buffer(size, ptr, location);
106 // Note the pointer and location of an allocation
107 #define BUFFER2(ptr, location) BC_Trace::set_buffer(0, ptr, location);
108 // Remove a pointer from the allocation table
109 #define UNBUFFER(ptr) BC_Trace::unset_buffer(ptr);
113 #define ENABLE_BUFFER ;
114 #define DISABLE_BUFFER ;
115 #define BUFFER(size, ptr, location);
116 #define UNBUFFER(ptr);
120 // Handling of temporary files in crash
121 #define SET_TEMP BC_Trace::set_temp
122 #define UNSET_TEMP BC_Trace::unset_temp