summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2011-12-19 14:16:32 +0100
committerRainer Gerhards <rgerhards@adiscon.com>2011-12-19 14:19:37 +0100
commit32203be41af9c682a4f81c629f08b0593d755f69 (patch)
tree0a098604fc795be32864d9880e9c72256c4bc7b1
parent58d1c9e21b2c31a1f1f6631275a6f90886321269 (diff)
downloadrsyslog-32203be41af9c682a4f81c629f08b0593d755f69.tar.gz
rsyslog-32203be41af9c682a4f81c629f08b0593d755f69.tar.xz
rsyslog-32203be41af9c682a4f81c629f08b0593d755f69.zip
better performance for action stats & cleanup: removing debug prints
-rw-r--r--action.c9
-rw-r--r--runtime/msg.c4
2 files changed, 6 insertions, 7 deletions
diff --git a/action.c b/action.c
index 66d7b55c..7226e7d6 100644
--- a/action.c
+++ b/action.c
@@ -1617,14 +1617,16 @@ doQueueEnqObjDirectBatch(action_t *pAction, batch_t *pBatch)
pBatch->pElem[i].bFilterOK = 0;
bModifiedFilter = 1;
}
- if(pBatch->pElem[i].bFilterOK)
+ if(pBatch->pElem[i].bFilterOK) {
+ STATSCOUNTER_INC(pAction->ctrProcessed, pAction->mutCtrProcessed);
bNeedSubmit = 1;
+ }
DBGPRINTF("action %p[%d]: filterOK:%d state:%d execWhenPrev:%d prevWasSusp:%d\n",
pAction, i, pBatch->pElem[i].bFilterOK, pBatch->pElem[i].state,
pAction->bExecWhenPrevSusp, pBatch->pElem[i].bPrevWasSuspended);
}
if(bNeedSubmit) {
- countStatsBatchEnq(pAction, pBatch);
+ /* note: stats were already computed above */
iRet = qqueueEnqObjDirectBatch(pAction->pQueue, pBatch);
} else {
DBGPRINTF("no need to submit batch, all bFilterOK==0\n");
@@ -1639,7 +1641,8 @@ doQueueEnqObjDirectBatch(action_t *pAction, batch_t *pBatch)
}
}
} else {
- countStatsBatchEnq(pAction, pBatch);
+ if(GatherStats)
+ countStatsBatchEnq(pAction, pBatch);
iRet = qqueueEnqObjDirectBatch(pAction->pQueue, pBatch);
}
diff --git a/runtime/msg.c b/runtime/msg.c
index 0744edd5..759554d8 100644
--- a/runtime/msg.c
+++ b/runtime/msg.c
@@ -1671,8 +1671,6 @@ void MsgSetTAG(msg_t *pMsg, uchar* pszBuf, size_t lenBuf)
uchar *pBuf;
assert(pMsg != NULL);
-dbgprintf("MsgSetTAG in: len %d, pszBuf: %s\n", lenBuf, pszBuf);
-
freeTAG(pMsg);
pMsg->iLenTAG = lenBuf;
@@ -1691,8 +1689,6 @@ dbgprintf("MsgSetTAG in: len %d, pszBuf: %s\n", lenBuf, pszBuf);
memcpy(pBuf, pszBuf, pMsg->iLenTAG);
pBuf[pMsg->iLenTAG] = '\0'; /* this also works with truncation! */
-
-dbgprintf("MsgSetTAG exit: pMsg->iLenTAG %d, pMsg->TAG.szBuf: %s\n", pMsg->iLenTAG, pMsg->TAG.szBuf);
}