debug.h

Go to the documentation of this file.
00001 /*
00002 Copyright (C) 2003-2004 Douglas Thain and the University of Wisconsin
00003 Copyright (C) 2005- The University of Notre Dame
00004 This software is distributed under the GNU General Public License.
00005 See the file COPYING for details.
00006 */
00007 
00008 #ifndef DEBUG_H
00009 #define DEBUG_H
00010 
00035 #include "int_sizes.h"
00036 
00037 #include <unistd.h>
00038 
00039 #include <sys/types.h>
00040 
00041 #include <stdarg.h>
00042 #include <stdio.h>
00043 
00044 /* priority */
00045 #define D_INFO     (0LL)     
00046 #define D_FATAL    (1LL<<0)  
00047 #define D_ERROR    (1LL<<1)  
00048 #define D_NOTICE   (1LL<<2)  
00049 #define D_DEBUG    (1LL<<3)  
00051 /* subsystem */
00052 #define D_SYSCALL  (1LL<<4)  
00053 #define D_CHANNEL  (1LL<<5)  
00054 #define D_PROCESS  (1LL<<6)  
00055 #define D_RESOLVE  (1LL<<7)  
00056 #define D_LIBCALL  (1LL<<8)  
00057 #define D_LOCAL    (1LL<<9)  
00058 #define D_DNS      (1LL<<10)  
00059 #define D_TCP      (1LL<<11)  
00060 #define D_AUTH     (1LL<<12)  
00061 #define D_IRODS    (1LL<<13)  
00062 #define D_CVMFS    (1LL<<14)  
00063 #define D_HTTP     (1LL<<15)  
00064 #define D_FTP      (1LL<<16)  
00065 #define D_NEST     (1LL<<17)  
00066 #define D_GROW     (1LL<<18)  
00067 #define D_CHIRP    (1LL<<19)  
00068 #define D_DCAP     (1LL<<20)  
00069 #define D_RFIO     (1LL<<21)  
00070 #define D_GLITE    (1LL<<22)  
00071 #define D_MULTI    (1LL<<23)  
00072 #define D_PSTREE   (1LL<<24)  
00073 #define D_ALLOC    (1LL<<25)  
00074 #define D_LFC      (1LL<<26)  
00075 #define D_GFAL     (1LL<<27)  
00076 #define D_SUMMARY  (1LL<<28)  
00077 #define D_LOGIN    (1LL<<29)  
00078 #define D_CACHE    (1LL<<30)  
00079 #define D_POLL     (1LL<<31)  
00080 #define D_HDFS     (1LL<<32)  
00081 #define D_WQ       (1LL<<33)  
00082 #define D_BXGRID   (1LL<<34)  
00083 #define D_USER     (1LL<<35)  
00084 #define D_XROOTD   (1LL<<36)  
00085 #define D_MPI      (1LL<<37)  
00086 #define D_BATCH    (1LL<<38)  
00087 #define D_RMON     (1LL<<39)  
00088 #define D_MAKEFLOW_RUN    (1LL<<40)  
00089 #define D_MAKEFLOW_LEXER  (1LL<<41)  
00090 #define D_MAKEFLOW_PARSER (1LL<<42)  
00093 #define D_REMOTE   (D_HTTP|D_FTP|D_NEST|D_CHIRP|D_DCAP|D_RFIO|D_LFC|D_GFAL|D_MULTI|D_GROW|D_IRODS|D_HDFS|D_BXGRID|D_XROOTD|D_CVMFS)
00094         
00096 #define D_MAKEFLOW    (D_MAKEFLOW_RUN|D_MAKEFLOW_LEXER|D_MAKEFLOW_PARSER)
00097 
00099 #define D_ALL      (~(0LL))
00100 
00101 /*
00102 It turns out that many libraries and tools make use of symbols like "debug" and
00103 "fatal".  This causes strange failures when we link against such codes.  Rather
00104 than change all of our code, we simply insert these defines to transparently
00105 modify the linker namespace we are using.
00106 */
00107 
00108 #define debug                  cctools_debug
00109 #define fatal                  cctools_fatal
00110 #define warn                   cctools_warn
00111 #define debug_config           cctools_debug_config
00112 #define debug_config_file      cctools_debug_config_file
00113 #define debug_config_file_size cctools_debug_config_file_size
00114 #define debug_config_fatal     cctools_debug_config_fatal
00115 #define debug_config_getpid    cctools_debug_config_getpid
00116 #define debug_flags_set        cctools_debug_flags_set
00117 #define debug_flags_print      cctools_debug_flags_print
00118 #define debug_flags_clear      cctools_debug_flags_clear
00119 #define debug_flags_restore    cctools_debug_flags_restore
00120 #define debug_set_flag_name    cctools_debug_set_flag_name
00121 #define debug_rename           cctools_debug_rename
00122 
00129 void debug(INT64_T flags, const char *fmt, ...)
00130 #ifndef SWIG
00131 __attribute__ (( format(printf,2,3) ))
00132 #endif
00133 ;
00134 
00142 void vdebug(INT64_T flags, const char *fmt, va_list args);
00143 
00150 void warn(INT64_T flags, const char *fmt, ...);
00151 
00157 void fatal(const char *fmt, ...);
00158 
00164 void debug_config(const char *name);
00165 
00172 void debug_config_file(const char *file);
00173 
00181 void debug_config_file_size(off_t size);
00182 
00183 void debug_config_fatal(void (*callback) (void));
00184 
00185 void debug_config_getpid (pid_t (*getpidf)(void));
00186 
00195 int debug_flags_set(const char *flagname);
00196 
00203 void debug_flags_print(FILE * stream);
00204 
00210 INT64_T debug_flags_clear(void);
00211 
00218 void debug_set_flag_name(INT64_T flag, const char *name);
00219 
00223 void debug_flags_restore(INT64_T flags);
00224 
00228 void debug_rename(const char *suffix);
00229 
00232 void debug_reopen(void);
00233 
00234 #endif

Generated on 6 May 2015 for cctools by  doxygen 1.6.1