From 4c54f59aa58384b1dcd21587ad5281b6cd908517 Mon Sep 17 00:00:00 2001 From: Harald Welte Date: Sat, 30 Jan 2021 22:42:15 +0100 Subject: ns2: Implement more rate counters The counters had all been lost in the ns -> ns2 configuration, let's try to implement some more of them: LOST_ALIVE, BLOCKED, LOST_RESET. Change-Id: I75d8637bd142722fdf9a162a2369aa9cdc980a57 --- src/gb/gprs_ns2_vc_fsm.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/gb/gprs_ns2_vc_fsm.c b/src/gb/gprs_ns2_vc_fsm.c index 457a41f4..e69f327e 100644 --- a/src/gb/gprs_ns2_vc_fsm.c +++ b/src/gb/gprs_ns2_vc_fsm.c @@ -204,6 +204,7 @@ static void alive_timeout_handler(void *data) osmo_timer_schedule(&priv->alive.timer, nsi->timeout[NS_TOUT_TNS_ALIVE], 0); break; case NS_TOUT_TNS_ALIVE: + rate_ctr_inc(&priv->nsvc->ctrg->ctr[NS_CTR_LOST_ALIVE]); priv->alive.N++; if (priv->alive.N <= nsi->timeout[NS_TOUT_TNS_ALIVE_RETRIES]) { @@ -296,8 +297,10 @@ static void ns2_st_blocked_onenter(struct osmo_fsm_inst *fi, uint32_t old_state) { struct gprs_ns2_vc_priv *priv = fi->priv; - if (old_state != GPRS_NS2_ST_BLOCKED) + if (old_state != GPRS_NS2_ST_BLOCKED) { priv->N = 0; + rate_ctr_inc(&priv->nsvc->ctrg->ctr[NS_CTR_BLOCKED]); + } if (priv->om_blocked) { /* we are already blocked after a RESET */ @@ -480,6 +483,7 @@ static int ns2_vc_fsm_timer_cb(struct osmo_fsm_inst *fi) switch (fi->state) { case GPRS_NS2_ST_RESET: if (priv->initiate_reset) { + rate_ctr_inc(&priv->nsvc->ctrg->ctr[NS_CTR_LOST_RESET]); priv->N++; if (priv->N <= nsi->timeout[NS_TOUT_TNS_RESET_RETRIES]) { osmo_fsm_inst_state_chg(fi, GPRS_NS2_ST_RESET, nsi->timeout[NS_TOUT_TNS_RESET], 0); -- cgit v1.2.3