CLEANUP: spoe: Remove unused variables the agent structure
applets_act and applets_idle were used for debugging purpose. Now, these values
are part of the agent's counters.
diff --git a/include/types/spoe.h b/include/types/spoe.h
index c01a03e..2f13d37 100644
--- a/include/types/spoe.h
+++ b/include/types/spoe.h
@@ -265,10 +265,6 @@
/* running info */
struct {
unsigned int frame_size; /* current maximum frame size, only used to encode messages */
-#if defined(DEBUG_SPOE) || defined(DEBUG_FULL)
- unsigned int applets_act; /* # of applets alive at a time */
- unsigned int applets_idle; /* # of applets in the state SPOE_APPCTX_ST_IDLE */
-#endif
unsigned int processing;
struct freq_ctr processing_per_sec;
diff --git a/src/flt_spoe.c b/src/flt_spoe.c
index 4e27c63..f96a94f 100644
--- a/src/flt_spoe.c
+++ b/src/flt_spoe.c
@@ -1239,7 +1239,6 @@
__FUNCTION__, appctx);
/* Remove applet from the list of running applets */
- SPOE_DEBUG_STMT(agent->rt[tid].applets_act--);
HA_ATOMIC_SUB(&agent->counters.applets, 1);
HA_SPIN_LOCK(SPOE_APPLET_LOCK, &agent->rt[tid].lock);
if (!LIST_ISEMPTY(&spoe_appctx->list)) {
@@ -1252,7 +1251,6 @@
if (appctx->st0 != SPOE_APPCTX_ST_END) {
if (appctx->st0 == SPOE_APPCTX_ST_IDLE) {
eb32_delete(&spoe_appctx->node);
- SPOE_DEBUG_STMT(agent->rt[tid].applets_idle--);
HA_ATOMIC_SUB(&agent->counters.idles, 1);
}
@@ -1437,7 +1435,6 @@
default:
/* HELLO handshake is finished, set the idle timeout and
* add the applet in the list of running applets. */
- SPOE_DEBUG_STMT(agent->rt[tid].applets_idle++);
HA_ATOMIC_ADD(&agent->counters.idles, 1);
appctx->st0 = SPOE_APPCTX_ST_IDLE;
SPOE_APPCTX(appctx)->node.key = 0;
@@ -1725,7 +1722,6 @@
}
if (appctx->st0 == SPOE_APPCTX_ST_PROCESSING && SPOE_APPCTX(appctx)->cur_fpa < agent->max_fpa) {
- SPOE_DEBUG_STMT(agent->rt[tid].applets_idle++);
HA_ATOMIC_ADD(&agent->counters.idles, 1);
appctx->st0 = SPOE_APPCTX_ST_IDLE;
eb32_insert(&agent->rt[tid].idle_applets, &SPOE_APPCTX(appctx)->node);
@@ -1889,7 +1885,6 @@
goto switchstate;
case SPOE_APPCTX_ST_IDLE:
- SPOE_DEBUG_STMT(agent->rt[tid].applets_idle--);
HA_ATOMIC_SUB(&agent->counters.idles, 1);
eb32_delete(&SPOE_APPCTX(appctx)->node);
if (stopping &&
@@ -2007,7 +2002,6 @@
HA_SPIN_LOCK(SPOE_APPLET_LOCK, &conf->agent->rt[tid].lock);
LIST_ADDQ(&conf->agent->rt[tid].applets, &SPOE_APPCTX(appctx)->list);
HA_SPIN_UNLOCK(SPOE_APPLET_LOCK, &conf->agent->rt[tid].lock);
- SPOE_DEBUG_STMT(conf->agent->rt[tid].applets_act++);
HA_ATOMIC_ADD(&conf->agent->counters.applets, 1);
task_wakeup(SPOE_APPCTX(appctx)->task, TASK_WOKEN_INIT);
@@ -2099,9 +2093,9 @@
SPOE_PRINTF(stderr, "%d.%06d [SPOE/%-15s] %s: stream=%p"
" - Add stream in sending queue"
- " - applets_act=%u - applets_idle=%u - processing=%u\n",
+ " - applets=%u - idles=%u - processing=%u\n",
(int)now.tv_sec, (int)now.tv_usec, agent->id, __FUNCTION__,
- ctx->strm, agent->rt[tid].applets_act, agent->rt[tid].applets_idle,
+ ctx->strm, agent->counters.applets, agent->counters.idles,
agent->rt[tid].processing);
/* Finally try to wakeup an IDLE applet. */
@@ -3358,8 +3352,6 @@
}
for (i = 0; i < global.nbthread; ++i) {
curagent->rt[i].frame_size = curagent->max_frame_size;
- SPOE_DEBUG_STMT(curagent->rt[i].applets_act = 0);
- SPOE_DEBUG_STMT(curagent->rt[i].applets_idle = 0);
curagent->rt[i].processing = 0;
LIST_INIT(&curagent->rt[i].applets);
LIST_INIT(&curagent->rt[i].sending_queue);