00001
00002
00003
00004
00005
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 #define D_SYSCALL (1LL<<0)
00045 #define D_CHANNEL (1LL<<1)
00046 #define D_PROCESS (1LL<<2)
00047 #define D_NOTICE (1LL<<3)
00048 #define D_RESOLVE (1LL<<4)
00049 #define D_LIBCALL (1LL<<5)
00050 #define D_LOCAL (1LL<<6)
00051 #define D_DNS (1LL<<7)
00052 #define D_TCP (1LL<<8)
00053 #define D_AUTH (1LL<<9)
00054 #define D_IRODS (1LL<<10)
00055 #define D_CVMFS (1LL<<11)
00056 #define D_HTTP (1LL<<12)
00057 #define D_FTP (1LL<<13)
00058 #define D_NEST (1LL<<14)
00059 #define D_GROW (1LL<<15)
00060 #define D_CHIRP (1LL<<16)
00061 #define D_DCAP (1LL<<17)
00062 #define D_RFIO (1LL<<18)
00063 #define D_GLITE (1LL<<19)
00064 #define D_MULTI (1LL<<20)
00065 #define D_PSTREE (1LL<<21)
00066 #define D_ALLOC (1LL<<22)
00067 #define D_LFC (1LL<<23)
00068 #define D_GFAL (1LL<<24)
00069 #define D_SUMMARY (1LL<<25)
00070 #define D_DEBUG (1LL<<26)
00071 #define D_LOGIN (1LL<<27)
00072 #define D_CACHE (1LL<<28)
00073 #define D_POLL (1LL<<29)
00074 #define D_HDFS (1LL<<30)
00075 #define D_WQ (1LL<<31)
00076 #define D_BXGRID (1LL<<32)
00077 #define D_USER (1LL<<33)
00078 #define D_XROOTD (1LL<<34)
00079 #define D_MPI (1LL<<35)
00080 #define D_BATCH (1LL<<36)
00081 #define D_RMON (1LL<<37)
00084 #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)
00085
00087 #define D_ALL (~(0LL))
00088
00089
00090
00091
00092
00093
00094
00095
00096 #define debug cctools_debug
00097 #define fatal cctools_fatal
00098 #define warn cctools_warn
00099 #define debug_config cctools_debug_config
00100 #define debug_config_file cctools_debug_config_file
00101 #define debug_config_file_size cctools_debug_config_file_size
00102 #define debug_config_fatal cctools_debug_config_fatal
00103 #define debug_config_getpid cctools_debug_config_getpid
00104 #define debug_flags_set cctools_debug_flags_set
00105 #define debug_flags_print cctools_debug_flags_print
00106 #define debug_flags_clear cctools_debug_flags_clear
00107 #define debug_flags_restore cctools_debug_flags_restore
00108 #define debug_set_flag_name cctools_debug_set_flag_name
00109
00116 void debug(INT64_T flags, const char *fmt, ...)
00117 #ifndef SWIG
00118 __attribute__ (( format(printf,2,3) ))
00119 #endif
00120 ;
00121
00129 void vdebug(INT64_T flags, const char *fmt, va_list args);
00130
00137 void warn(INT64_T flags, const char *fmt, ...);
00138
00144 void fatal(const char *fmt, ...);
00145
00151 void debug_config(const char *name);
00152
00159 void debug_config_file(const char *file);
00160
00168 void debug_config_file_size(size_t size);
00169
00170 void debug_config_fatal(void (*callback) (void));
00171 void debug_config_getpid(pid_t(*getpidfunc) (void));
00172
00181 int debug_flags_set(const char *flagname);
00182
00189 void debug_flags_print(FILE * stream);
00190
00196 INT64_T debug_flags_clear(void);
00197
00204 void debug_set_flag_name(INT64_T flag, const char *name);
00205
00209 void debug_flags_restore(INT64_T flags);
00210
00211 #endif