Distributed Hash Table File System for Linux








debug.h File Reference

#include <syslog.h>

Defines

#define MAGMA_REPORT_DEBUG_FACILITY   0
#define DEBUG_BOOT   1
#define DEBUG_FLARE   2
#define DEBUG_VULCANO   4
#define DEBUG_PFUSE   8
#define DEBUG_PNODE   16
#define DEBUG_PNFS   32
#define DEBUG_DIR   64
#define DEBUG_CACHE   128
#define DEBUG_ROUTING   256
#define DEBUG_BALANCER   512
#define DEBUG_NET   1024
#define DEBUG_UTILS   2048
#define DEBUG_MALLOC   4096
#define DEBUG_MUTEX   8192
#define DEBUG_GARBAGE   16384
#define DEBUG_ERR   32768
#define print_debug_levels()
#define print_debug_mask(mask, res)
#define _DEBUG_SYSLOG   1
#define dbg(facility, type, string,...)
#define init_time_profile()   {}
#define start_time_profile()   {}
#define stop_time_profile()   {}
#define stop_labeled_time_profile(label)   {}
#define oldfree(symbol)   assert(symbol != NULL); dbg(LOG_INFO, "free(%s) at %s:%d", __STRING(symbol), __FILE__, __LINE__); free(symbol);
#define befree(symbol)

Variables

uint16_t debug

Define Documentation

#define _DEBUG_SYSLOG   1

by default debug on syslog

#define befree ( symbol   ) 

Value:

{\
        if (\
                (strcmp(__STRING(symbol),"myself") == 0) ||\
                (strcmp(__STRING(symbol),"&myself") == 0) ||\
                (strcmp(__STRING(symbol),"owner") == 0) ||\
                (strcmp(__STRING(symbol),"node") == 0) \
        ) {\
                dbg(LOG_INFO, "Trying to free(%s) at %s:%d, which is probably wrong!", __STRING(symbol), __FILE__, __LINE__);\
        } else {\
                dbg(LOG_INFO, "free(%s) at %s:%d", __STRING(symbol), __FILE__, __LINE__);\
                assert(symbol != NULL);\
                free(symbol);\
        }\
}

#define dbg ( facility,
type,
string,
...   ) 

Value:

{\
        if (debug & type) syslog(facility,string,## __VA_ARGS__);\
        }

#define DEBUG_BALANCER   512

#define DEBUG_BOOT   1

#define DEBUG_CACHE   128

#define DEBUG_DIR   64

#define DEBUG_ERR   32768

#define DEBUG_FLARE   2

#define DEBUG_GARBAGE   16384

#define DEBUG_MALLOC   4096

#define DEBUG_MUTEX   8192

#define DEBUG_NET   1024

#define DEBUG_PFUSE   8

#define DEBUG_PNFS   32

#define DEBUG_PNODE   16

#define DEBUG_ROUTING   256

#define DEBUG_UTILS   2048

#define DEBUG_VULCANO   4

 
#define init_time_profile (  )     {}

time profiling support code

#define MAGMA_REPORT_DEBUG_FACILITY   0

print a warning @ compile about which debug facility will be used

#define oldfree ( symbol   )     assert(symbol != NULL); dbg(LOG_INFO, "free(%s) at %s:%d", __STRING(symbol), __FILE__, __LINE__); free(symbol);

 
#define print_debug_levels (  ) 

Value:

fprintf(stderr,"\    %.5d.BOOT,    %.5d.FLARE,    %.5d.VULCANO, %.5d.PFUSE,\n\    %.5d.PNODE,   %.5d.PNFS,     %.5d.DIR,     %.5d.CACHE,\n\    %.5d.ROUTING, %.5d.BALANCER, %.5d.NET,     %.5d.UTILS\n\    %.5d.MALLOC,  %.5d.MUTEX,    %.5d.GARBAGE\n",\
    DEBUG_BOOT, DEBUG_FLARE, DEBUG_VULCANO, DEBUG_PFUSE,\
    DEBUG_PNODE, DEBUG_PNFS, DEBUG_DIR, DEBUG_CACHE,\
    DEBUG_ROUTING, DEBUG_BALANCER, DEBUG_NET, DEBUG_UTILS,\
    DEBUG_MALLOC, DEBUG_MUTEX, DEBUG_GARBAGE\
);
just print out which debug levels are enabled

#define print_debug_mask ( mask,
res   ) 

Value:

{\
        res = malloc(1024);\
        if (res != NULL) {\
                memset(res, 0, 1024);\
                if (mask & DEBUG_BOOT) strcat(res, "BOOT, ");\
                if (mask & DEBUG_FLARE) strcat(res, "FLARE, ");\
                if (mask & DEBUG_VULCANO) strcat(res, "VULCANO, ");\
                if (mask & DEBUG_PFUSE) strcat(res, "PFUSE, ");\
                if (mask & DEBUG_PNODE) strcat(res, "PNODE, ");\
                if (mask & DEBUG_PNFS) strcat(res, "PNFS, ");\
                if (mask & DEBUG_DIR) strcat(res, "DIR, ");\
                if (mask & DEBUG_CACHE) strcat(res, "CACHE, ");\
                if (mask & DEBUG_ROUTING) strcat(res, "ROUTING, ");\
                if (mask & DEBUG_BALANCER) strcat(res, "BALANCER, ");\
                if (mask & DEBUG_NET) strcat(res, "NET, ");\
                if (mask & DEBUG_UTILS) strcat(res, "UTILS, ");\
                if (mask & DEBUG_MALLOC) strcat(res, "MALLOC, ");\
                if (mask & DEBUG_MUTEX) strcat(res, "MUTEX, ");\
                if (mask & DEBUG_GARBAGE) strcat(res, "GARBAGE ");\
        }\
}
returns a dynamic string with debug mask translated into human readable strings

 
#define start_time_profile (  )     {}

#define stop_labeled_time_profile ( label   )     {}

 
#define stop_time_profile (  )     {}


Variable Documentation

uint16_t debug

debug mask

This file last modified Wednesday, 09-Jan-2008 20:02:30 CET