summaryrefslogtreecommitdiffstats
path: root/debug.c
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2008-02-20 09:54:58 +0000
committerRainer Gerhards <rgerhards@adiscon.com>2008-02-20 09:54:58 +0000
commitf02d615052e325616d7042096cea6e5247a980dc (patch)
treefed57a226daf1f0e052ead727fe99b858c3f1331 /debug.c
parent0af8d22ff6e9fbd8eb89a1612ecf4604f058f78c (diff)
downloadrsyslog-f02d615052e325616d7042096cea6e5247a980dc.tar.gz
rsyslog-f02d615052e325616d7042096cea6e5247a980dc.tar.xz
rsyslog-f02d615052e325616d7042096cea6e5247a980dc.zip
- basic implementation of expression parser parsing done
- improved ABNF a bit
Diffstat (limited to 'debug.c')
-rw-r--r--debug.c19
1 files changed, 16 insertions, 3 deletions
diff --git a/debug.c b/debug.c
index 5887f5dc..00b7916b 100644
--- a/debug.c
+++ b/debug.c
@@ -57,7 +57,7 @@ static dbgThrdInfo_t *dbgGetThrdInfo(void);
/* static data (some time to be replaced) */
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 bLogFuncFlow = 1; /* 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? */
@@ -741,6 +741,17 @@ dbgoprint(obj_t *pObj, char *fmt, ...)
if(!(Debug && debugging_on))
return;
+ /* a quick and very dirty hack to enable us to display just from those objects
+ * that we are interested in. So far, this must be changed at compile time (and
+ * chances are great it is commented out while you read it. Later, this shall
+ * be selectable via the environment. -- rgerhards, 2008-02-20
+ */
+#if 0
+ if(objGetObjID(pObj) != OBJexpr)
+ return;
+#endif
+
+
pthread_mutex_lock(&mutdbgoprint);
pthread_cleanup_push(dbgMutexCancelCleanupHdlr, &mutdbgoprint);
@@ -918,7 +929,8 @@ int dbgEntrFunc(dbgFuncDB_t *pFuncDB, int line)
/* when we reach this point, we have a fully-initialized FuncDB! */
- if(bLogFuncFlow)
+ //if(bLogFuncFlow) /* quick debug hack... select the best for you! */
+ if(bLogFuncFlow && !strcmp((char*)pFuncDB->file, "expr.c")) /* quick debug hack... select the best for you! */
dbgprintf("%s:%d: %s: enter\n", pFuncDB->file, pFuncDB->line, pFuncDB->func);
if(pThrd->stackPtr >= (int) (sizeof(pThrd->callStack) / sizeof(dbgFuncDB_t*))) {
dbgprintf("%s:%d: %s: debug module: call stack for this thread full, suspending call tracking\n",
@@ -947,7 +959,8 @@ void dbgExitFunc(dbgFuncDB_t *pFuncDB, int iStackPtrRestore)
assert(pFuncDB->magic == dbgFUNCDB_MAGIC);
dbgFuncDBPrintActiveMutexes(pFuncDB, "WARNING: mutex still owned by us as we exit function, mutex: ", pthread_self());
- if(bLogFuncFlow)
+ //if(bLogFuncFlow) /* quick debug hack... select the best for you! */
+ if(bLogFuncFlow && !strcmp((char*)pFuncDB->file, "expr.c")) /* quick debug hack... select the best for you! */
dbgprintf("%s:%d: %s: exit\n", pFuncDB->file, pFuncDB->line, pFuncDB->func);
pThrd->stackPtr = iStackPtrRestore;
if(pThrd->stackPtr < 0) {