summaryrefslogtreecommitdiffstats
path: root/debug.c
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2008-02-13 08:14:47 +0000
committerRainer Gerhards <rgerhards@adiscon.com>2008-02-13 08:14:47 +0000
commit722e691af737862b32515fd5644feb33547eff8f (patch)
treec6730a14de9a90d9012aac2243e5c87ae743f9b1 /debug.c
parent088ad960e9d77d6a58a3914e53275a5e40b85dc3 (diff)
downloadrsyslog-722e691af737862b32515fd5644feb33547eff8f.tar.gz
rsyslog-722e691af737862b32515fd5644feb33547eff8f.tar.xz
rsyslog-722e691af737862b32515fd5644feb33547eff8f.zip
- introduced a new, more powerful, message submission interface submitMsg()
in additon to logmsg() - a first, rough implementation of imfile that is able to read files (but does not persist or handle rotation or whatever)
Diffstat (limited to 'debug.c')
-rw-r--r--debug.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/debug.c b/debug.c
index d634b247..74794e7f 100644
--- a/debug.c
+++ b/debug.c
@@ -58,6 +58,7 @@ static dbgThrdInfo_t *dbgGetThrdInfo(void);
int Debug; /* debug flag - read-only after startup */
int debugging_on = 0; /* read-only, except on sig USR1 */
static int bLogFuncFlow = 0; /* shall the function entry and exit be logged to the debug log? */
+static int bLogAllocFree = 0; /* shall calls to (m/c)alloc and free be logged to the debug log? */
static int bPrintFuncDBOnExit = 0; /* shall the function entry and exit be logged to the debug log? */
static int bPrintMutexAction = 0; /* shall mutex calls be printed to the debug log? */
static int bPrintTime = 1; /* print a timestamp together with debug message */
@@ -554,8 +555,9 @@ int dbgCondTimedWait(pthread_cond_t *cond, pthread_mutex_t *pmut, const struct t
void dbgFree(void *pMem, dbgFuncDB_t *pFuncDB, int ln, int iStackPtr)
{
dbgRecordExecLocation(iStackPtr, ln);
- dbgprintf("%s:%d:%s: free %p\n", pFuncDB->file,
- ln, pFuncDB->func, (void*) pMem);
+ if(bLogAllocFree) {
+ dbgprintf("%s:%d:%s: free %p\n", pFuncDB->file, ln, pFuncDB->func, (void*) pMem);
+ }
free(pMem);
}