00001 #ifndef ___OFS_TRACE_H___
00002 #define ___OFS_TRACE_H___
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033 #ifndef NODEBUG
00034
00035 #include "XrdSys/XrdSysHeaders.hh"
00036 #include "XrdOfs/XrdOfs.hh"
00037
00038 #define GTRACE(act) OfsTrace.What & TRACE_ ## act
00039
00040 #define TRACES(x) \
00041 {OfsTrace.Beg(epname,tident); cerr <<x; OfsTrace.End();}
00042
00043 #define FTRACE(act, x) \
00044 if (GTRACE(act)) \
00045 TRACES(x <<" fn=" << (oh->Name()))
00046
00047 #define XTRACE(act, target, x) \
00048 if (GTRACE(act)) TRACES(x <<" fn=" <<target)
00049
00050 #define ZTRACE(act, x) if (GTRACE(act)) TRACES(x)
00051
00052 #define DEBUG(x) if (GTRACE(debug)) TRACES(x)
00053
00054 #define EPNAME(x) static const char *epname = x;
00055
00056 #else
00057
00058 #define FTRACE(x, y)
00059 #define GTRACE(x) 0
00060 #define TRACES(x)
00061 #define XTRACE(x, y, a1)
00062 #define YTRACE(x, y, a1, a2, a3, a4, a5)
00063 #define ZTRACE(x, y)
00064 #define DEBUG(x)
00065 #define EPNAME(x)
00066
00067 #endif
00068
00069
00070
00071 #define TRACE_MOST 0x3fcd
00072 #define TRACE_ALL 0xffff
00073 #define TRACE_opendir 0x0001
00074 #define TRACE_readdir 0x0002
00075 #define TRACE_closedir TRACE_opendir
00076 #define TRACE_delay 0x0400
00077 #define TRACE_dir TRACE_opendir | TRACE_readdir | TRACE_closedir
00078 #define TRACE_open 0x0004
00079 #define TRACE_qscan 0x0008
00080 #define TRACE_close TRACE_open
00081 #define TRACE_read 0x0010
00082 #define TRACE_redirect 0x0800
00083 #define TRACE_write 0x0020
00084 #define TRACE_IO TRACE_read | TRACE_write | TRACE_aio
00085 #define TRACE_exists 0x0040
00086 #define TRACE_chmod TRACE_exists
00087 #define TRACE_getmode TRACE_exists
00088 #define TRACE_getsize TRACE_exists
00089 #define TRACE_remove 0x0080
00090 #define TRACE_rename TRACE_remove
00091 #define TRACE_sync 0x0100
00092 #define TRACE_truncate 0x0200
00093 #define TRACE_fsctl 0x0400
00094 #define TRACE_getstats 0x0800
00095 #define TRACE_mkdir 0x1000
00096 #define TRACE_stat 0x2000
00097 #define TRACE_aio 0x4000
00098 #define TRACE_debug 0x8000
00099
00100 #endif