xrootd
XrdOfsTrace.hh
Go to the documentation of this file.
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-AC02-76-SFO0515 with the Deprtment of Energy              */
00011 /*                                                                            */
00012 /* This file is part of the XRootD software suite.                            */
00013 /*                                                                            */
00014 /* XRootD is free software: you can redistribute it and/or modify it under    */
00015 /* the terms of the GNU Lesser General Public License as published by the     */
00016 /* Free Software Foundation, either version 3 of the License, or (at your     */
00017 /* option) any later version.                                                 */
00018 /*                                                                            */
00019 /* XRootD is distributed in the hope that it will be useful, but WITHOUT      */
00020 /* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or      */
00021 /* FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public       */
00022 /* License for more details.                                                  */
00023 /*                                                                            */
00024 /* You should have received a copy of the GNU Lesser General Public License   */
00025 /* along with XRootD in a file called COPYING.LESSER (LGPL license) and file  */
00026 /* COPYING (GPL license).  If not, see <http://www.gnu.org/licenses/>.        */
00027 /*                                                                            */
00028 /* The copyright holder's institutional names and contributor's names may not */
00029 /* be used to endorse or promote products derived from this software without  */
00030 /* specific prior written permission of the institution or contributor.       */
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 // Trace flags
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