summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2009-05-25 10:47:22 +0200
committerRainer Gerhards <rgerhards@adiscon.com>2009-05-25 10:47:22 +0200
commiteb1615068c6a704287eda732d287280df4cc4c44 (patch)
treebf5d8b9cfcdf4203839faf03535149e6ad66f8fc /tools
parent7adb9877f0c08f929d89f436103dfade03e8ea07 (diff)
downloadrsyslog-eb1615068c6a704287eda732d287280df4cc4c44.tar.gz
rsyslog-eb1615068c6a704287eda732d287280df4cc4c44.tar.xz
rsyslog-eb1615068c6a704287eda732d287280df4cc4c44.zip
added new testing module imdiag
which enables to talk to the rsyslog core at runtime. The current implementation is only a beginning, but can be expanded over time
Diffstat (limited to 'tools')
-rw-r--r--tools/syslogd.c27
1 files changed, 22 insertions, 5 deletions
diff --git a/tools/syslogd.c b/tools/syslogd.c
index dc5b8fee..0b860448 100644
--- a/tools/syslogd.c
+++ b/tools/syslogd.c
@@ -350,10 +350,8 @@ static rsRetVal resetConfigVariables(uchar __attribute__((unused)) *pp, void __a
bDebugPrintModuleList = 1;
bEscapeCCOnRcv = 1; /* default is to escape control characters */
bReduceRepeatMsgs = 0;
- if(pszMainMsgQFName != NULL) {
- free(pszMainMsgQFName);
- pszMainMsgQFName = NULL;
- }
+ free(pszMainMsgQFName);
+ pszMainMsgQFName = NULL;
iMainMsgQueueSize = 10000;
iMainMsgQHighWtrMark = 8000;
iMainMsgQLowWtrMark = 2000;
@@ -412,6 +410,26 @@ static int usage(void)
}
+/* ------------------------------ some support functions for imdiag ------------------------------ *
+ * This is a bit dirty, but the only way to do it, at least with reasonable effort.
+ * rgerhards, 2009-05-25
+ */
+
+/* return back the approximate current number of messages in the main message queue
+ */
+rsRetVal
+diagGetMainMsgQSize(int *piSize)
+{
+ DEFiRet;
+ assert(piSize != NULL);
+ *piSize = pMsgQueue->iQueueSize;
+ RETiRet;
+}
+
+
+/* ------------------------------ end support functions for imdiag ------------------------------ */
+
+
/* function to destruct a selector_t object
* rgerhards, 2007-08-01
*/
@@ -2658,7 +2676,6 @@ init(void)
ABORT_FINALIZE(RS_RET_VALIDATION_RUN);
/* switch the message object to threaded operation, if necessary */
-/* TODO:XXX: I think we must do this also if we have action queues! -- rgerhards, 2009-01-26 */
if(MainMsgQueType == QUEUETYPE_DIRECT || iMainMsgQueueNumWorkers > 1) {
MsgEnableThreadSafety();
}