#include <time.h>
#include <stdio.h>
#include <errno.h>
#include <sys/types.h>
#include <sys/time.h>
#include <unistd.h>
Include dependency graph for debug.h:
This graph shows which files directly or indirectly include this file:
Go to the source code of this file.
Defines | |
#define | dassert(x) |
#define | dperror(x) |
#define | dtest(args...) |
#define | dprintk(args...) |
#define | dhexdump(args...) |
#define | printk(args...) |
#define | IF_FAIL_ERRNO(condition, args...) |
#define | handle_errno(x) if((x)<0) do { fprintf(stderr, "%s (%s:%d)] %s\n", __FUNCTION__, __FILE__, __LINE__, strerror(errno)); abort(); } while(0) |
#define dassert | ( | x | ) |
Value:
do { if(!(x)) { \ struct timeval tv; struct tm tm; time_t now; \ time(&now); localtime_r(&now, &tm); gettimeofday(&tv, NULL); \ fprintf(stderr, "%02d%02d%02d.%08d:%5d %s (%s:%d] failed assertion '%s'\n", \ tm.tm_hour, tm.tm_min, tm.tm_sec, (int)tv.tv_usec, getpid(), __FUNCTION__, \ __FILE__, __LINE__, #x); abort(); } } while(0)
Definition at line 11 of file debug.h.
Referenced by cque_deque(), cque_enqueue(), do_top(), do_unauth_command(), and mmdb_db_read().
#define dperror | ( | x | ) |
Value:
do { if(x) { \ struct timeval tv; struct tm tm; time_t now; \ time(&now); localtime_r(&now, &tm); gettimeofday(&tv, NULL); \ fprintf(stderr, "%02d%02d%02d.%08d:%5d %s (%s:%d] '%s' failed with '%s'\n", \ tm.tm_hour, tm.tm_min, tm.tm_sec, (int)tv.tv_usec, getpid(), __FUNCTION__, \ __FILE__, __LINE__, #x, strerror(errno)); } } while(0)
Definition at line 18 of file debug.h.
Referenced by bind_signals(), mmdb_open_write(), and mmdb_resize().
#define dprintk | ( | args... | ) |
Definition at line 68 of file debug.h.
Referenced by auto_sensor_event(), auto_update_profile_event(), bal_L(), bal_R(), bind_mux_socket(), bind_signals(), bsd_error_callback(), close_sockets(), delete(), dnschild_destruct(), dnschild_finish(), dnschild_init(), dnschild_kill(), dnschild_request(), do_queue(), dump_restart_db(), dump_restart_db_xdr(), fork_and_dump(), GetMechToMechID(), heartbeat_init(), heartbeat_stop(), load_restart_db(), load_restart_db_xdr(), logcache_close(), logcache_destruct(), logcache_expire(), logcache_init(), logcache_open(), mmdb_close(), mmdb_db_read(), mmdb_open_write(), mmdb_read_uint64(), mmdb_write_uint64(), mux_release_socket(), muxevent_initialize(), network_client_input(), process_input(), release_descriptor(), run_command(), runqueues(), shovechars(), signal_BUS(), signal_PIPE(), signal_SEGV(), signal_TERM(), signal_USR1(), sprout(), telnet_handle_subop(), telnet_handle_will(), telnet_init(), telnet_read_ring(), and telnet_write().
#define IF_FAIL_ERRNO | ( | condition, | |||
args... | ) |
#define printk | ( | args... | ) |
Value:
do { \ struct timeval tv; struct tm tm; time_t now; \ time(&now); localtime_r(&now, &tm); gettimeofday(&tv, NULL); \ fprintf(stderr, "%02d%02d%02d.%08d:%5d %s (%s:%d)] ", \ tm.tm_hour, tm.tm_min, tm.tm_sec, (int)tv.tv_usec, getpid(), __FUNCTION__, \ __FILE__, __LINE__); \ fprintf(stderr, args); \ fprintf(stderr, "\n"); \ } while(0)
Definition at line 72 of file debug.h.
Referenced by do_second(), load_bqe(), load_restart_db_xdr(), mmdb_read_uint(), and mmdb_write_uint().