xrootd
|
00001 #ifndef ___BWM_TRACE_H___ 00002 #define ___BWM_TRACE_H___ 00003 /******************************************************************************/ 00004 /* */ 00005 /* X r d B w m T r a c e . h h */ 00006 /* */ 00007 /* (C) 2008 by the Board of Trustees of the Leland Stanford, Jr., University */ 00008 /* All Rights Reserved */ 00009 /* Produced by Andrew Hanushevsky for Stanford University under contract */ 00010 /* DE-AC02-76-SFO0515 with the Deprtment of Energy */ 00011 /******************************************************************************/ 00012 00013 // $Id$ 00014 00015 #ifndef NODEBUG 00016 00017 #include "XrdSys/XrdSysHeaders.hh" 00018 #include "XrdOuc/XrdOucTrace.hh" 00019 00020 extern XrdOucTrace BwmTrace; 00021 00022 #define GTRACE(act) BwmTrace.What & TRACE_ ## act 00023 00024 #define TRACES(x) \ 00025 {BwmTrace.Beg(epname,tident); cerr <<x; BwmTrace.End();} 00026 00027 #define FTRACE(act, x) \ 00028 if (GTRACE(act)) \ 00029 TRACES(x <<" fn=" << (oh->Name())) 00030 00031 #define XTRACE(act, target, x) \ 00032 if (GTRACE(act)) TRACES(x <<" fn=" <<target) 00033 00034 #define ZTRACE(act, x) if (GTRACE(act)) TRACES(x) 00035 00036 #define DEBUG(x) if (GTRACE(debug)) TRACES(x) 00037 00038 #define EPNAME(x) static const char *epname = x; 00039 00040 #else 00041 00042 #define FTRACE(x, y) 00043 #define GTRACE(x) 0 00044 #define TRACES(x) 00045 #define XTRACE(x, y, a1) 00046 #define YTRACE(x, y, a1, a2, a3, a4, a5) 00047 #define ZTRACE(x, y) 00048 #define DEBUG(x) 00049 #define EPNAME(x) 00050 00051 #endif 00052 00053 // Trace flags 00054 // 00055 #define TRACE_ALL 0xffff 00056 #define TRACE_calls 0x0001 00057 #define TRACE_delay 0x0002 00058 #define TRACE_sched 0x0004 00059 #define TRACE_tokens 0x0008 00060 #define TRACE_debug 0x8000 00061 00062 #endif