xrootd
|
00001 #ifndef ___OFS_TRACE_H___ 00002 #define ___OFS_TRACE_H___ 00003 /******************************************************************************/ 00004 /* */ 00005 /* X r d O f s T r a c e . h h */ 00006 /* */ 00007 /* (C) 2003 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-AC03-76-SFO0515 with the Deprtment of Energy */ 00011 /******************************************************************************/ 00012 00013 // $Id$ 00014 00015 #ifndef NODEBUG 00016 00017 #include "XrdSys/XrdSysHeaders.hh" 00018 #include "XrdOfs/XrdOfs.hh" 00019 00020 #define GTRACE(act) OfsTrace.What & TRACE_ ## act 00021 00022 #define TRACES(x) \ 00023 {OfsTrace.Beg(epname,tident); cerr <<x; OfsTrace.End();} 00024 00025 #define FTRACE(act, x) \ 00026 if (GTRACE(act)) \ 00027 TRACES(x <<" fn=" << (oh->Name())) 00028 00029 #define XTRACE(act, target, x) \ 00030 if (GTRACE(act)) TRACES(x <<" fn=" <<target) 00031 00032 #define ZTRACE(act, x) if (GTRACE(act)) TRACES(x) 00033 00034 #define DEBUG(x) if (GTRACE(debug)) TRACES(x) 00035 00036 #define EPNAME(x) static const char *epname = x; 00037 00038 #else 00039 00040 #define FTRACE(x, y) 00041 #define GTRACE(x) 0 00042 #define TRACES(x) 00043 #define XTRACE(x, y, a1) 00044 #define YTRACE(x, y, a1, a2, a3, a4, a5) 00045 #define ZTRACE(x, y) 00046 #define DEBUG(x) 00047 #define EPNAME(x) 00048 00049 #endif 00050 00051 // Trace flags 00052 // 00053 #define TRACE_MOST 0x3fcd 00054 #define TRACE_ALL 0xffff 00055 #define TRACE_opendir 0x0001 00056 #define TRACE_readdir 0x0002 00057 #define TRACE_closedir TRACE_opendir 00058 #define TRACE_delay 0x0400 00059 #define TRACE_dir TRACE_opendir | TRACE_readdir | TRACE_closedir 00060 #define TRACE_open 0x0004 00061 #define TRACE_qscan 0x0008 00062 #define TRACE_close TRACE_open 00063 #define TRACE_read 0x0010 00064 #define TRACE_redirect 0x0800 00065 #define TRACE_write 0x0020 00066 #define TRACE_IO TRACE_read | TRACE_write | TRACE_aio 00067 #define TRACE_exists 0x0040 00068 #define TRACE_chmod TRACE_exists 00069 #define TRACE_getmode TRACE_exists 00070 #define TRACE_getsize TRACE_exists 00071 #define TRACE_remove 0x0080 00072 #define TRACE_rename TRACE_remove 00073 #define TRACE_sync 0x0100 00074 #define TRACE_truncate 0x0200 00075 #define TRACE_fsctl 0x0400 00076 #define TRACE_getstats 0x0800 00077 #define TRACE_mkdir 0x1000 00078 #define TRACE_stat 0x2000 00079 #define TRACE_aio 0x4000 00080 #define TRACE_debug 0x8000 00081 00082 #endif