Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-01-08 10:33:33

0001 #ifndef ___OFS_TRACE_H___
0002 #define ___OFS_TRACE_H___
0003 /******************************************************************************/
0004 /*                                                                            */
0005 /*                        X r d O f s T r a c e . h h                         */
0006 /*                                                                            */
0007 /* (C) 2003 by the Board of Trustees of the Leland Stanford, Jr., University  */
0008 /*                            All Rights Reserved                             */
0009 /*   Produced by Andrew Hanushevsky for Stanford University under contract    */
0010 /*               DE-AC02-76-SFO0515 with the Deprtment of Energy              */
0011 /*                                                                            */
0012 /* This file is part of the XRootD software suite.                            */
0013 /*                                                                            */
0014 /* XRootD is free software: you can redistribute it and/or modify it under    */
0015 /* the terms of the GNU Lesser General Public License as published by the     */
0016 /* Free Software Foundation, either version 3 of the License, or (at your     */
0017 /* option) any later version.                                                 */
0018 /*                                                                            */
0019 /* XRootD is distributed in the hope that it will be useful, but WITHOUT      */
0020 /* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or      */
0021 /* FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public       */
0022 /* License for more details.                                                  */
0023 /*                                                                            */
0024 /* You should have received a copy of the GNU Lesser General Public License   */
0025 /* along with XRootD in a file called COPYING.LESSER (LGPL license) and file  */
0026 /* COPYING (GPL license).  If not, see <http://www.gnu.org/licenses/>.        */
0027 /*                                                                            */
0028 /* The copyright holder's institutional names and contributor's names may not */
0029 /* be used to endorse or promote products derived from this software without  */
0030 /* specific prior written permission of the institution or contributor.       */
0031 /******************************************************************************/
0032 
0033 #ifndef NODEBUG
0034 
0035 #include "XrdSys/XrdSysHeaders.hh"
0036 #include "XrdSys/XrdSysTrace.hh"
0037 #include "XrdOfs/XrdOfs.hh"
0038 
0039 #define GTRACE(act)         OfsTrace.What & TRACE_ ## act
0040 
0041 #define TRACES(x) {SYSTRACE(OfsTrace.,tident,epname,0,x)}
0042 
0043 #define FTRACE(act, x) \
0044    if (GTRACE(act)) \
0045       TRACES(x <<" fn=" << (oh->Name()))
0046 
0047 #define XTRACE(act, target, x) \
0048    if (GTRACE(act)) TRACES(x <<" fn=" <<target)
0049 
0050 #define ZTRACE(act, x) if (GTRACE(act)) TRACES(x)
0051 
0052 #define DEBUG(x) if (GTRACE(debug)) TRACES(x)
0053 
0054 #define EPNAME(x) static const char *epname = x;
0055 
0056 #else
0057 
0058 #define FTRACE(x, y)
0059 #define GTRACE(x)    0
0060 #define TRACES(x)
0061 #define XTRACE(x, y, a1)
0062 #define YTRACE(x, y, a1, a2, a3, a4, a5)
0063 #define ZTRACE(x, y)
0064 #define DEBUG(x)
0065 #define EPNAME(x)
0066 
0067 #endif
0068 
0069 // Trace flags
0070 //
0071 #define TRACE_MOST     0x3fcd
0072 #define TRACE_ALL      0xffff
0073 #define TRACE_opendir  0x0001
0074 #define TRACE_readdir  0x0002
0075 #define TRACE_closedir TRACE_opendir
0076 #define TRACE_delay    0x0400
0077 #define TRACE_dir      TRACE_opendir | TRACE_readdir | TRACE_closedir
0078 #define TRACE_open     0x0004
0079 #define TRACE_qscan    0x0008
0080 #define TRACE_close    TRACE_open
0081 #define TRACE_read     0x0010
0082 #define TRACE_redirect 0x0800
0083 #define TRACE_write    0x0020
0084 #define TRACE_IO       TRACE_read | TRACE_write | TRACE_aio
0085 #define TRACE_exists   0x0040
0086 #define TRACE_chmod    TRACE_exists
0087 #define TRACE_getmode  TRACE_exists
0088 #define TRACE_getsize  TRACE_exists
0089 #define TRACE_remove   0x0080
0090 #define TRACE_rename   TRACE_remove
0091 #define TRACE_sync     0x0100
0092 #define TRACE_truncate 0x0200
0093 #define TRACE_fsctl    0x0400
0094 #define TRACE_getstats 0x0800
0095 #define TRACE_mkdir    0x1000
0096 #define TRACE_stat     0x2000
0097 #define TRACE_aio      0x4000
0098 #define TRACE_debug    0x008000
0099 #define TRACE_chkpnt   0x010000
0100 
0101 #endif