1 #ifndef __BCTRACE_INC__
2 #define __BCTRACE_INC__
29 trace_info() { trace = 0; }
45 #define TRACE(text) BC_Trace::new_trace(text);
46 #define SET_TRACE BC_Trace::new_trace(__FILE__, __FUNCTION__, __LINE__);
47 #define PRINT_TRACE { printf("%s: %d\n", __FILE__, __LINE__); fflush(stdout); }
49 #define UNTRACE BC_Trace::delete_traces();
55 #define PRINT_TRACE { printf("%s: %d\n", __FILE__, __LINE__); fflush(stdout); }
56 //#define PRINT_TRACE ;
63 // Before user acquires
64 #define SET_LOCK(info, title, location) \
65 int table_id = BC_Trace::set_lock(title, location, info);
66 // After successful acquisition of a mutex, the table is flagged
67 #define SET_LOCK2 BC_Trace::set_lock2(table_id, this);
68 // After successful acquisition of a condition, the table is removed because
69 // the user never unlocks a condition after locking it.
70 // Release current lock table after failing to acquire
71 #define UNSET_LOCK2 BC_Trace::unset_lock2(table_id, this);
73 // Release current owner of lock
74 #define UNSET_LOCK(info) BC_Trace::unset_lock(info);
76 #define UNSET_ALL_LOCKS(info) BC_Trace::unset_all_locks(info);
78 #define LOCK_LOCKS(s) BC_Trace::lock_locks(s);
79 #define UNLOCK_LOCKS BC_Trace::unlock_locks();
80 #define CLEAR_LOCKS_TID(tid) BC_Trace::clear_locks_tid(tid);
84 #define SET_LOCK(title, location) ;
86 #define SET_LOCK2_CONDITION ;
87 #define UNSET_LOCK(info) ;
89 #define UNSET_ALL_LOCKS(info) ;
91 #define LOCK_LOCKS(s) ;
92 #define UNLOCK_LOCKS ;
93 #define CLEAR_LOCKS_TID(tid) ;
99 #define ENABLE_BUFFER BC_Trace::enable_memory();
100 #define DISABLE_BUFFER BC_Trace::disable_memory();
101 // Note the size, pointer, and location of an allocation
102 #define BUFFER(size, ptr, location) BC_Trace::set_buffer(size, ptr, location);
103 // Note the pointer and location of an allocation
104 #define BUFFER2(ptr, location) BC_Trace::set_buffer(0, ptr, location);
105 // Remove a pointer from the allocation table
106 #define UNBUFFER(ptr) BC_Trace::unset_buffer(ptr);
110 #define ENABLE_BUFFER ;
111 #define DISABLE_BUFFER ;
112 #define BUFFER(size, ptr, location);
113 #define UNBUFFER(ptr);
117 // Handling of temporary files in crash
118 #define SET_TEMP BC_Trace::set_temp
119 #define UNSET_TEMP BC_Trace::unset_temp