diff options
author | Rainer Gerhards <rgerhards@adiscon.com> | 2008-01-22 20:25:48 +0000 |
---|---|---|
committer | Rainer Gerhards <rgerhards@adiscon.com> | 2008-01-22 20:25:48 +0000 |
commit | 3ab9ce1b9f30e901735576a4c89faf4521d4b08e (patch) | |
tree | 6fc1b45987d5df74a07e9b5572771d964d2b5d3a /debug.h | |
parent | 6ba75629051613c43b5d7cbc937a8243b250886c (diff) | |
download | rsyslog-3ab9ce1b9f30e901735576a4c89faf4521d4b08e.tar.gz rsyslog-3ab9ce1b9f30e901735576a4c89faf4521d4b08e.tar.xz rsyslog-3ab9ce1b9f30e901735576a4c89faf4521d4b08e.zip |
added thread-specific call stack to debug interface
Diffstat (limited to 'debug.h')
-rw-r--r-- | debug.h | 19 |
1 files changed, 19 insertions, 0 deletions
@@ -30,7 +30,26 @@ extern int Debug; /* debug flag - read-only after startup */ extern int debugging_on; /* read-only, except on sig USR1 */ /* prototypes */ +rsRetVal dbgClassInit(void); void sigsegvHdlr(int signum); void dbgprintf(char *fmt, ...) __attribute__((format(printf,1, 2))); +void dbgEntrFunc(char* file, int line, const char* func); +void dbgExitFunc(char* file, int line, const char* func); + +/* macros */ +#if 1 /* DEV debug: set to 1 to get a rough call trace -- rgerhards, 2008-01-13 */ +# define BEGINfunc dbgEntrFunc(__FILE__, __LINE__, __func__); +# define ENDfunc dbgExitFunc(__FILE__, __LINE__, __func__); +#else +# define BEGINfunc +# define ENDfunc +#endif +#if 1 /* DEV debug: set to 1 to enable -- rgerhards, 2008-01-13 */ +# define RUNLOG dbgprintf("%s:%d: %s: log point\n", __FILE__, __LINE__, __func__) +# define RUNLOG_VAR(fmt, x) dbgprintf("%s:%d: %s: var '%s'[%s]: " fmt "\n", __FILE__, __LINE__, __func__, #x, fmt, x) +#else +# define RUNLOG +# define RUNLOG_VAR(x) +#endif #endif /* #ifndef DEBUG_H_INCLUDED */ |