aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarald Welte <laforge@osmocom.org>2021-01-30 22:42:15 +0100
committerHarald Welte <laforge@osmocom.org>2021-01-31 12:34:36 +0100
commit4c54f59aa58384b1dcd21587ad5281b6cd908517 (patch)
tree4eb37a48a5e9bf6f2ee775ef9f3ea08061c14c91
parentf22ae5af5f2df0e2e643c50f51978a4ca96d618a (diff)
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
-rw-r--r--src/gb/gprs_ns2_vc_fsm.c6
1 files changed, 5 insertions, 1 deletions
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);